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

502 Bad Gateway for brand new installation #10227

Closed
5 tasks done
TianzeWang opened this issue Nov 4, 2024 · 4 comments
Closed
5 tasks done

502 Bad Gateway for brand new installation #10227

TianzeWang opened this issue Nov 4, 2024 · 4 comments
Labels
🐞 bug Something isn't working 🤔 cant-reproduce This issue can not be reproduced

Comments

@TianzeWang
Copy link

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

v0.10.2 - Main UTC+8 (Nov.4 12:48PM)

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I followed exactly the same to update the code and initially encountered this error. To exclude the issues of my local configuration, I created a new folder and git cloned a new copy of dify, and same issue still persists.

  1. Git clone dify main
  2. CD docker, cp .env
  3. Mac Desktop Docker updated to latest version
  4. docker compose up -d

✔️ Expected Behavior

Docker normally start up

❌ Actual Behavior

Docker showed 502 bad gateway
image

Copy link

dosubot bot commented Nov 4, 2024

@TianzeWang Hello there! I'm here to help you with any bugs, questions, or contributions for Dify. Let's tackle this issue together!

The "502 Bad Gateway" error you're encountering in a self-hosted Docker installation of Dify version v0.10.2 is likely due to Nginx forwarding the service to the wrong location. To resolve this, ensure that the containers are running and then execute the following command with root privileges to get the correct IP addresses:

docker ps -q | xargs -n 1 docker inspect --format '{{ .Name }}: {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}'

Look for lines similar to:

/docker-web-1: 172.19.0.5
/docker-api-1: 172.19.0.7

Note the IP addresses and then open the dify/docker/nginx/conf.d directory. Replace http://api:5001 with http://172.19.0.7:5001 and http://web:3000 with http://172.19.0.5:3000. After making these changes, restart the Nginx container or reload the configuration. Remember, these IP addresses are examples; you must execute the command to get your own IP addresses and configure them accordingly. You may need to reconfigure the IP addresses if you restart the related containers [1].

To continue talking to Dosu, mention @dosu.

@dosubot dosubot bot added 🐞 bug Something isn't working 🤔 cant-reproduce This issue can not be reproduced labels Nov 4, 2024
@TianzeWang
Copy link
Author

I have repeated the same, same issue still persists.

@TianzeWang
Copy link
Author

However I noticed that the worker and api shows multiple ip address. Not sure if this is causing the problem.
image

@crazywoola
Copy link
Member

Please check the container logs, we discovered a strange behavior that you need to wait for several minutes to start the container.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 🤔 cant-reproduce This issue can not be reproduced
Projects
None yet
Development

No branches or pull requests

2 participants