The dify-api containers unlimited restarts after setting the timezone to China in the webpage. #7453

Closed
opened 2026-02-21 18:20:41 -05:00 by yindo · 1 comment
Owner

Originally created by @EnTaroYan on GitHub (Dec 30, 2024).

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

0.14.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. Self-host the Dify in Linux. (Mine is Ubuntu 22.04)
  2. Visit the webpage and change the timezone to China.
  3. Check the Dify docker container status. The dify-api containers unlimited restarts. (I forgot whether I restarted docker. But I found it after I restarted)
  4. Check the container log:
    image

✔️ Expected Behavior

The Dify doker containers work well.

Actual Behavior

The dify-api containers unlimited restarts.

Originally created by @EnTaroYan on GitHub (Dec 30, 2024). ### 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 0.14.2 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 1. Self-host the Dify in Linux. (Mine is Ubuntu 22.04) 2. Visit the webpage and change the timezone to China. 3. Check the Dify docker container status. The dify-api containers unlimited restarts. (I forgot whether I restarted docker. But I found it after I restarted) 4. Check the container log: ![image](https://github.com/user-attachments/assets/a25696df-8475-441f-af27-e8c4a222745d) ### ✔️ Expected Behavior The Dify doker containers work well. ### ❌ Actual Behavior The dify-api containers unlimited restarts.
yindo added the 🐞 bug label 2026-02-21 18:20:41 -05:00
yindo closed this issue 2026-02-21 18:20:41 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Dec 30, 2024):

Hello @EnTaroYan! I'm here to help you with any bugs, questions, or contributions you might have for Dify. Let's work together to solve the issue you're facing.

The issue you're experiencing with the dify-api containers restarting indefinitely is due to the timezone "China" not being recognized by the pytz library, which results in a pytz.exceptions.UnknownTimeZoneError. The correct timezone for China should be "Asia/Shanghai".

To resolve this issue, you should set the timezone to "Asia/Shanghai" instead of "China". This should prevent the UnknownTimeZoneError and stop the containers from restarting [1].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@dosubot[bot] commented on GitHub (Dec 30, 2024): <!-- Greeting --> Hello @EnTaroYan! I'm here to help you with any bugs, questions, or contributions you might have for Dify. Let's work together to solve the issue you're facing. <!-- Answer --> The issue you're experiencing with the `dify-api` containers restarting indefinitely is due to the timezone "China" not being recognized by the `pytz` library, which results in a `pytz.exceptions.UnknownTimeZoneError`. The correct timezone for China should be "Asia/Shanghai". To resolve this issue, you should set the timezone to "Asia/Shanghai" instead of "China". This should prevent the `UnknownTimeZoneError` and stop the containers from restarting <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/core/tools/provider/builtin/time/tools/current_time.yaml)</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/77b9e090-485e-461e-8699-61d16e4e8f39?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/77b9e090-485e-461e-8699-61d16e4e8f39?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/77b9e090-485e-461e-8699-61d16e4e8f39?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/77b9e090-485e-461e-8699-61d16e4e8f39?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/77b9e090-485e-461e-8699-61d16e4e8f39?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/77b9e090-485e-461e-8699-61d16e4e8f39?feedback_type=other)</sup>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#7453