thatDC
thatDC•8mo ago

Docker compose issues

Kinda? I'm not sure if that FATAL error is supposed to be there. The only thing I did differently was changing the directive port: 3030:3000 in the docker compose file to expose the service on the port 3030 as 3000 is already in use on my server. However, it seems to work, maybe that FATAL is not that... fatal 😄 I see (on the documentation) that the docker compose solution is not recommended for a number of reasons, I'd like to understand why I cannot start Langfuse in the traditional docker way :/
No description
5 Replies
Marc
Marc•8mo ago
I've just tried this on my machine and cannot replicate it unfortunatley, can you share your docker compose file? mine
version: "3.5"

services:
langfuse-server:
image: ghcr.io/langfuse/langfuse:latest
depends_on:
- db
ports:
- "3030:3000"
environment:
- NODE_ENV=production
- DATABASE_URL=postgresql://postgres:postgres@db:5432/postgres
- NEXTAUTH_SECRET=mysecret
- SALT=mysalt
- NEXTAUTH_URL=http://localhost:3030
- TELEMETRY_ENABLED=${TELEMETRY_ENABLED:-true}
- NEXT_PUBLIC_SIGN_UP_DISABLED=${NEXT_PUBLIC_SIGN_UP_DISABLED:-false}
- LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES=${LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES:-false}

db:
image: postgres
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres
ports:
- 5432:5432
volumes:
- database_data:/var/lib/postgresql/data

volumes:
database_data:
driver: local
version: "3.5"

services:
langfuse-server:
image: ghcr.io/langfuse/langfuse:latest
depends_on:
- db
ports:
- "3030:3000"
environment:
- NODE_ENV=production
- DATABASE_URL=postgresql://postgres:postgres@db:5432/postgres
- NEXTAUTH_SECRET=mysecret
- SALT=mysalt
- NEXTAUTH_URL=http://localhost:3030
- TELEMETRY_ENABLED=${TELEMETRY_ENABLED:-true}
- NEXT_PUBLIC_SIGN_UP_DISABLED=${NEXT_PUBLIC_SIGN_UP_DISABLED:-false}
- LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES=${LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES:-false}

db:
image: postgres
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres
ports:
- 5432:5432
volumes:
- database_data:/var/lib/postgresql/data

volumes:
database_data:
driver: local
Langfuse worked on localhost:3030 Can you share your environment config?
thatDC
thatDC•8mo ago
version: "3.5"

services:
langfuse-server:
image: ghcr.io/langfuse/langfuse:latest
depends_on:
- db
ports:
- "3031:3000"
environment:
- NODE_ENV=production
- DATABASE_URL=postgresql://postgres:postgres@db:5432/postgres
- NEXTAUTH_SECRET=mysecret
- SALT=mysalt
- NEXTAUTH_URL=<server_url>
- TELEMETRY_ENABLED=${TELEMETRY_ENABLED:-true}
- NEXT_PUBLIC_SIGN_UP_DISABLED=${NEXT_PUBLIC_SIGN_UP_DISABLED:-false}
- LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES=${LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES:-false}

db:
image: postgres
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres
ports:
- 5432:5432
volumes:
- database_data:/var/lib/postgresql/data

volumes:
database_data:
driver: local
version: "3.5"

services:
langfuse-server:
image: ghcr.io/langfuse/langfuse:latest
depends_on:
- db
ports:
- "3031:3000"
environment:
- NODE_ENV=production
- DATABASE_URL=postgresql://postgres:postgres@db:5432/postgres
- NEXTAUTH_SECRET=mysecret
- SALT=mysalt
- NEXTAUTH_URL=<server_url>
- TELEMETRY_ENABLED=${TELEMETRY_ENABLED:-true}
- NEXT_PUBLIC_SIGN_UP_DISABLED=${NEXT_PUBLIC_SIGN_UP_DISABLED:-false}
- LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES=${LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES:-false}

db:
image: postgres
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres
ports:
- 5432:5432
volumes:
- database_data:/var/lib/postgresql/data

volumes:
database_data:
driver: local
Changed to port 3031 for other reasons. By the way, Langfuse is now working, I am just a little confused on the FATAL message showing up in the logs. If possible I'd like to go back to the Docker standard deployment, which should be more secure and stable, as stated in Langfuse doc
Marc
Marc•8mo ago
Ok perfect, I cannot replicate this error and have not seen it before unfortunately Good that it is not as fatal as it sounded Do you have issues with the production docker setup with a separate postgres db? Docker compose is just not recommended as some folks have issues with lost postgres state when upgrading
thatDC
thatDC•8mo ago
Yes, I sent a message yesterday in the chat, just before experiencing this issue. Basically Langfuse cannot reach the DB I set up on postgres. The dedicated postgres is not on another container, but installed with apt-get
Prisma schema loaded from prisma/schema.prisma
Datasource "db": PostgreSQL database "langfuse", schema "public" at "localhost:5432"

Applying database migrations failed. This is mostly caused by the database being unavailable.
Exiting...
Prisma schema loaded from prisma/schema.prisma
Datasource "db": PostgreSQL database "langfuse", schema "public" at "localhost:5432"

Applying database migrations failed. This is mostly caused by the database being unavailable.
Exiting...
Marc
Marc•8mo ago
Got it, I remember the conversation. I think this is not a Langfuse specific issue but general docker networking of granting access to the port as I cannot replicate the issue via docker compose Happy to help though if you share more details Best case: if you have a docker compose config which replicates the issue so I can try it