You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unable to delete model due to OpenAI-API-compatible error. #37034
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.142.2
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
Unable to delete model due to OpenAI-API-compatible error. Deletion is successful but the model still appears in the model list. Unable to delete credential. Deletion of credential results in the error: {"code":"invalid_param","message":"Credential record not found.","status":400}
✔️ Expected Behavior
none
❌ Actual Behavior
The OpenAI-API-compatible error message indicates that a model cannot be deleted. The message says the deletion was successful, but the model still appears in the model list. There are no error messages, and the page indicates that the deletion was successful.
After deleting the model credential in the OpenAI-API-compatible configuration and confirming the deletion, the error message "{"code":"invalid_param","message":"Credential record not found.","status":400} appears on the page, but the credential still shows up.
This matches a known issue affecting Dify 1.14.x versions where legacy model_type values in the database (text-generation, embeddings, reranking) are no longer recognized after the upgrade. This causes the credential lookup to fail — so deletions appear to "succeed" in the UI but the records remain, and credential operations return "Credential record not found."[1]
Root cause: The database still has old model_type enum values that were renamed in 1.14.x (via PR #34488), but no migration was run to update existing rows.
Fix: Run these SQL updates on your PostgreSQL database:
UPDATE provider_models SET model_type ='rerank'WHERE model_type ='reranking';
UPDATE provider_models SET model_type ='text-embedding'WHERE model_type ='embeddings';
UPDATE provider_models SET model_type ='llm'WHERE model_type ='text-generation';
UPDATE provider_model_credentials SET model_type ='rerank'WHERE model_type ='reranking';
UPDATE provider_model_credentials SET model_type ='text-embedding'WHERE model_type ='embeddings';
UPDATE provider_model_credentials SET model_type ='llm'WHERE model_type ='text-generation';
UPDATE tenant_default_models SET model_type ='rerank'WHERE model_type ='reranking';
UPDATE tenant_default_models SET model_type ='text-embedding'WHERE model_type ='embeddings';
UPDATE tenant_default_models SET model_type ='llm'WHERE model_type ='text-generation';
UPDATE provider_model_settings SET model_type ='rerank'WHERE model_type ='reranking';
UPDATE provider_model_settings SET model_type ='text-embedding'WHERE model_type ='embeddings';
UPDATE provider_model_settings SET model_type ='llm'WHERE model_type ='text-generation';
UPDATE load_balancing_model_configs SET model_type ='rerank'WHERE model_type ='reranking';
UPDATE load_balancing_model_configs SET model_type ='text-embedding'WHERE model_type ='embeddings';
UPDATE load_balancing_model_configs SET model_type ='llm'WHERE model_type ='text-generation';
After running these, your credential operations (edit/delete) should work correctly again. See #36129 and #34471 for more context.
This matches a known issue affecting Dify 1.14.x versions where legacy values in the database (, , ) are no longer recognized after the upgrade. This causes the credential lookup to fail — so deletions appear to "succeed" in the UI but the records remain, and credential operations return [1]model_type``text-generation``embeddings``reranking``"Credential record not found."
Root cause: The database still has old enum values that were renamed in 1.14.x (via PR #34488), but no migration was run to update existing rows.model_type
Fix: Run these SQL updates on your PostgreSQL database:
UPDATE provider_models SET model_type = 'rerank' WHERE model_type = 'reranking';
UPDATE provider_models SET model_type = 'text-embedding' WHERE model_type = 'embeddings';
UPDATE provider_models SET model_type = 'llm' WHERE model_type = 'text-generation';
UPDATE provider_model_credentials SET model_type = 'rerank' WHERE model_type = 'reranking';
UPDATE provider_model_credentials SET model_type = 'text-embedding' WHERE model_type = 'embeddings';
UPDATE provider_model_credentials SET model_type = 'llm' WHERE model_type = 'text-generation';
UPDATE tenant_default_models SET model_type = 'rerank' WHERE model_type = 'reranking';
UPDATE tenant_default_models SET model_type = 'text-embedding' WHERE model_type = 'embeddings';
UPDATE tenant_default_models SET model_type = 'llm' WHERE model_type = 'text-generation';
UPDATE provider_model_settings SET model_type = 'rerank' WHERE model_type = 'reranking';
UPDATE provider_model_settings SET model_type = 'text-embedding' WHERE model_type = 'embeddings';
UPDATE provider_model_settings SET model_type = 'llm' WHERE model_type = 'text-generation';
UPDATE load_balancing_model_configs SET model_type = 'rerank' WHERE model_type = 'reranking';
UPDATE load_balancing_model_configs SET model_type = 'text-embedding' WHERE model_type = 'embeddings';
UPDATE load_balancing_model_configs SET model_type = 'llm' WHERE model_type = 'text-generation';
After running these, your credential operations (edit/delete) should work correctly again. See #36129 and #34471 for more context.
This matches a known issue affecting Dify 1.14.x versions where legacy model_type values in the database (text-generation, embeddings, reranking) are no longer recognized after the upgrade. This causes the credential lookup to fail — so deletions appear to "succeed" in the UI but the records remain, and credential operations return "Credential record not found."[1]
Root cause: The database still has old model_type enum values that were renamed in 1.14.x (via PR #34488), but no migration was run to update existing rows.
Fix: Run these SQL updates on your PostgreSQL database:
UPDATE provider_models SET model_type = 'rerank' WHERE model_type = 'reranking';
UPDATE provider_models SET model_type = 'text-embedding' WHERE model_type = 'embeddings';
UPDATE provider_models SET model_type = 'llm' WHERE model_type = 'text-generation';
UPDATE provider_model_credentials SET model_type = 'rerank' WHERE model_type = 'reranking';
UPDATE provider_model_credentials SET model_type = 'text-embedding' WHERE model_type = 'embeddings';
UPDATE provider_model_credentials SET model_type = 'llm' WHERE model_type = 'text-generation';
UPDATE tenant_default_models SET model_type = 'rerank' WHERE model_type = 'reranking';
UPDATE tenant_default_models SET model_type = 'text-embedding' WHERE model_type = 'embeddings';
UPDATE tenant_default_models SET model_type = 'llm' WHERE model_type = 'text-generation';
UPDATE provider_model_settings SET model_type = 'rerank' WHERE model_type = 'reranking';
UPDATE provider_model_settings SET model_type = 'text-embedding' WHERE model_type = 'embeddings';
UPDATE provider_model_settings SET model_type = 'llm' WHERE model_type = 'text-generation';
UPDATE load_balancing_model_configs SET model_type = 'rerank' WHERE model_type = 'reranking';
UPDATE load_balancing_model_configs SET model_type = 'text-embedding' WHERE model_type = 'embeddings';
UPDATE load_balancing_model_configs SET model_type = 'llm' WHERE model_type = 'text-generation';
After running these, your credential operations (edit/delete) should work correctly again. See #36129 and #34471 for more context.
Hi, @Ykubernetes. I'm Dosu, and I'm helping the dify team manage their backlog and am marking this issue as stale.
Issue Summary
You reported that in Dify 1.14.2 self-hosted Docker, deleting an OpenAI-compatible model appears to succeed, but the model and its credential still remain visible.
You also noted that deleting the credential returns Credential record not found.
Follow-up comments identified this as a 1.14.x upgrade issue caused by legacy model_type values (text-generation, embeddings, reranking) not being migrated to the new enum names.
A SQL migration workaround was shared to rename the affected values across the relevant tables, which should restore edit/delete behavior.
The issue remains unresolved, and commenters requested a fix in a future release because it affects many users.
Next Steps
Please confirm whether this is still relevant on the latest version of the dify repository.
If it is still happening, you can keep the discussion open by commenting here; otherwise, this issue will be automatically closed in 15 days.
The report describes a model remaining visible after deletion and a credential lookup error, but the stated Dify version 1.142.2 is ambiguous, and it does not provide the setup and steps that lead to the failure. The discussion mentions a possible upgrade-related cause, but the available information does not establish whether that cause applies to this deployment. We need the surrounding context to reproduce and verify the issue rather than rely on the symptom alone.
Next steps
Please retest on a current Dify release and reopen this issue or file a new report using the bug template if the problem persists. Include the exact Dify version (and previous version if upgraded), Docker image tags, OpenAI-compatible provider plugin version, model type and a minimal step-by-step sequence for creating and deleting the model and credential. Please share the expected and actual results, relevant sanitized API logs or traceback, and whether the behavior occurs after a page refresh. Do not include API keys, credentials, or private model data. If an upgrade is involved, describe its sequence so maintainers can assess the possible relationship to #36129.
Activity
dosubot commentedon Jun 4, 2026
This matches a known issue affecting Dify 1.14.x versions where legacy
model_typevalues in the database (text-generation,embeddings,reranking) are no longer recognized after the upgrade. This causes the credential lookup to fail — so deletions appear to "succeed" in the UI but the records remain, and credential operations return"Credential record not found."[1]Root cause: The database still has old
model_typeenum values that were renamed in 1.14.x (via PR #34488), but no migration was run to update existing rows.Fix: Run these SQL updates on your PostgreSQL database:
After running these, your credential operations (edit/delete) should work correctly again. See #36129 and #34471 for more context.
To reply, just mention @dosu.
Docs are dead. Just use Dosu.
ooodwbooo commentedon Jul 7, 2026
it works
Halfknow commentedon Jul 9, 2026
please fix this in the future version, it impacts a lot
dosubot commentedon Aug 9, 2026
Hi, @Ykubernetes. I'm Dosu, and I'm helping the dify team manage their backlog and am marking this issue as stale.
Issue Summary
Credential record not found.model_typevalues (text-generation,embeddings,reranking) not being migrated to the new enum names.Next Steps
Thanks for your understanding and contribution.
crazywoola commentedon Nov 20, 2026
Hi @Ykubernetes, thanks for opening this issue.
Why this is being closed
The report describes a model remaining visible after deletion and a credential lookup error, but the stated Dify version
1.142.2is ambiguous, and it does not provide the setup and steps that lead to the failure. The discussion mentions a possible upgrade-related cause, but the available information does not establish whether that cause applies to this deployment. We need the surrounding context to reproduce and verify the issue rather than rely on the symptom alone.Next steps
Please retest on a current Dify release and reopen this issue or file a new report using the bug template if the problem persists. Include the exact Dify version (and previous version if upgraded), Docker image tags, OpenAI-compatible provider plugin version, model type and a minimal step-by-step sequence for creating and deleting the model and credential. Please share the expected and actual results, relevant sanitized API logs or traceback, and whether the behavior occurs after a page refresh. Do not include API keys, credentials, or private model data. If an upgrade is involved, describe its sequence so maintainers can assess the possible relationship to #36129.