Error retrieving the icon image of the large model provider in the workspace. #4324

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

Originally created by @yancyuu on GitHub (Jun 29, 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).
  • 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.6.12

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

difY_error

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @yancyuu on GitHub (Jun 29, 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] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.6.12 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ![difY_error](https://github.com/langgenius/dify/assets/56645657/021268b6-d7df-4420-a262-6d45082c419b) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 18:05:47 -05:00
yindo closed this issue 2026-02-21 18:05:47 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jun 29, 2024):

Hey @yancyuu! I'm here to help with bugs, answer questions, and assist you while waiting for a human maintainer. Let's tackle this together!

The 401 Unauthorized errors when retrieving the icon images for the large model providers in the workspace are likely due to authentication issues. Here are some potential causes and solutions:

  1. User Authentication:

    • Ensure that the user is logged in and their account is properly initialized. The ModelProviderIconApi class requires the user to be authenticated and have their account initialized. The @login_required and @account_initialization_required decorators enforce these requirements [1].
  2. Token in Image URL:

    • The frontend code includes a token in the image URL, which is retrieved from local storage. If this token is missing or invalid, it can result in a 401 Unauthorized error. Ensure that the console_token is correctly stored in local storage and is valid [1].
  3. Token Generation and Storage:

    • The console_token is generated and stored in local storage from the URL search parameters. If the token is not present in the URL or local storage, or if it has expired or been cleared, it can cause authentication issues. Verify that the token is correctly set and has not expired [2][3].
  4. Backend Configuration:

    • Ensure that the backend configurations, such as CONSOLE_API_URL, are correctly set. Incorrect configurations can lead to issues with fetching the icons [1].
  5. Provider Configuration:

    • Verify that the provider configurations are correctly set up and that the provider credentials are valid. Issues with provider configurations or credentials can also lead to 401 errors [1].

By addressing these potential issues, you should be able to resolve the 401 Unauthorized errors and successfully retrieve the icon images for the large model providers.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Jun 29, 2024): <!-- Greeting --> Hey @yancyuu! I'm here to help with bugs, answer questions, and assist you while waiting for a human maintainer. Let's tackle this together! <!-- Answer --> The 401 Unauthorized errors when retrieving the icon images for the large model providers in the workspace are likely due to authentication issues. Here are some potential causes and solutions: 1. **User Authentication**: - Ensure that the user is logged in and their account is properly initialized. The `ModelProviderIconApi` class requires the user to be authenticated and have their account initialized. The `@login_required` and `@account_initialization_required` decorators enforce these requirements <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/controllers/console/workspace/model_providers.py)</sup>. 2. **Token in Image URL**: - The frontend code includes a token in the image URL, which is retrieved from local storage. If this token is missing or invalid, it can result in a 401 Unauthorized error. Ensure that the `console_token` is correctly stored in local storage and is valid <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/controllers/console/workspace/model_providers.py)</sup>. 3. **Token Generation and Storage**: - The `console_token` is generated and stored in local storage from the URL search parameters. If the token is not present in the URL or local storage, or if it has expired or been cleared, it can cause authentication issues. Verify that the token is correctly set and has not expired <sup>[[2]](https://github.com/langgenius/dify/blob/main/web/app/components/swr-initor.tsx)</sup><sup>[[3]](https://github.com/langgenius/dify/blob/main/web/app/signin/userSSOForm.tsx)</sup>. 4. **Backend Configuration**: - Ensure that the backend configurations, such as `CONSOLE_API_URL`, are correctly set. Incorrect configurations can lead to issues with fetching the icons <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/controllers/console/workspace/model_providers.py)</sup>. 5. **Provider Configuration**: - Verify that the provider configurations are correctly set up and that the provider credentials are valid. Issues with provider configurations or credentials can also lead to 401 errors <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/controllers/console/workspace/model_providers.py)</sup>. By addressing these potential issues, you should be able to resolve the 401 Unauthorized errors and successfully retrieve the icon images for the large model providers. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@crazywoola commented on GitHub (Jun 29, 2024):

Duplicated https://github.com/langgenius/dify/issues/5735

@crazywoola commented on GitHub (Jun 29, 2024): Duplicated https://github.com/langgenius/dify/issues/5735
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#4324