Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quickstart docker compose hangs on relational db #218

Closed
chnadell opened this issue Jul 19, 2023 · 2 comments
Closed

Quickstart docker compose hangs on relational db #218

chnadell opened this issue Jul 19, 2023 · 2 comments

Comments

@chnadell
Copy link

chnadell commented Jul 19, 2023

The quickstart instructions recommend two different approaches:
docker compose -f docker-compose.dev.yml -p danswer-stack up -d --pull always --force-recreate
docker compose -f docker-compose.dev.yml -p danswer-stack up -d --build --force-recreate

These work almost all the way, but get stuck while trying to start danswer-stack-relational_db-1

 => CACHED [web_server runner 5/6] COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./                                                                                                                                                                              0.0s
 => CACHED [web_server runner 6/6] COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static                                                                                                                                                                      0.0s
 => [web_server] exporting to image                                                                                                                                                                                                                                                0.0s
 => => exporting layers                                                                                                                                                                                                                                                            0.0s
 => => writing image sha256:1bf5ef8a1d68f13ee6d7431887c9e38634e0db6ed2a0b0a7df69f9f47c9c63bc                                                                                                                                                                                       0.0s
 => => naming to docker.io/danswer/danswer-web-server:latest                                                                                                                                                                                                                       0.0s
[+] Running 6/7
 ⠿ Container danswer-stack-relational_db-1  Starting                                                                                                                                                                                                                              20.6s
 ✔ Container danswer-stack-search_engine-1  Started                                                                                                                                                                                                                               10.8s
 ✔ Container danswer-stack-vector_db-1      Started                                                                                                                                                                                                                               10.7s
 ✔ Container danswer-stack-background-1     Recreated                                                                                                                                                                                                                              0.1s
 ✔ Container danswer-stack-api_server-1     Recreated                                                                                                                                                                                                                              0.2s
 ✔ Container danswer-stack-web_server-1     Recreated                                                                                                                                                                                                                              0.1s
 ✔ Container danswer-stack-nginx-1          Recreated                                                                                                                                                                                                                              0.1s

There is no printed error, but the container never starts correctly.

Docker version:
Docker version 24.0.2, build cb74dfc

@chnadell
Copy link
Author

I did a little more digging on this. Looks like there is a silent failure if there is already a postgres server on port 5432. Changing docker-compose.dev.yml to have:

  relational_db:
    image: postgres:15.2-alpine
    restart: always
    environment:
      - POSTGRES_USER=${POSTGRES_USER:-postgres}
      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-password}
    ports:
      - "8002:5432"

solved the issue. I also had to do this for the nginx portion, since I already have an nginx service listening on 80. Surprisingly, the nginx container was noisy when the daemon errored:
Error response from daemon: driver failed programming external connectivity on endpoint danswer-stack-nginx-1 (9410c13fee582fdf3f7f214dc226b2a500ffc7091537320bc54c72e04f13e3b8): Error starting userland proxy: listen tcp4 0.0.0.0:80: bind: address already in use

while the relational db (postgres) container was not.

@yuhongsun96
Copy link
Contributor

Ah yes, please make sure your ports are available. Ports 3000 for the web UI and 8080 for API server are also pretty standard ports to use.

Thanks for leaving your findings for future reference

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

No branches or pull requests

2 participants