Skip to content

Unable to delete model due to OpenAI-API-compatible error. #37034

Closed as not planned

Description

@Ykubernetes

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.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.

Activity

  1. dosubot commented on Jun 4, 2026

    @dosubot

    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.

    To reply, just mention @dosu.


    Docs are dead. Just use Dosu.

    Leave Feedback Ask Dosu about dify

  2. added
    1.14.0
    on Jun 16, 2026
  3. ooodwbooo commented on Jul 7, 2026

    @ooodwbooo

    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.

    To reply, just mention @dosu.

    Docs are dead. Just use Dosu.

    Leave Feedback Ask Dosu about dify

    it works

  4. Halfknow commented on Jul 9, 2026

    @Halfknow

    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.

    To reply, just mention @dosu.

    Docs are dead. Just use Dosu.

    Leave Feedback Ask Dosu about dify

    please fix this in the future version, it impacts a lot

  5. dosubot commented on Aug 9, 2026

    @dosubot

    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.

    Thanks for your understanding and contribution.

  6. added
    🐞 bug
    no-issue-activity
    and removed on Sep 4, 2026
  7. removed
    no-issue-activity
    on Sep 10, 2026
  8. crazywoola commented on Nov 20, 2026

    @crazywoola
    Member

    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.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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    1.14.0project#dify🐞 bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions