Bug Icon Provider #4283

Closed
opened 2026-02-21 18:05:32 -05:00 by yindo · 9 comments
Owner

Originally created by @tienld-0801 on GitHub (Jun 26, 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.11

Cloud or Self Hosted

Cloud, Self Hosted (Docker), Self Hosted (Source)

Steps to reproduce

In the most recent commit update since the time I created the new issue, this icon is not working as expected, please reconsider.
Screenshot 2024-06-27 at 01 56 28

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @tienld-0801 on GitHub (Jun 26, 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.11 ### Cloud or Self Hosted Cloud, Self Hosted (Docker), Self Hosted (Source) ### Steps to reproduce In the most recent commit update since the time I created the new issue, this icon is not working as expected, please reconsider. <img width="1030" alt="Screenshot 2024-06-27 at 01 56 28" src="https://github.com/langgenius/dify/assets/112608271/c0088ec0-610a-42db-af3f-706620af6b4b"> ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 18:05:32 -05:00
yindo closed this issue 2026-02-21 18:05:33 -05:00
Author
Owner

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

To address the issue with the "Model Provider" icon not working as expected in Dify version 0.6.11, here are some steps and information that might help:

  1. Rendering Logic: The "Model Provider" icon is rendered using the ModelIcon component. This component checks if the provider is 'openai' and if the model name starts with 'gpt-4'. If both conditions are met, it renders the OpenaiViolet icon. Otherwise, it uses the provider.icon_small property to render an <img> element with the icon's URL. If neither condition is met, it falls back to a default CubeOutline icon [1].

  2. CSS and Styling Changes: Recent changes to the CSS and styling of the "Model Provider" icon include specific classes for different states and conditions. For example, the ModelIcon component has classes like mr-1.5 !w-5 !h-5, and the SlidersH icon has conditional classes based on the isInWorkflow prop [2].

  3. Common Errors and Logs: Common error messages or logs related to the "Model Provider" icon can be found in the server logs where the Flask application is running. Issues might arise from user permissions or icon retrieval failures in the ModelProviderIconApi class [3].

  4. Functionality and Behavior: The "Model Provider" icon should display the provider's small and large icons, show the provider's label and description, provide access to help information, allow users to manage configuration methods, and indicate supported model types and status [4].

If these steps do not resolve the issue, providing more detailed error messages from the frontend console and any backend error logs, along with your Docker setup details, could help further diagnose the problem.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Jun 26, 2024): <!-- Answer --> To address the issue with the "Model Provider" icon not working as expected in Dify version 0.6.11, here are some steps and information that might help: 1. **Rendering Logic**: The "Model Provider" icon is rendered using the `ModelIcon` component. This component checks if the provider is 'openai' and if the model name starts with 'gpt-4'. If both conditions are met, it renders the `OpenaiViolet` icon. Otherwise, it uses the `provider.icon_small` property to render an `<img>` element with the icon's URL. If neither condition is met, it falls back to a default `CubeOutline` icon <sup>[[1]](https://github.com/langgenius/dify/blob/main/web/app/components/header/account-setting/model-provider-page/model-icon/index.tsx)</sup>. 2. **CSS and Styling Changes**: Recent changes to the CSS and styling of the "Model Provider" icon include specific classes for different states and conditions. For example, the `ModelIcon` component has classes like `mr-1.5 !w-5 !h-5`, and the `SlidersH` icon has conditional classes based on the `isInWorkflow` prop <sup>[[2]](https://github.com/langgenius/dify/blob/main/web/app/components/header/account-setting/model-provider-page/model-parameter-modal/trigger.tsx)</sup>. 3. **Common Errors and Logs**: Common error messages or logs related to the "Model Provider" icon can be found in the server logs where the Flask application is running. Issues might arise from user permissions or icon retrieval failures in the `ModelProviderIconApi` class <sup>[[3]](https://github.com/langgenius/dify/blob/main/api/controllers/console/workspace/model_providers.py)</sup>. 4. **Functionality and Behavior**: The "Model Provider" icon should display the provider's small and large icons, show the provider's label and description, provide access to help information, allow users to manage configuration methods, and indicate supported model types and status <sup>[[4]](https://github.com/langgenius/dify/blob/main/web/app/components/header/account-setting/model-provider-page/declarations.ts)</sup>. If these steps do not resolve the issue, providing more detailed error messages from the frontend console and any backend error logs, along with your Docker setup details, could help further diagnose the problem. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

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

Can't reproduce on Cloud, I think this happens when you are trying to run from source code right? Try to clean the browser cache and restart the api service again to see if this persists.

@crazywoola commented on GitHub (Jun 26, 2024): Can't reproduce on Cloud, I think this happens when you are trying to run from source code right? Try to clean the browser cache and restart the api service again to see if this persists.
Author
Owner

@tienld-0801 commented on GitHub (Jun 26, 2024):

@crazywoola I tried everything but it still doesn't work I think the problem comes from this pull request

@tienld-0801 commented on GitHub (Jun 26, 2024): @crazywoola I tried everything but it still doesn't work I think the problem comes from this pull request
Author
Owner

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

Which one. I have encountered this before long time ago, we just released model runtime that time. But it can't be reproduced now.

@crazywoola commented on GitHub (Jun 27, 2024): Which one. I have encountered this before long time ago, we just released model runtime that time. But it can't be reproduced now.
Author
Owner

@tienld-0801 commented on GitHub (Jun 27, 2024):

@crazywoola So is there any way to solve it? I cleared caching like you said but it doesn't work
Maybe , Maybe the could urls are not working yet.
Ex : https://cloud.dify.ai/console/api/workspaces/current/model-providers/openai/icon_large/en_US?_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiZjhiZjMwZDYtZjcwMy00NzRkLTk2NjgtNDAwNGQ4OGQyMTIwIiwiZXhwIjoxNzIyMDU0MTI2LCJpc3MiOiJTRUxGX0hPU1RFRCIsInN1YiI6IkNvbnNvbGUgQVBJIFBhc3Nwb3J0In0.ZjSzZEGDihb4VimBTmY-OzexgItXcrv9t7xbQen1mIQ

Error : {"code": "unauthorized", "message": "Invalid token signature.", "status": 401}

@tienld-0801 commented on GitHub (Jun 27, 2024): @crazywoola So is there any way to solve it? I cleared caching like you said but it doesn't work Maybe , Maybe the could urls are not working yet. Ex : https://cloud.dify.ai/console/api/workspaces/current/model-providers/openai/icon_large/en_US?_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiZjhiZjMwZDYtZjcwMy00NzRkLTk2NjgtNDAwNGQ4OGQyMTIwIiwiZXhwIjoxNzIyMDU0MTI2LCJpc3MiOiJTRUxGX0hPU1RFRCIsInN1YiI6IkNvbnNvbGUgQVBJIFBhc3Nwb3J0In0.ZjSzZEGDihb4VimBTmY-OzexgItXcrv9t7xbQen1mIQ Error : {"code": "unauthorized", "message": "Invalid token signature.", "status": 401}
Author
Owner

@monotykamary commented on GitHub (Jun 28, 2024):

This also happens when self-hosting. It's an issue that occurs when the default values point to their cloud service, which requires a proper token. This doesn't happen with earlier versions, so https://github.com/langgenius/dify/commit/488e3c3d565434bb6988d3d2120f0dfa9cb7fa4b#diff-89fafc265c1fa601cf2364b20be83308031335fda9467fcf3249d5ec1c0c8172 or https://github.com/langgenius/dify/commit/17d2f0bb0d3c7618ed59968613175d2344fcbdc1 or https://github.com/langgenius/dify/pull/5412 might be related.

@monotykamary commented on GitHub (Jun 28, 2024): This also happens when self-hosting. It's an issue that occurs when the default values point to their cloud service, which requires a proper token. This doesn't happen with earlier versions, so https://github.com/langgenius/dify/commit/488e3c3d565434bb6988d3d2120f0dfa9cb7fa4b#diff-89fafc265c1fa601cf2364b20be83308031335fda9467fcf3249d5ec1c0c8172 or https://github.com/langgenius/dify/commit/17d2f0bb0d3c7618ed59968613175d2344fcbdc1 or https://github.com/langgenius/dify/pull/5412 might be related.
Author
Owner

@monotykamary commented on GitHub (Jun 28, 2024):

It seems its more related how default values are generated for the environment variables. A quick workaround would be to explicitly set the domains yourself:

DOMAIN=https://example.com
CONSOLE_API_URL="$DOMAIN"
CONSOLE_WEB_URL="$DOMAIN"
SERVICE_API_URL="$DOMAIN"
APP_API_URL="$DOMAIN"
APP_WEB_URL="$DOMAIN"
@monotykamary commented on GitHub (Jun 28, 2024): It seems its more related how default values are generated for the environment variables. A quick workaround would be to explicitly set the domains yourself: ``` DOMAIN=https://example.com CONSOLE_API_URL="$DOMAIN" CONSOLE_WEB_URL="$DOMAIN" SERVICE_API_URL="$DOMAIN" APP_API_URL="$DOMAIN" APP_WEB_URL="$DOMAIN" ```
Author
Owner

@ugyuji commented on GitHub (Jun 28, 2024):

@monotykamary Thank you!
The same thing just happened with version 0.6.12 running on my local machine, and setting the domains explicitly just fixed the problem!

@ugyuji commented on GitHub (Jun 28, 2024): @monotykamary Thank you! The same thing just happened with version 0.6.12 running on my local machine, and setting the domains explicitly just fixed the problem!
Author
Owner

@tienldbnk commented on GitHub (Jun 28, 2024):

@monotykamary @monotykamary good idea , I think it works very well so I will close this issue

@tienldbnk commented on GitHub (Jun 28, 2024): @monotykamary @monotykamary good idea , I think it works very well so I will close this issue
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#4283