dify icon indicating copy to clipboard operation
dify copied to clipboard

After changing .env file, new setting not apply

Open mcwongaagpt opened this issue 7 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.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Hi All, I had changed the setting in .env file, the variables of CODE_MAX_STRING_LENGTH amended After that the new setting still not apply

The procedure:

  1. Docker Compose Down
  2. Amend .env file
  3. Docker compose -f dock-compose.yaml up -d

What is the issue?

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

mcwongaagpt avatar Apr 28 '25 09:04 mcwongaagpt

To ensure that changes to the .env file are applied correctly, you should follow these steps:

  1. Stop the Docker Containers: Use docker compose down to stop the running containers.

  2. Edit the .env File: Make the necessary changes to the .env file, such as updating the CODE_MAX_STRING_LENGTH variable.

  3. Rebuild and Restart the Docker Containers: Use the following commands to rebuild and restart the containers, ensuring that the changes are applied:

    docker compose up --build -d
    

This process ensures that the environment variables are reloaded and applied to the Docker containers. Simply using docker compose up -d without the --build option might not apply changes if the images are not rebuilt [1].

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 28 '25 09:04 dosubot[bot]

Which feature do you want to choose, I am not sure if you have changed the right env variable.

crazywoola avatar Apr 30 '25 02:04 crazywoola

Image

I have changed CODE_MAX_STRING_ARRAY_LENGTH to 50, and this feature working as expected.

Image

crazywoola avatar Apr 30 '25 02:04 crazywoola