why qwen always error with ANY model #749

Closed
opened 2026-02-16 10:20:22 -05:00 by yindo · 4 comments
Owner

Originally created by @dwlinn on GitHub (Oct 24, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • 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, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.9.2

Cloud or Self Hosted

Cloud

Steps to reproduce

Image Image

The model plugin of Tongyi Qianwen has a high probability of encountering various errors when selecting any model, resulting in failure to call. Downgrading to an older version of the plugin also causes errors, and adding a new API key may also lead to errors. What exactly is the reason?

✔️ Expected Behavior

qianwen model running normally.

Actual Behavior

No response

Originally created by @dwlinn on GitHub (Oct 24, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [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, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.9.2 ### Cloud or Self Hosted Cloud ### Steps to reproduce <img width="750" height="292" alt="Image" src="https://github.com/user-attachments/assets/3221cece-7047-47e1-aecf-5b69c721ca0f" /> <img width="782" height="166" alt="Image" src="https://github.com/user-attachments/assets/4bb1cf50-1237-4d02-b611-607e21a5fff7" /> The model plugin of Tongyi Qianwen has a high probability of encountering various errors when selecting any model, resulting in failure to call. Downgrading to an older version of the plugin also causes errors, and adding a new API key may also lead to errors. What exactly is the reason? ### ✔️ Expected Behavior qianwen model running normally. ### ❌ Actual Behavior _No response_
yindo added the bug label 2026-02-16 10:20:22 -05:00
yindo closed this issue 2026-02-16 10:20:22 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Oct 24, 2025):

Hi @dwlinn! I'm Dosu and I’m helping the dify team.

The "Incorrect model credentials provided" error with the Qwen (Tongyi Qianwen) plugin in Dify is usually caused by how the plugin handles API keys and credentials. The plugin expects the API key to be present and correctly formatted (typically starting with sk-), and it uses this key for all Qwen models. If the key is missing, malformed, or the endpoint is misconfigured, you'll get this error for any model you select.

A recurring bug is that some plugin versions try to access the API key using dot notation (credentials.dashscope_api_key) instead of dictionary key access (credentials['dashscope_api_key']). This can break authentication, especially when memory is enabled or in certain agent node scenarios. Downgrading the plugin sometimes helps, but not always—especially if the bug is present in both old and new versions. The robust fix is to patch the plugin code so all credential access uses dictionary keys, or to ensure credentials are always normalized before use. See more details and user reports here.

Other common causes: network issues (especially in cloud environments), plugin installation failures, or missing required fields in the plugin manifest/schema. Make sure your API key matches the expected provider config, the endpoint (domestic/international) is correct, and the plugin version is compatible with your Dify version (for Qwen3, you need plugin v0.0.19+). If you update the plugin or config and still see the error, check backend logs for more details and confirm that Dify can reach the Tongyi API endpoints.

If you need a workaround, try disabling memory, switching agent strategies, or using a different plugin version (some users report v0.0.18 works). For persistent issues, patching the plugin credential logic is the most reliable solution. More troubleshooting tips and config advice are available here and here.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

@dosubot[bot] commented on GitHub (Oct 24, 2025): <!-- Greeting --> Hi @dwlinn! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> The "Incorrect model credentials provided" error with the Qwen (Tongyi Qianwen) plugin in Dify is usually caused by how the plugin handles API keys and credentials. The plugin expects the API key to be present and correctly formatted (typically starting with `sk-`), and it uses this key for all Qwen models. If the key is missing, malformed, or the endpoint is misconfigured, you'll get this error for any model you select. A recurring bug is that some plugin versions try to access the API key using dot notation (`credentials.dashscope_api_key`) instead of dictionary key access (`credentials['dashscope_api_key']`). This can break authentication, especially when memory is enabled or in certain agent node scenarios. Downgrading the plugin sometimes helps, but not always—especially if the bug is present in both old and new versions. The robust fix is to patch the plugin code so all credential access uses dictionary keys, or to ensure credentials are always normalized before use. See more details and user reports [here](https://github.com/langgenius/dify-official-plugins/issues/1762). Other common causes: network issues (especially in cloud environments), plugin installation failures, or missing required fields in the plugin manifest/schema. Make sure your API key matches the expected provider config, the endpoint (domestic/international) is correct, and the plugin version is compatible with your Dify version (for Qwen3, you need plugin v0.0.19+). If you update the plugin or config and still see the error, check backend logs for more details and confirm that Dify can reach the Tongyi API endpoints. If you need a workaround, try disabling memory, switching agent strategies, or using a different plugin version (some users report v0.0.18 works). For persistent issues, patching the plugin credential logic is the most reliable solution. More troubleshooting tips and config advice are available [here](https://github.com/langgenius/dify-official-plugins/issues/1258) and [here](https://github.com/langgenius/dify-official-plugins/issues/925). <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/66d50c62-6a7d-4a42-9a78-8e94dede35d5?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/66d50c62-6a7d-4a42-9a78-8e94dede35d5?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/66d50c62-6a7d-4a42-9a78-8e94dede35d5?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/66d50c62-6a7d-4a42-9a78-8e94dede35d5?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/66d50c62-6a7d-4a42-9a78-8e94dede35d5?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/66d50c62-6a7d-4a42-9a78-8e94dede35d5?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/66d50c62-6a7d-4a42-9a78-8e94dede35d5?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/27409)
Author
Owner

@dosubot[bot] commented on GitHub (Oct 24, 2025):

The errors you're seeing with the Tongyi Qianwen (Qwen) model plugin—such as "Incorrect model credentials provided" and "Invalid API-key provided"—are likely due to authentication or API key handling issues in the plugin. Recent updates in Dify addressed problems with model list refresh and authentication state when changing credentials, which could impact how plugins like Qwen validate and use API keys. If you're on version 1.9.2 cloud, these fixes may not be present yet, or there could be a compatibility issue between the plugin and the platform's credential management logic. See the relevant merged pull requests for details: model list refresh on credential change and plugin authentication/data source refresh.

If updating credentials or downgrading the plugin doesn't resolve the issue, it's likely a systemic bug or incompatibility. Double-check that your API key is valid and has the correct permissions, and consider whether a platform update or patch is needed to pick up these recent fixes.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (Oct 24, 2025): <!-- Answer --> The errors you're seeing with the Tongyi Qianwen (Qwen) model plugin—such as "Incorrect model credentials provided" and "Invalid API-key provided"—are likely due to authentication or API key handling issues in the plugin. Recent updates in Dify addressed problems with model list refresh and authentication state when changing credentials, which could impact how plugins like Qwen validate and use API keys. If you're on version 1.9.2 cloud, these fixes may not be present yet, or there could be a compatibility issue between the plugin and the platform's credential management logic. See the relevant merged pull requests for details: [model list refresh on credential change](https://github.com/langgenius/dify/pull/26421) and [plugin authentication/data source refresh](https://github.com/langgenius/dify/pull/26813). If updating credentials or downgrading the plugin doesn't resolve the issue, it's likely a systemic bug or incompatibility. Double-check that your API key is valid and has the correct permissions, and consider whether a platform update or patch is needed to pick up these recent fixes. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/15674628-b504-4bae-9a8b-39daa977ce0c?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/15674628-b504-4bae-9a8b-39daa977ce0c?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/15674628-b504-4bae-9a8b-39daa977ce0c?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/15674628-b504-4bae-9a8b-39daa977ce0c?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/15674628-b504-4bae-9a8b-39daa977ce0c?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/15674628-b504-4bae-9a8b-39daa977ce0c?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/15674628-b504-4bae-9a8b-39daa977ce0c?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify-official-plugins/issues/1922)
Author
Owner

@crazywoola commented on GitHub (Oct 29, 2025):

@dosu List all tongyi related issues with the link

@crazywoola commented on GitHub (Oct 29, 2025): @dosu List all tongyi related issues with the link
Author
Owner
@dosubot[bot] commented on GitHub (Oct 29, 2025): <!-- Answer --> Here are all Tongyi (Qianwen/Qwen) related issues in the dify-official-plugins repository: - [Issue #1243: The model cannot be added (Tongyi Qianwen plugin, request timeouts, network config)](https://github.com/langgenius/dify-official-plugins/issues/1243) - [Issue #405: INTERNAL SERVER ERROR when setting Tongyi Qianwen API key (privatized/self-hosted)](https://github.com/langgenius/dify-official-plugins/issues/405) - [Issue #1883: Error adding Qwen3-Reranker-8B model (OpenAI-API compatibility)](https://github.com/langgenius/dify-official-plugins/issues/1883) - [Issue #1290: Qwen-Long model PluginInvokeError ('dict' object has no attribute 'dashscope_api_key')](https://github.com/langgenius/dify-official-plugins/issues/1290) - [Issue #925: Model qwen-max not exist, All models not exist (Tongyi plugin version compatibility)](https://github.com/langgenius/dify-official-plugins/issues/925) - [Issue #825: Invalid parameters and output issues with tongyi/qwen3 models](https://github.com/langgenius/dify-official-plugins/issues/825) - [Issue #774: PluginInvokeError with Tongyi LLM plugin ('ImagePromptMessageContent' object error)](https://github.com/langgenius/dify-official-plugins/issues/774) - [Issue #1571: Feature request – add DeepSeek v3.1 to Tongyi provider](https://github.com/langgenius/dify-official-plugins/issues/1571) - [Issue #1198: Feature request – support custom API endpoint addresses for Tongyi Qianwen](https://github.com/langgenius/dify-official-plugins/issues/1198) - [Issue #668: Error adding qwen2.5-vl-32b-instruct model under Alibaba Tongyi plugin ('url error, please check url!')](https://github.com/langgenius/dify-official-plugins/issues/668) For related discussions: - ["url error, please check url!" Qwen series of models](https://github.com/langgenius/dify/discussions/13453) - [Failed to add `qwen-omni-turbo-2025-01-19` model](https://github.com/langgenius/dify/discussions/14031) <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/b3731d09-4c87-41ca-a62c-f0f97748c63d?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/b3731d09-4c87-41ca-a62c-f0f97748c63d?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/b3731d09-4c87-41ca-a62c-f0f97748c63d?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/b3731d09-4c87-41ca-a62c-f0f97748c63d?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/b3731d09-4c87-41ca-a62c-f0f97748c63d?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/b3731d09-4c87-41ca-a62c-f0f97748c63d?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/b3731d09-4c87-41ca-a62c-f0f97748c63d?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify-official-plugins/issues/1922)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#749