dify icon indicating copy to clipboard operation
dify copied to clipboard

Setting the environment variable MAX_ITERATIONS_NUM is invalid

Open qlanto224 opened this issue 8 months ago • 1 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.3.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Setting the environment variable MAX_ITERATIONS_NUM is invalid.

Image

Image

Image

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

qlanto224 avatar Apr 27 '25 01:04 qlanto224

I found a similar thread titled "【BUG】Environment variable error" which is currently unsolved [1].

Regarding the issue you're facing, the MAX_ITERATIONS_NUM environment variable is used to set the maximum number of iterations allowed in the Dify codebase. It is initialized with a default value of 5, and can be updated by setting the NEXT_PUBLIC_MAX_ITERATIONS_NUM environment variable or by using the data-public-max-iterations-num attribute in the document body [2].

In your case, even though the MAX_ITERATIONS_NUM is set to 30 in the Docker container, the user interface is still showing a maximum of 5 iterations. This discrepancy suggests that the environment variable might not be correctly applied or recognized by the application. Ensure that the environment variable is correctly set in the .env file and that the Docker containers are restarted after making changes to the environment variables [3].

If the issue persists, it might be worth checking if there are any specific Docker configurations or scripts that handle environment variable management, as these could affect how the variables are loaded and applied [4].

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 Apr 27 '25 01:04 dosubot[bot]