Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LOG_TZ ValidationError #10061

Closed
5 tasks done
mayiming0708 opened this issue Oct 30, 2024 · 2 comments · Fixed by #10077
Closed
5 tasks done

LOG_TZ ValidationError #10061

mayiming0708 opened this issue Oct 30, 2024 · 2 comments · Fixed by #10077
Labels
🐞 bug Something isn't working

Comments

@mayiming0708
Copy link

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

bab5c54

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

start and visit, if I revert this commit(bab5c54),it will be ok

✔️ Expected Behavior

No response

❌ Actual Behavior

Traceback (most recent call last):
File "/Users/antk/Documents/code/github.com/langgenius/dify/api/.venv/lib/python3.10/site-packages/flask/cli.py", line 948, in app
raise err from None
File "/Users/antk/Documents/code/github.com/langgenius/dify/api/.venv/lib/python3.10/site-packages/werkzeug/debug/init.py", line 342, in debug_application
app_iter = self.app(environ, start_response)
File "/Users/antk/Documents/code/github.com/langgenius/dify/api/.venv/lib/python3.10/site-packages/flask/cli.py", line 948, in app
raise err from None
File "/Users/antk/Documents/code/github.com/langgenius/dify/api/.venv/lib/python3.10/site-packages/flask/cli.py", line 937, in run_command
app: WSGIApplication = info.load_app()
File "/Users/antk/Documents/code/github.com/langgenius/dify/api/.venv/lib/python3.10/site-packages/flask/cli.py", line 339, in load_app
app = locate_app(import_name, None, raise_if_not_found=False)
File "/Users/antk/Documents/code/github.com/langgenius/dify/api/.venv/lib/python3.10/site-packages/flask/cli.py", line 245, in locate_app
import(module_name)
File "/Users/antk/Documents/code/github.com/langgenius/dify/api/app.py", line 3, in
from configs import dify_config
File "/Users/antk/Documents/code/github.com/langgenius/dify/api/configs/init.py", line 3, in
dify_config = DifyConfig()
File "/Users/antk/Documents/code/github.com/langgenius/dify/api/.venv/lib/python3.10/site-packages/pydantic_settings/main.py", line 167, in init
super().init(
File "/Users/antk/Documents/code/github.com/langgenius/dify/api/.venv/lib/python3.10/site-packages/pydantic/main.py", line 212, in init
validated_self = self.pydantic_validator.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 1 validation error for DifyConfig
LOG_TZ
String should have at least 1 character [type=string_too_short, input_value='', input_type=str]
For further information visit https://errors.pydantic.dev/2.9/v/string_too_short

@dosubot dosubot bot added the 🐞 bug Something isn't working label Oct 30, 2024
Copy link

dosubot bot commented Oct 30, 2024

Hey @mayiming0708! I'm here to help you with any bugs, questions, or contributions you have for the project. Let's tackle this together!

It seems like you're encountering a ValidationError related to the LOG_TZ configuration in the DifyConfig class. The error indicates that the LOG_TZ field is expected to have at least one character, but it appears to be an empty string.

The LOG_TZ configuration is used to set the timezone for log timestamps, and it should be a valid timezone name according to the IANA Time Zone Database, such as 'America/New_York' [1][2].

To resolve this issue, ensure that the LOG_TZ field in your configuration is set to a valid timezone string. If you don't need to specify a timezone, you can set it to None, which will use the system's default timezone.

If the issue persists after setting a valid timezone, it might be related to changes introduced in the commit bab5c542197f935d35fe75eb5d2c3301fbbf58b4. Unfortunately, I don't have specific details on what changes were made in that commit, but reverting it seems to resolve the issue according to your description. You might want to review the changes in that commit to understand how it affects the LOG_TZ validation.

To continue talking to Dosu, mention @dosu.

@mayiming0708
Copy link
Author

LOG_TZ use default config None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
1 participant