langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
50.05k stars 7.15k forks source link

Inconsistent description and implementation about "CHECK_UPDATE_URL" #5835

Closed kurokobo closed 3 months ago

kurokobo commented 4 months ago

Self Checks

Dify version

0.6.12-fix1, main

Cloud or Self Hosted

Self Hosted (Docker), Self Hosted (Source)

Steps to reproduce

  1. Deploy Dify with CHECK_UPDATE_URL=true or CHECK_UPDATE_URL=false
  2. Logout from Dify, then login again
  3. Check the logs from the API container

✔️ Expected Behavior

If CHECK_UPDATE_URL=true, update is checked. If CHECK_UPDATE_URL=false, update is not checked.

❌ Actual Behavior

In both cases, the following errors occur:

Additional Information

In version.py, CHECK_UPDATE_URL is used as the actual URL to be checked for updates, instead of a flag to indicate whether an update should be checked or not. The code in version.py expects that CHECK_UPDATE_URL has "https://updates.dify.ai" or "" (empty string).

However, the .env.example describes that this variable should be set to either true or false.

# Whether to enable the version check policy.
# If set to false, https://updates.dify.ai will not be called for version check.
CHECK_UPDATE_URL=true

So the Dify tries to send an HTTP request to true or false and this causes above errors.

Suggested changes

Update the description in the .env.example to specify either https://updates.dify.ai or "" (an empty string). or update version.py to send a request to the default URL only when the value is true.

Perhaps updating version.py to accept true or false would be a better user experience, since in the most cases the user does not need to change the URL to check for updates.

dosubot[bot] commented 4 months ago

To resolve the inconsistency between the description and implementation of the CHECK_UPDATE_URL configuration in Dify version 0.6.12-fix1, you should set the variable to an empty value instead of true or false. According to the documentation:

#### CHECK\_UPDATE\_URL

是否开启检查版本策略,若设置为 false,则不调用 `https://updates.dify.ai` 进行版本检查。由于目前国内无法直接访问基于 CloudFlare Worker 的版本接口,设置该变量为空,可以屏蔽该接口调用。

This means you should set CHECK_UPDATE_URL to an empty value to avoid calling the version check interface, which resolves the issue.

CHECK_UPDATE_URL=

This will prevent the application from attempting to send an HTTP request to true or false, which causes the errors you observed [1][2][3].

To continue talking to Dosu, mention @dosu.