Skip to content

fix: point the docker compose healthcheck at the langchain_test database - #336

Open
Mrxh (x1247897956) wants to merge 1 commit into
langchain-ai:mainfrom
x1247897956:fix/docker-compose-healthcheck-db
Open

Mrxh (x1247897956) wants to merge 1 commit into
langchain-ai:mainfrom
x1247897956:fix/docker-compose-healthcheck-db

Conversation

@x1247897956

Copy link
Copy Markdown

What

The pgvector service healthcheck now connects to langchain_test, matching POSTGRES_DB.

Why

POSTGRES_DB is langchain_test, but the healthcheck runs:

psql postgresql://langchain:langchain@localhost/langchain --command 'SELECT 1;'

There is no langchain database, so the check never passes. The container stays in starting indefinitely and the logs fill with:

FATAL:  database "langchain" does not exist

That means docker compose up --wait never returns for anyone using this file, and the service never reports healthy.

How tested

  • docker compose config → valid
  • docker compose down && docker compose up -d pgvector, then polled docker inspect -f '{{.State.Health.Status}}':
    • after this change: starting → healthy in ~9s
    • before this change: stayed starting (observed for 90s+, with the FATAL log line repeating every 5s)

Note

Alternatives would be pg_isready -U langchain -d langchain_test (what CI uses) or interpolating ${POSTGRES_DB}. I kept the existing psql form and changed only the database name to keep the diff minimal — happy to switch if you prefer one of those.

`POSTGRES_DB` is `langchain_test`, but the healthcheck connects to
`/langchain`, which does not exist. The check therefore never passes and the
container stays `starting` indefinitely (the logs fill with
`FATAL: database "langchain" does not exist`), so `docker compose up --wait`
never returns for anyone using this file.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant