can't call all LLMs: error code 401 #6346

Closed
opened 2026-02-21 18:15:19 -05:00 by yindo · 3 comments
Owner

Originally created by @Megadeth9919 on GitHub (Oct 25, 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.9.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Yesterday I was able to use dify normally, but overnight all the LLMs couldn't be called

image
image

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @Megadeth9919 on GitHub (Oct 25, 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.9.2 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ## Yesterday I was able to use dify normally, but overnight all the LLMs couldn't be called ![image](https://github.com/user-attachments/assets/75aaf5f7-aa21-41d4-8f9a-ceeae33cb8b2) ![image](https://github.com/user-attachments/assets/8e56ffe8-eae6-442d-86b0-dd6a97c02a32) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo closed this issue 2026-02-21 18:15:19 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Oct 25, 2024):

I found a similar unsolved discussion regarding a 401 error in Dify: Access unauthorized 401 [1].

For the 401 error you're encountering, it typically indicates an issue with the API key. Dify handles API key validation by using the API-Key in the Authorization HTTP Header, with the expected format being Bearer {API_KEY}. If the API key is invalid or the format is incorrect, a 403 error is usually returned, but a 401 can also occur if the key is missing or incorrect [2].

Here are some steps you can take to troubleshoot this issue:

  1. Check the API Key: Ensure that the API key is correct and has not expired. Verify that it is being used in the correct format in the Authorization header.

  2. Configuration Files: Review any configuration files related to API key management to ensure they are set up correctly.

  3. Logs: Check the logs for any additional error messages that might provide more context. You can use the docker logs [container_id or container_name] command to view logs for the Dify service.

These steps should help you identify and resolve the issue with the 401 error.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Oct 25, 2024): <!-- Answer --> I found a similar unsolved discussion regarding a 401 error in Dify: [Access unauthorized 401](https://github.com/langgenius/dify/discussions/9237) <sup>[[1]](https://github.com/langgenius/dify/discussions/9237)</sup>. For the 401 error you're encountering, it typically indicates an issue with the API key. Dify handles API key validation by using the API-Key in the Authorization HTTP Header, with the expected format being `Bearer {API_KEY}`. If the API key is invalid or the format is incorrect, a 403 error is usually returned, but a 401 can also occur if the key is missing or incorrect <sup>[[2]](https://github.com/langgenius/dify-docs/blob/main/en/.gitbook/assets/Dify-test.openapi.json)</sup>. Here are some steps you can take to troubleshoot this issue: 1. **Check the API Key**: Ensure that the API key is correct and has not expired. Verify that it is being used in the correct format in the Authorization header. 2. **Configuration Files**: Review any configuration files related to API key management to ensure they are set up correctly. 3. **Logs**: Check the logs for any additional error messages that might provide more context. You can use the `docker logs [container_id or container_name]` command to view logs for the Dify service. These steps should help you identify and resolve the issue with the 401 error. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@crazywoola commented on GitHub (Oct 25, 2024):

This is obviously not the error message we returned

@crazywoola commented on GitHub (Oct 25, 2024): This is obviously not the error message we returned
Author
Owner

@shisaru292 commented on GitHub (Oct 30, 2024):

@crazywoola #10047 Please have a look. I think these are the same issue.

@shisaru292 commented on GitHub (Oct 30, 2024): @crazywoola #10047 Please have a look. I think these are the same issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#6346