After upgrade dify version Add model fail #4839

Closed
opened 2026-02-21 18:08:14 -05:00 by yindo · 2 comments
Owner

Originally created by @Jesean on GitHub (Jul 31, 2024).

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

0.6.15

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

I upgrade the dify backend, and restart it.
Then I found the models I added before was lost.
And when I tried to readd them, got the error like"An error occurred during credentials validation: API request failed with status code 503:"
Also, the flask app log occurred "POST /console/api/workspaces/current/model-providers/ollama/models HTTP/1.1" 400 -"
image

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @Jesean on GitHub (Jul 31, 2024). ### Self Checks - [X] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.6.15 ### Cloud or Self Hosted Self Hosted (Source) ### Steps to reproduce I upgrade the dify backend, and restart it. Then I found the models I added before was lost. And when I tried to readd them, got the error like"An error occurred during credentials validation: API request failed with status code 503:" Also, the flask app log occurred "POST /console/api/workspaces/current/model-providers/ollama/models HTTP/1.1" 400 -" <img width="1040" alt="image" src="https://github.com/user-attachments/assets/3ef89244-96b6-4127-a915-0ace41692b77"> ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug🤔 cant-reproduce labels 2026-02-21 18:08:14 -05:00
yindo closed this issue 2026-02-21 18:08:14 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jul 31, 2024):

To resolve the "An error occurred during credentials validation: API request failed with status code 503" error when trying to re-add models after upgrading to Dify version 0.6.15 in a self-hosted setup, you should check if the service is correctly forwarded by Nginx. Follow these steps:

  1. Ensure the container is running by executing:

    docker ps -q | xargs -n 1 docker inspect --format '{{ .Name }}: {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}'
    
  2. Find the IP addresses for /docker-web-1 and /docker-api-1 in the output.

  3. Open the location where you stored the Dify source code, navigate to dify/docker/nginx/conf.d, and replace the placeholders with the actual IP addresses obtained from the previous step:

    replace http://api:5001 with http://<docker-api-1 IP>:5001
    replace http://web:3000 with http://<docker-web-1 IP>:3000
    
  4. Restart the Nginx container or reload the configuration.

These steps should help resolve the 503 error by ensuring that Nginx forwards the service to the correct location [1].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Jul 31, 2024): <!-- Answer --> To resolve the "An error occurred during credentials validation: API request failed with status code 503" error when trying to re-add models after upgrading to Dify version 0.6.15 in a self-hosted setup, you should check if the service is correctly forwarded by Nginx. Follow these steps: 1. Ensure the container is running by executing: ```bash docker ps -q | xargs -n 1 docker inspect --format '{{ .Name }}: {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ``` 2. Find the IP addresses for `/docker-web-1` and `/docker-api-1` in the output. 3. Open the location where you stored the Dify source code, navigate to `dify/docker/nginx/conf.d`, and replace the placeholders with the actual IP addresses obtained from the previous step: ```bash replace http://api:5001 with http://<docker-api-1 IP>:5001 replace http://web:3000 with http://<docker-web-1 IP>:3000 ``` 4. Restart the Nginx container or reload the configuration. These steps should help resolve the 503 error by ensuring that Nginx forwards the service to the correct location <sup>[[1]](https://github.com/langgenius/dify-docs/blob/main/en/guides/application-orchestrate/llms-use-faq.md)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@crazywoola commented on GitHub (Jul 31, 2024):

If you failed to add the model, you can run flask reset-keypair. And try to add those providers again.

@crazywoola commented on GitHub (Jul 31, 2024): If you failed to add the model, you can run `flask reset-keypair`. And try to add those providers again.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#4839