Skip to content

embeddings' is not a valid ModelType #34683

Closed

Description

@leslie2046

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

main branch(2026.4.7)

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

1.enter datasets page

Image

✔️ Expected Behavior

no error

❌ Actual Behavior

report error:'embeddings' is not a valid ModelType

Activity

  1. dosubot commented on Apr 7, 2026

    @dosubot

    This is a known regression from PR #34300 in version 1.13.3, which changed the model_type column from String(40) to EnumText(ModelType). Your database still has the legacy value "embeddings", but the enum only recognizes "text-embedding" [1].

    To fix it, run these SQL statements against your database to update the legacy values across all affected tables [2]:

    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 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 = '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 = 'text-embedding' WHERE model_type = 'embeddings';
    UPDATE load_balancing_model_configs SET model_type = 'llm' WHERE model_type = 'text-generation';
    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';

    This should resolve the error immediately. See #34365 for the earlier report of the same issue.

    To reply, just mention @dosu.


    Share context across your team and agents. Try Dosu.

    Leave Feedback Learn about dify with Dosu

  2. added
    🐞 bug
    on Apr 7, 2026
  3. hjlarry commented on Apr 8, 2026

    @hjlarry
    Contributor

    maybe we should revert #34300 ?
    the to_origin_model_type() seems can't be removed . @asukaminato0721

  4. leslie2046 commented on Apr 8, 2026

    @leslie2046
    ContributorAuthor

    maybe we should revert #34300 ? the to_origin_model_type() seems can't be removed . @asukaminato0721

    agree

  5. fatelei commented on Apr 8, 2026

    @fatelei
    Contributor

    maybe we should revert #34300 ? the to_origin_model_type() seems can't be removed . @asukaminato0721

    should be revert, enum miss some values

  6. asukaminato0721 commented on Apr 8, 2026

    @asukaminato0721
    Contributor

    agree

  7. asukaminato0721 commented on Apr 8, 2026

    @asukaminato0721
    Contributor

    (or at least a migration script

  8. asukaminato0721 commented on Apr 8, 2026

    @asukaminato0721
    Contributor

    Sorry, this pull request couldn’t be reverted automatically. It may have already been reverted, or the content may have changed since it was merged.

    I guess need some classmethod to fix it

  9. QuantumGhost commented on Apr 8, 2026

    @QuantumGhost
    Member

    Please note that a migration plan is required for SaaS deployments. cc @asukaminato0721

    Database Migration SOP (internal documentation)

    That said, we cannot impose this requirement on external contributors, for two reasons:

    1. The SOP is private and not accessible to external contributors.
    2. External contributors should not be expected to handle processes that are specific to our SaaS environment.

    Regarding the fix and migration strategy, I suggest using _missing_ to map legacy values to the corresponding enum members on read paths. On write paths, continuing to use enum members will allow the stored database values to be updated gradually and safely.

    More broadly, before making similar refactors, we should first verify what values are already stored in the database.

  10. QuantumGhost commented on Apr 8, 2026

    @QuantumGhost
    Member

    The description states that this issue was found in v1.13.3. However, I’ve verified that PR #34300 is not included in the v1.13.3 release.

    If this fix is intended for that version, we should cherry-pick it into the lts/1.13.x branch.

  11. IthacaDream commented on Apr 8, 2026

    @IthacaDream
    Contributor

    @fatelei @QuantumGhost @asukaminato0721
    Hi everyone, I may have a simpler approach to fix this. Would you consider it? #34717

  12. leslie2046 commented on Apr 8, 2026

    @leslie2046
    ContributorAuthor

    The description states that this issue was found in v1.13.3. However, I’ve verified that PR #34300 is not included in the v1.13.3 release.

    If this fix is intended for that version, we should cherry-pick it into the lts/1.13.x branch.

    I just found it in the main branch source code recently,not 1.13.3 release version.

  13. leslie2046 commented on Apr 8, 2026

    @leslie2046
    ContributorAuthor

    And the same issue:
    #34365

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

    🐞 bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions