dify icon indicating copy to clipboard operation
dify copied to clipboard

Version 1.0.1: The model settings for enabling and disabling have no effect.

Open songlin1994 opened this issue 9 months ago • 6 comments

Self Checks

  • [x] This is only for bug report, if you would like to ask a question, please head to Discussions.
  • [x] I have searched for existing issues search for existing issues, including closed ones.
  • [x] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • [x] Please do not modify this template :) and fill in all the required fields.

Dify version

1.0.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Enter the model settings and randomly enable a few models.

Image

Then refresh the page and re-enter the model settings. The previous changes did not take effect.

Image

✔️ Expected Behavior

You can enable or disable models and save the changes.

❌ Actual Behavior

Enabling or disabling models has no effect.

songlin1994 avatar Mar 17 '25 05:03 songlin1994

The issue you're experiencing with model settings not taking effect in Dify version 1.0.1 when using the self-hosted Docker setup might be due to incorrect configuration settings. Ensure that the POSITION_PROVIDER_INCLUDES and POSITION_PROVIDER_EXCLUDES settings in your environment file are properly configured to specify which model providers should be included or excluded. Additionally, check that the POSITION_TOOL_INCLUDES and POSITION_TOOL_EXCLUDES settings are correctly defined to manage the tools available in your application. If these settings are not configured, the default behavior might not reflect your intended setup [1][2].

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] avatar Mar 17 '25 05:03 dosubot[bot]

Image The related configuration for the bot's responses has not been changed and remains at its default settings. Could this be related?

songlin1994 avatar Mar 17 '25 06:03 songlin1994

Plug-in version

Image

open AI plug is ok enable or disable models and save the changes. Image

songlin1994 avatar Mar 17 '25 07:03 songlin1994

The toggle for models that existed before the upgrade does not work.

For example, in version 009, the newly added r1 model can be enabled or disabled successfully. However, for models that existed before version 009, such as nova, the toggle does not take effect.

升级之前本身就存在的模型,开关无效。 比如 bedrock 模型 009版本新增了 r1模型,那么r1 模型开关可以生效。 009版本之前就存在的nova 模型,开关就不生效

songlin1994 avatar Mar 17 '25 07:03 songlin1994

重现方式: 先部署1.0.0 dify 版本,然后安装 tongyi 005版本插件,启用任意几个模型,关闭任意几个模型。

然后删除tongyi 插件,升级dify 1.0.1 版本

安装 tongyi 最新版本插件, 打开或关闭之前模型的插件 就不生效了。

Steps to Reproduce: Deploy Dify version 1.0.0. Install the Tongyi 005 version plugin. Enable and disable some models. Uninstall the Tongyi plugin. Upgrade Dify to version 1.0.1. Install the latest version of the Tongyi plugin. Try enabling or disabling the previously existing models—the changes do not take effect.

songlin1994 avatar Mar 17 '25 07:03 songlin1994

I had this bug, it happens when in 0.15.3 you modified the default state of models, saving them in the provider_model_settings Then updated just the docker image like any other previous update and thought: "oh I am missing plugins, whatever, I used just a few and will re-install them manually"

The issue lies with the model name saved in the DB in 0.15.3 it was, example: provider_name: openai/openai

in 1.0.0+ provider_name: langgenius/open/openai

even if you remove the model plugin, the database table that stores your model settings, is not wiped thus re-installing the plugin will do nothing.

You could fix this issue by manually

  • empty the table: provider_mode_settings
  • remove the key from the plugin
  • add the key to the plugin

This is only a partial fix, because there are many more places that need the provider_name updated, for example document embeddings and dataset settings. I strongly suggest you follow the guide https://docs.dify.ai/development/migration/migrate-to-v1

If you are using docker desktop, simply enter in interactive mode into the "api" service and execute the commands described in the guide. If you are using k8s, ssh into the kubelet that runs the "api" service and execute the commands

DavideDelbianco avatar Mar 17 '25 09:03 DavideDelbianco

Self-hosted Container Repair Method:

1、Enter the database container: docker exec -it docker-db-1 /bin/bash

2、Access the psql interactive command line: psql -h localhost -U postgres -d dify

3、Clear the table data: TRUNCATE TABLE provider_model_settings;

4、Delete the plugin key on the page and re-enter the key.

中文版:

自托管 容器 修复方式:

1、 进入db容器: docker exec -it docker-db-1 /bin/bash

2、进入 psql 命令行交互 psql -h localhost -U postgres -d dify

3、清空表数据 TRUNCATE TABLE provider_model_settings

4、在 页面上 删除插件密钥,重新填写密钥。

songlin1994 avatar Mar 18 '25 06:03 songlin1994