set LOOP_NODE_MAX_COUNT or NEXT_PUBLIC_LOOP_NODE_MAX_COUNT in .env not work #13856

Closed
opened 2026-02-21 19:14:13 -05:00 by yindo · 9 comments
Owner

Originally created by @aokui on GitHub (May 14, 2025).

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).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.2.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

LOOP_NODE_MAX_COUNT=200 or NEXT_PUBLIC_LOOP_NODE_MAX_COUNT=200 in env

✔️ Expected Behavior

i can choose 200 or more in loop node

Actual Behavior

the max steps still 100 in loop node ,set LOOP_NODE_MAX_COUNT=200 in .env not work

Image

Originally created by @aokui on GitHub (May 14, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.2.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce LOOP_NODE_MAX_COUNT=200 or NEXT_PUBLIC_LOOP_NODE_MAX_COUNT=200 in env ### ✔️ Expected Behavior i can choose 200 or more in loop node ### ❌ Actual Behavior the max steps still 100 in loop node ,set LOOP_NODE_MAX_COUNT=200 in .env not work ![Image](https://github.com/user-attachments/assets/f3ce29b0-2849-4741-bb77-cfc2f55d94b2)
yindo added the 🐞 bug label 2026-02-21 19:14:13 -05:00
yindo closed this issue 2026-02-21 19:14:13 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (May 14, 2025):

Hello @aokui! I'm Dosu, your friendly bot here to help you with bugs, answer questions, and guide you on your journey as a contributor. I'm here while you wait for a human maintainer. Let's tackle this issue together!

To address the issue of setting LOOP_NODE_MAX_COUNT or NEXT_PUBLIC_LOOP_NODE_MAX_COUNT in the .env file not working, ensure that you are using the correct environment variable, which is NEXT_PUBLIC_LOOP_NODE_MAX_COUNT. After setting it to 200, you must restart the Docker container for the changes to take effect. Here is the process to restart the Docker container:

  1. Navigate to the Docker directory of your Dify installation:

    cd dify/docker
    
  2. Stop and remove the existing containers:

    docker compose down
    
  3. Start the containers again with the updated configuration:

    docker compose up -d
    
  4. Verify that the application is running correctly by checking the logs:

    docker logs -f dify-web-1
    

This process ensures that the environment variable changes are applied correctly [1][2]. If the issue persists, double-check that the .env file is correctly configured and that there are no typos in the variable names.

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] commented on GitHub (May 14, 2025): <!-- Greeting --> Hello @aokui! I'm [Dosu](https://dosu.dev), your friendly bot here to help you with bugs, answer questions, and guide you on your journey as a contributor. I'm here while you wait for a human maintainer. Let's tackle this issue together! <!-- Answer --> To address the issue of setting `LOOP_NODE_MAX_COUNT` or `NEXT_PUBLIC_LOOP_NODE_MAX_COUNT` in the `.env` file not working, ensure that you are using the correct environment variable, which is `NEXT_PUBLIC_LOOP_NODE_MAX_COUNT`. After setting it to 200, you must restart the Docker container for the changes to take effect. Here is the process to restart the Docker container: 1. Navigate to the Docker directory of your Dify installation: ```bash cd dify/docker ``` 2. Stop and remove the existing containers: ```bash docker compose down ``` 3. Start the containers again with the updated configuration: ```bash docker compose up -d ``` 4. Verify that the application is running correctly by checking the logs: ```bash docker logs -f dify-web-1 ``` This process ensures that the environment variable changes are applied correctly <sup>[[1]](https://github.com/langgenius/dify/issues/14713)</sup><sup>[[2]](https://github.com/langgenius/dify/issues/14603)</sup>. If the issue persists, double-check that the `.env` file is correctly configured and that there are no typos in the variable names. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/08b5e397-2280-4390-a260-293a48ce938b?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/08b5e397-2280-4390-a260-293a48ce938b?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/08b5e397-2280-4390-a260-293a48ce938b?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/08b5e397-2280-4390-a260-293a48ce938b?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/08b5e397-2280-4390-a260-293a48ce938b?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/08b5e397-2280-4390-a260-293a48ce938b?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/08b5e397-2280-4390-a260-293a48ce938b?feedback_type=other)</sup>
Author
Owner

@aokui commented on GitHub (May 14, 2025):

I followed these steps, but still the same problem. @dosu

@aokui commented on GitHub (May 14, 2025): I followed these steps, but still the same problem. @dosu
Author
Owner

@dosubot[bot] commented on GitHub (May 14, 2025):

Ensure that the environment variable NEXT_PUBLIC_LOOP_NODE_MAX_COUNT is set correctly in the .env file located in the docker directory. Also, verify that there are no syntax errors or extra spaces in the .env file.

If the issue persists, check if there are any known issues with environment variables in your version of Dify. In Dify 1.3, there was a known issue where environment variables became invisible after modification, which was fixed in a later update [1]. Consider updating to a newer version if possible.

Additionally, ensure that there are no other configurations or caching mechanisms that might override or ignore the environment variable settings. If none of these steps resolve the issue, reviewing the Docker logs for any error messages might provide further insights.

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] commented on GitHub (May 14, 2025): <!-- Answer --> Ensure that the environment variable `NEXT_PUBLIC_LOOP_NODE_MAX_COUNT` is set correctly in the `.env` file located in the `docker` directory. Also, verify that there are no syntax errors or extra spaces in the `.env` file. If the issue persists, check if there are any known issues with environment variables in your version of Dify. In Dify 1.3, there was a known issue where environment variables became invisible after modification, which was fixed in a later update <sup>[[1]](https://github.com/langgenius/dify/discussions/18793)</sup>. Consider updating to a newer version if possible. Additionally, ensure that there are no other configurations or caching mechanisms that might override or ignore the environment variable settings. If none of these steps resolve the issue, reviewing the Docker logs for any error messages might provide further insights. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/1f88252f-1746-463c-b109-84b156df6a0e?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/1f88252f-1746-463c-b109-84b156df6a0e?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/1f88252f-1746-463c-b109-84b156df6a0e?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/1f88252f-1746-463c-b109-84b156df6a0e?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/1f88252f-1746-463c-b109-84b156df6a0e?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/1f88252f-1746-463c-b109-84b156df6a0e?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/1f88252f-1746-463c-b109-84b156df6a0e?feedback_type=other)</sup>
Author
Owner

@aokui commented on GitHub (May 14, 2025):

I use the 1.3.0 latest version, and this problem has not been solved. Before this,i am ensure restart container several times. @dosu

@aokui commented on GitHub (May 14, 2025): I use the 1.3.0 latest version, and this problem has not been solved. Before this,i am ensure restart container several times. @dosu
Author
Owner

@dosubot[bot] commented on GitHub (May 14, 2025):

In Dify version 1.3.0, there are known issues related to environment variables, including problems with variables becoming invisible in input fields and not being accessible for value assignment in workflow mode [1][2]. These issues have been addressed in version 1.3.1. I recommend upgrading to version 1.3.1 or later to resolve these problems. Additionally, ensure that your .env file is correctly configured and synchronized, and restart the application after making changes [3].

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] commented on GitHub (May 14, 2025): <!-- Answer --> In Dify version 1.3.0, there are known issues related to environment variables, including problems with variables becoming invisible in input fields and not being accessible for value assignment in workflow mode <sup>[[1]](https://github.com/langgenius/dify/issues/18732)</sup><sup>[[2]](https://github.com/langgenius/dify/issues/19004)</sup>. These issues have been addressed in version 1.3.1. I recommend upgrading to version 1.3.1 or later to resolve these problems. Additionally, ensure that your `.env` file is correctly configured and synchronized, and restart the application after making changes <sup>[[3]](https://github.com/langgenius/dify/issues/18849)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/1ab3c087-9b7f-4c2b-9f8e-11a5bc455f81?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/1ab3c087-9b7f-4c2b-9f8e-11a5bc455f81?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/1ab3c087-9b7f-4c2b-9f8e-11a5bc455f81?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/1ab3c087-9b7f-4c2b-9f8e-11a5bc455f81?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/1ab3c087-9b7f-4c2b-9f8e-11a5bc455f81?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/1ab3c087-9b7f-4c2b-9f8e-11a5bc455f81?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/1ab3c087-9b7f-4c2b-9f8e-11a5bc455f81?feedback_type=other)</sup>
Author
Owner

@aokui commented on GitHub (May 14, 2025):

Sorrry ,this is a clerical error ,This is the version 1.3.1 I am using. @dosu

@aokui commented on GitHub (May 14, 2025): Sorrry ,this is a clerical error ,This is the version 1.3.1 I am using. @dosu
Author
Owner

@dosubot[bot] commented on GitHub (May 14, 2025):

In Dify version 1.3.1, ensure that you are using the correct environment variable NEXT_PUBLIC_LOOP_NODE_MAX_COUNT in your .env file. After making changes, restart your Docker containers to apply the updates. Here’s a quick reminder of the steps:

  1. Stop the running containers:

    docker compose down
    
  2. Edit the .env file to set NEXT_PUBLIC_LOOP_NODE_MAX_COUNT=200.

  3. Start the containers again:

    docker compose up -d
    

Make sure there are no syntax errors in the .env file and that the variable name is correct. If the issue persists, check the Docker logs for any error messages that might provide further insights. If there are no errors, and the problem continues, it might be worth checking if there are any other configurations or caching mechanisms that could be affecting the environment variable settings [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] commented on GitHub (May 14, 2025): <!-- Answer --> In Dify version 1.3.1, ensure that you are using the correct environment variable `NEXT_PUBLIC_LOOP_NODE_MAX_COUNT` in your `.env` file. After making changes, restart your Docker containers to apply the updates. Here’s a quick reminder of the steps: 1. Stop the running containers: ```bash docker compose down ``` 2. Edit the `.env` file to set `NEXT_PUBLIC_LOOP_NODE_MAX_COUNT=200`. 3. Start the containers again: ```bash docker compose up -d ``` Make sure there are no syntax errors in the `.env` file and that the variable name is correct. If the issue persists, check the Docker logs for any error messages that might provide further insights. If there are no errors, and the problem continues, it might be worth checking if there are any other configurations or caching mechanisms that could be affecting the environment variable settings <sup>[[1]](https://github.com/langgenius/dify/issues/18998)</sup><sup>[[2]](https://github.com/langgenius/dify/issues/17384)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/1d0bc467-0675-49a4-9e26-956c0852ffed?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/1d0bc467-0675-49a4-9e26-956c0852ffed?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/1d0bc467-0675-49a4-9e26-956c0852ffed?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/1d0bc467-0675-49a4-9e26-956c0852ffed?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/1d0bc467-0675-49a4-9e26-956c0852ffed?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/1d0bc467-0675-49a4-9e26-956c0852ffed?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/1d0bc467-0675-49a4-9e26-956c0852ffed?feedback_type=other)</sup>
Author
Owner

@DavideDelbianco commented on GitHub (May 14, 2025):

This is because the contributors made mistakes when implementing those ENV variables and never came back to fix them :ahah:
I had reported the issue here: https://github.com/langgenius/dify/pull/16805
Explained the issue in another of his PR here: https://github.com/langgenius/dify/pull/15964
And ultimately linked both in an issue here: https://github.com/langgenius/dify/issues/17452

@crazywoola never came back with an answer from the frontend developer/team about those NEXT_PUBLIC envs and probably no-one ever proceeded to implement the fixes to the non-working contributed code :)

@DavideDelbianco commented on GitHub (May 14, 2025): This is because the contributors made mistakes when implementing those ENV variables and never came back to fix them :ahah: I had reported the issue here: https://github.com/langgenius/dify/pull/16805 Explained the issue in another of his PR here: https://github.com/langgenius/dify/pull/15964 And ultimately linked both in an issue here: https://github.com/langgenius/dify/issues/17452 @crazywoola never came back with an answer from the frontend developer/team about those NEXT_PUBLIC envs and probably no-one ever proceeded to implement the fixes to the non-working contributed code :)
Author
Owner

@crazywoola commented on GitHub (May 15, 2025):

This is because the contributors made mistakes when implementing those ENV variables and never came back to fix them :ahah: I had reported the issue here: #16805 Explained the issue in another of his PR here: #15964 And ultimately linked both in an issue here: #17452

@crazywoola never came back with an answer from the frontend developer/team about those NEXT_PUBLIC envs and probably no-one ever proceeded to implement the fixes to the non-working contributed code :)

I have read this issue https://github.com/langgenius/dify/issues/17452 and talked about with our frontend team. However we haven't got any better solution :( That's why we haven't responded to this issue.

NEXT_PUBLIC_ variables are a lazy developer hack

I agree with this, however we haven't reached an agreement that how we should get these variables without rebuild the images.

  • An approach is that we get everything we need from the api container within an API like we get the FILE_SIZE_LIMIT.

I’d be grateful to draw from your perspective.

@crazywoola commented on GitHub (May 15, 2025): > This is because the contributors made mistakes when implementing those ENV variables and never came back to fix them :ahah: I had reported the issue here: [#16805](https://github.com/langgenius/dify/pull/16805) Explained the issue in another of his PR here: [#15964](https://github.com/langgenius/dify/pull/15964) And ultimately linked both in an issue here: [#17452](https://github.com/langgenius/dify/issues/17452) > > [@crazywoola](https://github.com/crazywoola) never came back with an answer from the frontend developer/team about those NEXT_PUBLIC envs and probably no-one ever proceeded to implement the fixes to the non-working contributed code :) I have read this issue https://github.com/langgenius/dify/issues/17452 and talked about with our frontend team. However we haven't got any better solution :( That's why we haven't responded to this issue. > NEXT_PUBLIC_ variables are a lazy developer hack I agree with this, however we haven't reached an agreement that how we should get these variables without rebuild the images. - An approach is that we get everything we need from the api container within an API like we get the FILE_SIZE_LIMIT. I’d be grateful to draw from your perspective.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#13856