502-Bad Request #1481
-
Describe the bugWhen accessing my lagfuse the error occurs: 502-Bad Request Thank you very much. To reproduceWhen accessing the URL of my langfuse the error occurs on the browser screen: Additional informationMy docker version is: Server: Docker Engine - Community |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Hi @tbarbito thanks for reporting this. This is not a bug, as the current docker container works as expected. This likely is an issue with the configuration of your deployment. |
Beta Was this translation helpful? Give feedback.
-
Just set I had the same problem. I solved this problem with this trouble shooting guide |
Beta Was this translation helpful? Give feedback.
-
Tried to set
Here is the docker compose configure # https://github.com/langfuse/langfuse/blob/main/docker-compose.yml
services:
reverse-proxy:
image: traefik:v3.1.2
# Enables the web UI and tells Traefik to listen to docker
command:
- "--api.insecure=true"
- "--providers.docker=true"
# - "--log.level=DEBUG"
- "--entrypoints.web.address=:80"
ports:
# The HTTP port
- "${SERVER_PORT:-8089}:80"
# The Web UI (enabled by --api.insecure=true)
- "8080:8080"
volumes:
# So that Traefik can listen to the Docker events
- /var/run/docker.sock:/var/run/docker.sock
langfuse-server:
image: langfuse/langfuse:2
depends_on:
db:
condition: service_healthy
ports:
- "3000:3000"
environment:
# https://langfuse.com/docs/deployment/self-host#troubleshooting
# https://github.com/orgs/langfuse/discussions/1481
- HOSTNAME=0.0.0.0
- DATABASE_URL=postgresql://postgres:postgres@db:5432/postgres
- NEXTAUTH_SECRET=mysecret
- SALT=mysalt
- ENCRYPTION_KEY=0000000000000000000000000000000000000000000000000000000000000000 # generate via `openssl rand -hex 32`
- NEXTAUTH_URL=http://${SERVER_HOST:-localhost}:${SERVER_PORT:-8089}
- TELEMETRY_ENABLED=${TELEMETRY_ENABLED:-true}
- LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES=${LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES:-false}
- LANGFUSE_INIT_ORG_ID=${LANGFUSE_INIT_ORG_ID:-}
- LANGFUSE_INIT_ORG_NAME=${LANGFUSE_INIT_ORG_NAME:-}
- LANGFUSE_INIT_PROJECT_ID=${LANGFUSE_INIT_PROJECT_ID:-}
- LANGFUSE_INIT_PROJECT_NAME=${LANGFUSE_INIT_PROJECT_NAME:-}
- LANGFUSE_INIT_PROJECT_PUBLIC_KEY=${LANGFUSE_INIT_PROJECT_PUBLIC_KEY:-}
- LANGFUSE_INIT_PROJECT_SECRET_KEY=${LANGFUSE_INIT_PROJECT_SECRET_KEY:-}
- LANGFUSE_INIT_USER_EMAIL=${LANGFUSE_INIT_USER_EMAIL:-}
- LANGFUSE_INIT_USER_NAME=${LANGFUSE_INIT_USER_NAME:-}
- LANGFUSE_INIT_USER_PASSWORD=${LANGFUSE_INIT_USER_PASSWORD:-}
# https://langfuse.com/docs/deployment/self-host#custom-base-path
labels:
traefik.http.routers.langfuse.rule: "Host(`${SERVER_HOST:-localhost}`)"
traefik.http.services.langfuse.loadbalancer.server.port: 3000
db:
image: postgres
restart: always
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 3s
timeout: 3s
retries: 10
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 This is the environment configure # Docker Compose
SERVER_HOST=localhost
SERVER_PORT=8089
# Langfuse
# TELEMETRY_ENABLED=true
# LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES=false
LANGFUSE_INIT_ORG_ID=0
LANGFUSE_INIT_ORG_NAME=Puff
LANGFUSE_INIT_PROJECT_ID=0
LANGFUSE_INIT_PROJECT_NAME=Puff
LANGFUSE_INIT_PROJECT_PUBLIC_KEY=public_key
LANGFUSE_INIT_PROJECT_SECRET_KEY=secret_key
LANGFUSE_INIT_USER_EMAIL=admin@email.com
LANGFUSE_INIT_USER_NAME=Admin
# Password needs to be at least 8 characters long
LANGFUSE_INIT_USER_PASSWORD=password
# Streamlit (Just follow the settings above or can be customized in Langfuse)
LANGFUSE_HOST="http://localhost:8089"
LANGFUSE_PUBLIC_KEY=public_key
LANGFUSE_SECRET_KEY=secret_key And here is the Python code from langfuse import Langfuse
from dotenv import load_dotenv
import os
load_dotenv()
# LANGFUSE_HOST = f"http://{os.getenv('SERVER_HOST')}:{os.getenv('SERVER_PORT')}"
LANGFUSE_HOST = "http://localhost:3000"
PUBLIC_KEY = os.getenv("LANGFUSE_INIT_PROJECT_PUBLIC_KEY")
SECRET_KEY = os.getenv("LANGFUSE_INIT_PROJECT_SECRET_KEY")
print(LANGFUSE_HOST, PUBLIC_KEY, SECRET_KEY)
# https://langfuse.com/docs/sdk/python/decorators
langfuse = Langfuse(secret_key=SECRET_KEY, public_key=PUBLIC_KEY, host=LANGFUSE_HOST)
print(langfuse.auth_check())
from langfuse.decorators import observe
@observe()
def test():
print("Hello, from the test function!")
test()
import ipdb
ipdb.set_trace() Both |
Beta Was this translation helpful? Give feedback.
Hi @tbarbito thanks for reporting this. This is not a bug, as the current docker container works as expected. This likely is an issue with the configuration of your deployment.