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

Pydantic error: TIDB_ON_QDRANT_CLIENT_TIMEOUT #10023

Closed
5 tasks done
RW21 opened this issue Oct 29, 2024 · 4 comments · Fixed by #10025
Closed
5 tasks done

Pydantic error: TIDB_ON_QDRANT_CLIENT_TIMEOUT #10023

RW21 opened this issue Oct 29, 2024 · 4 comments · Fixed by #10025
Labels
🐞 bug Something isn't working

Comments

@RW21
Copy link

RW21 commented Oct 29, 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

c6e54c8

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

docker compose up with the default config at c6e54c8.
In the console, this occurs -> #10021

✔️ Expected Behavior

Runs.

❌ Actual Behavior

A lot of services are failing with an exception with the default config and docker compose. Perhaps related to this commit: c6e54c8

api-1         | Traceback (most recent call last):
api-1         |   File "/app/api/.venv/bin/flask", line 8, in <module>
api-1         |     sys.exit(main())
api-1         |   File "/app/api/.venv/lib/python3.10/site-packages/flask/cli.py", line 1105, in main
api-1         |     cli.main()
api-1         |   File "/app/api/.venv/lib/python3.10/site-packages/click/core.py", line 1078, in main
api-1         |     rv = self.invoke(ctx)
api-1         |   File "/app/api/.venv/lib/python3.10/site-packages/click/core.py", line 1682, in invoke
api-1         |     cmd_name, cmd, args = self.resolve_command(ctx, args)
api-1         |   File "/app/api/.venv/lib/python3.10/site-packages/click/core.py", line 1729, in resolve_command
api-1         |     cmd = self.get_command(ctx, cmd_name)
api-1         |   File "/app/api/.venv/lib/python3.10/site-packages/flask/cli.py", line 611, in get_command
api-1         |     app = info.load_app()
api-1         |   File "/app/api/.venv/lib/python3.10/site-packages/flask/cli.py", line 335, in load_app
api-1         |     app = locate_app(import_name, name)
api-1         |   File "/app/api/.venv/lib/python3.10/site-packages/flask/cli.py", line 245, in locate_app
api-1         |     __import__(module_name)
api-1         |   File "/app/api/app.py", line 3, in <module>
api-1         |     from configs import dify_config
api-1         |   File "/app/api/configs/__init__.py", line 3, in <module>
api-1         |     dify_config = DifyConfig()
api-1         |   File "/app/api/.venv/lib/python3.10/site-packages/pydantic_settings/main.py", line 167, in __init__
api-1         |     super().__init__(
api-1         |   File "/app/api/.venv/lib/python3.10/site-packages/pydantic/main.py", line 212, in __init__
api-1         |     validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
api-1         | pydantic_core._pydantic_core.ValidationError: 1 validation error for DifyConfig
api-1         | TIDB_ON_QDRANT_CLIENT_TIMEOUT
api-1         |   Input should be a valid integer, unable to parse string as an integer [type=int_parsing, input_value='dify', input_type=str]
api-1         |     For further information visit https://errors.pydantic.dev/2.9/v/int_parsing
worker-1      | Traceback (most recent call last):
worker-1      |   File "/app/api/.venv/bin/flask", line 8, in <module>
worker-1      |     sys.exit(main())
worker-1      |   File "/app/api/.venv/lib/python3.10/site-packages/flask/cli.py", line 1105, in main
worker-1      |     cli.main()
worker-1      |   File "/app/api/.venv/lib/python3.10/site-packages/click/core.py", line 1078, in main
worker-1      |     rv = self.invoke(ctx)
worker-1      |   File "/app/api/.venv/lib/python3.10/site-packages/click/core.py", line 1682, in invoke
worker-1      |     cmd_name, cmd, args = self.resolve_command(ctx, args)
worker-1      |   File "/app/api/.venv/lib/python3.10/site-packages/click/core.py", line 1729, in resolve_command
worker-1      |     cmd = self.get_command(ctx, cmd_name)
worker-1      |   File "/app/api/.venv/lib/python3.10/site-packages/flask/cli.py", line 611, in get_command
worker-1      |     app = info.load_app()
worker-1      |   File "/app/api/.venv/lib/python3.10/site-packages/flask/cli.py", line 335, in load_app
worker-1      |     app = locate_app(import_name, name)
worker-1      |   File "/app/api/.venv/lib/python3.10/site-packages/flask/cli.py", line 245, in locate_app
worker-1      |     __import__(module_name)
worker-1      |   File "/app/api/app.py", line 3, in <module>
worker-1      |     from configs import dify_config
worker-1      |   File "/app/api/configs/__init__.py", line 3, in <module>
worker-1      |     dify_config = DifyConfig()
worker-1      |   File "/app/api/.venv/lib/python3.10/site-packages/pydantic_settings/main.py", line 167, in __init__
worker-1      |     super().__init__(
worker-1      |   File "/app/api/.venv/lib/python3.10/site-packages/pydantic/main.py", line 212, in __init__
worker-1      |     validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
worker-1      | pydantic_core._pydantic_core.ValidationError: 1 validation error for DifyConfig
worker-1      | TIDB_ON_QDRANT_CLIENT_TIMEOUT
worker-1      |   Input should be a valid integer, unable to parse string as an integer [type=int_parsing, input_value='dify', input_type=str]
worker-1      |     For further information visit https://errors.pydantic.dev/2.9/v/int_parsing
worker-1 exited with code 1
api-1 exited with code 1
@dosubot dosubot bot added the 🐞 bug Something isn't working label Oct 29, 2024
@RW21
Copy link
Author

RW21 commented Oct 29, 2024

It doesn't happen on de57af4

Copy link

dosubot bot commented Oct 29, 2024

@RW21 Hello! I'm here to help with bug reports, questions, and becoming a contributor.

To resolve the ValidationError related to TIDB_ON_QDRANT_CLIENT_TIMEOUT, ensure that this environment variable is set to an integer value. The error indicates that it is currently set to a string ('dify'), which is not valid.

In your Docker configuration, you should set the environment variable like this:

environment:
  - TIDB_ON_QDRANT_CLIENT_TIMEOUT=30

Make sure the value is not enclosed in quotes, as that would make it a string. Additionally, check your .env file to ensure that TIDB_ON_QDRANT_CLIENT_TIMEOUT is set correctly as an integer. The default value should be something like 20:

TIDB_ON_QDRANT_CLIENT_TIMEOUT: ${TIDB_ON_QDRANT_CLIENT_TIMEOUT:-20}

This should resolve the issue by ensuring the variable is interpreted as an integer [1][2].

To continue talking to Dosu, mention @dosu.

@crazywoola
Copy link
Member

Please switch to the v0.10.2 tag to start the application. We will fix it later.

Copy link

dosubot bot commented Oct 29, 2024

The error you're encountering with the TIDB_ON_QDRANT_CLIENT_TIMEOUT configuration is due to a mismatch in the expected data type. The TidbOnQdrantConfig class expects this configuration to be a float, but it seems like a string ('dify') is being provided instead [1].

To resolve this issue, you should check your environment configuration to ensure that the TIDB_ON_QDRANT_CLIENT_TIMEOUT variable is set to a valid float value. This can typically be done in your .env file or wherever your environment variables are defined. Make sure it is not set to a string or any non-numeric value. For example, you might set it as:

TIDB_ON_QDRANT_CLIENT_TIMEOUT=20.0

This should help in resolving the ValidationError you're experiencing when running the application with Docker.

To continue talking to Dosu, mention @dosu.

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
Development

Successfully merging a pull request may close this issue.

2 participants