Gemini model provider does not allow key removal #8721

Closed
opened 2026-02-21 18:27:12 -05:00 by yindo · 1 comment
Owner

Originally created by @DavideDelbianco on GitHub (Feb 27, 2025).

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

1.0.0

Cloud or Self Hosted

Cloud

Steps to reproduce

Remove the key from the model provider

✔️ Expected Behavior

The key should be removed

Actual Behavior

A confirmation message appears, but the key is not removed

Originally created by @DavideDelbianco on GitHub (Feb 27, 2025). ### 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 1.0.0 ### Cloud or Self Hosted Cloud ### Steps to reproduce Remove the key from the model provider ### ✔️ Expected Behavior The key should be removed ### ❌ Actual Behavior A confirmation message appears, but the key is not removed
yindo added the 🐞 bugcloud labels 2026-02-21 18:27:12 -05:00
yindo closed this issue 2026-02-21 18:27:12 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Feb 27, 2025):

The issue you're experiencing with the Gemini model provider not allowing key removal might be related to the implementation of the delete method in the ModelProviderModelCredentialApi class. This method is responsible for removing model credentials, but there could be a specific issue with how it interacts with the Gemini provider.

Additionally, there is a known issue in Dify v0.13.2 where certain model providers, like OpenAI, cannot be removed, although this was noted for a different version and provider. It might be worth checking if similar conditions apply to the Gemini provider in your version [1].

To address this, you might want to verify the implementation of the remove_model_credentials method in the ModelProviderService and ensure that it correctly handles the Gemini provider. Also, check if there are any specific conditions or error messages logged during the removal attempt that could provide more insight into the failure.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Feb 27, 2025): <!-- Answer --> The issue you're experiencing with the Gemini model provider not allowing key removal might be related to the implementation of the `delete` method in the `ModelProviderModelCredentialApi` class. This method is responsible for removing model credentials, but there could be a specific issue with how it interacts with the Gemini provider. Additionally, there is a known issue in Dify v0.13.2 where certain model providers, like OpenAI, cannot be removed, although this was noted for a different version and provider. It might be worth checking if similar conditions apply to the Gemini provider in your version <sup>[[1]](https://github.com/langgenius/dify/issues/11685)</sup>. To address this, you might want to verify the implementation of the `remove_model_credentials` method in the `ModelProviderService` and ensure that it correctly handles the Gemini provider. Also, check if there are any specific conditions or error messages logged during the removal attempt that could provide more insight into the failure. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/84462d30-88e1-40a9-85a8-4db5a9c13d74?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/84462d30-88e1-40a9-85a8-4db5a9c13d74?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/84462d30-88e1-40a9-85a8-4db5a9c13d74?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/84462d30-88e1-40a9-85a8-4db5a9c13d74?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/84462d30-88e1-40a9-85a8-4db5a9c13d74?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/84462d30-88e1-40a9-85a8-4db5a9c13d74?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/84462d30-88e1-40a9-85a8-4db5a9c13d74?feedback_type=other)</sup>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#8721