FAST Jo
FAST Jo•11mo ago

Postgres Migration Problem

Hey Folks, I'm trying setting up the self hosted version of your very promising tool but run in some problems: 1. Do you have a Docker Image made for ARM Architecture? Or have it planned to do so? (WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested 2. When I try to set up the docker, the database migration fails with: Prisma schema loaded from prisma/schema.prisma Datasource "db": PostgreSQL database "postgres", schema "public" at "localhost:5432" Applying database migrations failed. Exiting... Are there more requierements for the postgres DB (do I have to create a database I'm not aware of or anything?)? I'm super curious to implement your tool in my project! Please help me do so 🙂
13 Replies
FAST Jo
FAST Jo•11mo ago
Ps. I'm running this docker command: docker run --name langfuse \ -e DATABASE_URL=postgresql://postgres:XXXX@localhost:5432 \ -e NEXTAUTH_URL=http://localhost:3000 \ -e NEXTAUTH_SECRET=XXXX= \ -e SALT=mysalt \ -p 3000:3000 \ -a STDOUT and the database url is verified by running it with psql "postgresql://postgres:xxxx@localhost:5432" -> postgres=#
FAST Jo
FAST Jo•11mo ago
Pps. Now I tried to build the container myself as described in https://langfuse.com/docs/deployment/local Set Up works buitiful but then the Log In Page appears. Not very suprisingly, my langfuse credentials don't work (since I'm running it local), I guess the password would be the one I set in the docker_compose as NEXTAUTH_SECRET= XXXX But which user does the password belong to
Local Machine - Langfuse
Self-hosting instructions for Langfuse using Docker
Marc
Marc•11mo ago
Thanks for just booking 15 min, let’s debug together and fix the docs accordingly!
FAST Jo
FAST Jo•11mo ago
Hey I found a solution! The problem was, that the database could'nt be seen by the container. I needed to replace the 'localhost' with docker.host.internal in my database connection string.
docker run --name langfuse \
-e DATABASE_URL=postgresql://USER:PW@host.docker.internal:5432 \
-e NEXTAUTH_URL=http://localhost:3000 \
-e NEXTAUTH_SECRET=mysecret \
-e SALT=mysalt \
-p 3000:3000 \
-a STDOUT \
ghcr.io/langfuse/langfuse:latest
docker run --name langfuse \
-e DATABASE_URL=postgresql://USER:PW@host.docker.internal:5432 \
-e NEXTAUTH_URL=http://localhost:3000 \
-e NEXTAUTH_SECRET=mysecret \
-e SALT=mysalt \
-p 3000:3000 \
-a STDOUT \
ghcr.io/langfuse/langfuse:latest
Marc
Marc•11mo ago
Happy to hear that
kranthi
kranthi•10mo ago
@Marc is there a docker image for linux/arm64 ?
Marc
Marc•10mo ago
Not yet. There is an open issue tracking this. What’s your use case for it?
kranthi
kranthi•10mo ago
I'm using aws cloud and graviton instances for application which requires arm64 architecture image.
Marc
Marc•10mo ago
Understood Is there a reason why you want to use graviton instances to run the langfuse container?
kranthi
kranthi•10mo ago
Not specific to langfuse but in general graviton instances are cheaper compared to non-graviton instances.
Marc
Marc•10mo ago
Yep agree, happy to support a PR on this, this is tracked here: https://github.com/langfuse/langfuse/issues/452
GitHub
feat: Publish arm64 compatible docker images · Issue #452 · langfus...
Describe the feature you'd like to request Would love to see arm64 compatible docker images that we can deploy to AWS graviton instances! Describe the solution you'd like to see Building mu...
myetginbal
myetginbal•6mo ago
Hi, I've been having the same issue for a while, solved with solution you've suggested. Just wanted emphasize for others as a reference.
Marc
Marc•6mo ago
Thanks for sharing, the docker compose file is probably a good reference for this setup as it also includes docker internal networking