Unable to Enable Previously Disabled or Newly Added Models After v1.8.0 Upgrade; Missing Model Deletion Functionality #20526

Closed
opened 2026-02-21 20:07:50 -05:00 by yindo · 1 comment
Owner

Originally created by @CaoLuchuan on GitHub (Nov 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

Reported as v1.9.1 in UI, but the issue originates from changes introduced in v1.8.0 (specifically the Multi-Model Credentials System feature).

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

1.Upgrade Dify to v1.8.0 or later (including versions labeled as v1.9.1).
2.Navigate to Model Provider settings (e.g., OpenAI, Anthropic, etc.).
3.Attempt to enable a model that was previously disabled before the upgrade.
4.Observe that the enable button is grayed out and cannot be clicked — no action is possible.
5.Alternatively, add a new model of a type already present.
6.Try to enable the newly added model — the enable button remains grayed out and unresponsive.
7.Note that there is no UI option to delete unwanted or duplicate models once added.

✔️ Expected Behavior

1.Users should be able to enable or disable any model freely, regardless of upgrade status.
2.Newly added models of the same provider type should be independently configurable and activatable.
3.A model deletion option (or automatic cleanup of unused models) should be available to manage credentials and model lists effectively.

Actual Behavior

1.Previously disabled models cannot be re-enabled at all — the enable button is grayed out and non-interactive.
2.Newly added models of existing types cannot be activated — their enable buttons are also grayed out and unclickable.
3.There is no way to delete models from the provider configuration, leading to clutter and potential confusion.

Originally created by @CaoLuchuan on GitHub (Nov 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 Reported as v1.9.1 in UI, but the issue originates from changes introduced in v1.8.0 (specifically the Multi-Model Credentials System feature). ### Cloud or Self Hosted Self Hosted (Source) ### Steps to reproduce 1.Upgrade Dify to v1.8.0 or later (including versions labeled as v1.9.1). 2.Navigate to Model Provider settings (e.g., OpenAI, Anthropic, etc.). 3.Attempt to enable a model that was previously disabled before the upgrade. 4.Observe that the enable button is grayed out and cannot be clicked — no action is possible. 5.Alternatively, add a new model of a type already present. 6.Try to enable the newly added model — the enable button remains grayed out and unresponsive. 7.Note that there is no UI option to delete unwanted or duplicate models once added. ### ✔️ Expected Behavior 1.Users should be able to enable or disable any model freely, regardless of upgrade status. 2.Newly added models of the same provider type should be independently configurable and activatable. 3.A model deletion option (or automatic cleanup of unused models) should be available to manage credentials and model lists effectively. ### ❌ Actual Behavior 1.Previously disabled models cannot be re-enabled at all — the enable button is grayed out and non-interactive. 2.Newly added models of existing types cannot be activated — their enable buttons are also grayed out and unclickable. 3.There is no way to delete models from the provider configuration, leading to clutter and potential confusion.
yindo added the 🐞 bug label 2026-02-21 20:07:50 -05:00
yindo closed this issue 2026-02-21 20:07:50 -05:00
Author
Owner

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

This is a known issue after upgrading to Dify v1.8.0+ with the Multi-Model Credentials System: previously disabled or newly added models often can't be enabled (the toggle is grayed out), and the UI lacks a model deletion option. The backend does support enabling/disabling and deleting models, but the UI may not expose these actions if the database migration was incomplete or references are broken.

The root cause is usually incomplete migration of model and credential data to the new tables (provider_credentials, provider_model_credentials). This leaves models referencing credential IDs that no longer exist, which breaks enable/disable toggles and deletion in the UI. This has been confirmed by multiple users and maintainers in similar upgrade scenarios (example, example).

Workaround:

  • Manually inspect your database: for each model in provider_models, ensure its credential_id matches a valid entry in provider_model_credentials. If not, update the reference or create a new credential entry.
  • Make sure the is_valid flag in provider_models and the enabled flag in ProviderModelSetting are set to true for models you want active.
  • If you ran migrations in Alembic offline mode, you must re-run the migration scripts (like migrate_existing_providers_data and migrate_existing_provider_models_data) in a live Python environment with DB access. See this thread for details and scripts.
  • Restart all related Docker containers after fixing the DB to clear any cache issues.

Backend API endpoints for enabling/disabling and deleting models are available, so once the DB is consistent, the UI should work as expected. If the UI still doesn't show delete options, it may require a frontend update or bugfix.

If you need step-by-step SQL or Python commands for your DB type, let me know!

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Nov 24, 2025): <!-- Answer --> This is a known issue after upgrading to Dify v1.8.0+ with the Multi-Model Credentials System: previously disabled or newly added models often can't be enabled (the toggle is grayed out), and the UI lacks a model deletion option. The backend does support enabling/disabling and deleting models, but the UI may not expose these actions if the database migration was incomplete or references are broken. The root cause is usually incomplete migration of model and credential data to the new tables (`provider_credentials`, `provider_model_credentials`). This leaves models referencing credential IDs that no longer exist, which breaks enable/disable toggles and deletion in the UI. This has been confirmed by multiple users and maintainers in similar upgrade scenarios ([example](https://github.com/langgenius/dify-official-plugins/issues/1615), [example](https://github.com/langgenius/dify-official-plugins/issues/1671)). **Workaround:** - Manually inspect your database: for each model in `provider_models`, ensure its `credential_id` matches a valid entry in `provider_model_credentials`. If not, update the reference or create a new credential entry. - Make sure the `is_valid` flag in `provider_models` and the `enabled` flag in `ProviderModelSetting` are set to `true` for models you want active. - If you ran migrations in Alembic offline mode, you must re-run the migration scripts (like `migrate_existing_providers_data` and `migrate_existing_provider_models_data`) in a live Python environment with DB access. See [this thread for details and scripts](https://github.com/langgenius/dify-official-plugins/issues/1629). - Restart all related Docker containers after fixing the DB to clear any cache issues. **Backend API endpoints** for enabling/disabling and deleting models are available, so once the DB is consistent, the UI should work as expected. If the UI still doesn't show delete options, it may require a frontend update or bugfix. If you need step-by-step SQL or Python commands for your DB type, let me know! <!-- 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/5ececa83-206f-468f-9f93-1d947ab53284?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/5ececa83-206f-468f-9f93-1d947ab53284?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/5ececa83-206f-468f-9f93-1d947ab53284?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/5ececa83-206f-468f-9f93-1d947ab53284?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/5ececa83-206f-468f-9f93-1d947ab53284?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/5ececa83-206f-468f-9f93-1d947ab53284?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/5ececa83-206f-468f-9f93-1d947ab53284?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=This%20is%20a%20known%20issue%20after%20upgrading%20to%20Dify%20v1.8.0%2B%20with%20the%20Multi-Model%20Credentials%20System%3A%20previously%20disabled%20or%20newly%20added%20models%20often%20can%27t%20be%20enabled%20%28the%20toggle%20is%20grayed%20out%29%2C%20and%20the%20UI%20lacks%20a%20model%20deletion%20option.%20The%20backend%20does%20support%20enabling/disabling%20and%20deleting%20models%2C%20but%20the%20UI%20may%20not%20expose%20these%20actions%20if%20the%20database%20migration%20was%20incomplete%20or%20references%20are%20broken.%0A%0AThe%20root%20cause%20is%20usually%20incomplete%20migration%20of%20model%20and%20credential%20data%20to%20the%20new%20tables%20%28%60provider_credentials%60%2C%20%60provider_model_credentials%60%29.%20This%20leaves%20models%20referencing%20credential%20IDs%20that%20no%20longer%20exist%2C%20which%20breaks%20enable/disable%20toggles%20and%20deletion%20in%20the%20UI.%20This%20has%20been%20confirmed%20by%20multiple%20users%20and%20maintainers%20in%20similar%20upgrade%20scenarios%20%28%5Bexample%5D%28https%3A//github.com/langgenius/dify-official-plugins/issues/1615%29%2C%20%5Bexample%5D%28https%3A//github.com/langgenius/dify-official-plugins/issues/1671%29%29.%0A%0A%2A%2AWorkaround%3A%2A%2A%20%20%0A-%20Manually%20inspect%20your%20database%3A%20for%20each%20model%20in%20%60provider_models%60%2C%20ensure%20its%20%60credential_id%60%20matches%20a%20valid%20entry%20in%20%60provider_model_credentials%60.%20If%20not%2C%20update%20the%20reference%20or%20create%20a%20new%20credential%20entry.%0A-%20Make%20sure%20the%20%60is_valid%60%20flag%20in%20%60provider_models%60%20and%20the%20%60enabled%60%20flag%20in%20%60ProviderModelSetting%60%20are%20set%20to%20%60true%60%20for%20models%20you%20want%20active.%0A-%20If%20you%20ran%20migrations%20in%20Alembic%20offline%20mode%2C%20you%20must%20re-run%20the%20migration%20scripts%20%28like%20%60migrate_existing_providers_data%60%20and%20%60migrate_existing_provider_models_data%60%29%20in%20a%20live%20Python%20environment%20with%20DB%20access.%20See%20%5Bthis%20thread%20for%20details%20and%20scripts%5D%28https%3A//github.com/langgenius/dify-official-plugins/issues/1629%29.%0A-%20Restart%20all%20related%20Docker%20containers%20after%20fixing%20the%20DB%20to%20clear%20any%20cache%20issues.%0A%0A%2A%2ABackend%20API%20endpoints%2A%2A%20for%20enabling/disabling%20and%20deleting%20models%20are%20available%2C%20so%20once%20the%20DB%20is%20consistent%2C%20the%20UI%20should%20work%20as%20expected.%20If%20the%20UI%20still%20doesn%27t%20show%20delete%20options%2C%20it%20may%20require%20a%20frontend%20update%20or%20bugfix.%0A%0AIf%20you%20need%20step-by-step%20SQL%20or%20Python%20commands%20for%20your%20DB%20type%2C%20let%20me%20know%21)&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/28615)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#20526