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.

Home Page:https://dify.ai

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inconsistent description and implementation about "CHECK_UPDATE_URL"

kurokobo opened this issue · comments

Self Checks

  • 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 (我已阅读并同意 Language Policy).
  • 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

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:

  • CHECK_UPDATE_URL=true
    api-1      | 2024-07-01 14:48:58,612.612 WARNING [Dummy-1] [version.py:39] - Check update version error: Invalid URL 'true': No scheme supplied. Perhaps you meant https://true?.
  • CHECK_UPDATE_URL=false
    api-1      | 2024-07-01 14:50:29,419.419 WARNING [Dummy-1] [version.py:39] - Check update version error: Invalid URL 'false': No scheme supplied. Perhaps you meant https://false?.

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.

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.