Pydantic error: TIDB_ON_QDRANT_CLIENT_TIMEOUT #6424

Closed
opened 2026-02-21 18:15:41 -05:00 by yindo · 4 comments
Owner

Originally created by @RW21 on GitHub (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

c6e54c83c8

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

docker compose up with the default config at c6e54c83c8.
In the console, this occurs -> https://github.com/langgenius/dify/issues/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: https://github.com/langgenius/dify/commit/c6e54c83c87917334a4c95fdb5599d1597f32e4c

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
Originally created by @RW21 on GitHub (Oct 29, 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 c6e54c83c87917334a4c95fdb5599d1597f32e4c ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce `docker compose up` with the default config at c6e54c83c87917334a4c95fdb5599d1597f32e4c. In the console, this occurs -> https://github.com/langgenius/dify/issues/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: https://github.com/langgenius/dify/commit/c6e54c83c87917334a4c95fdb5599d1597f32e4c ``` 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 ```
yindo added the 🐞 bug label 2026-02-21 18:15:41 -05:00
yindo closed this issue 2026-02-21 18:15:41 -05:00
Author
Owner

@RW21 commented on GitHub (Oct 29, 2024):

It doesn't happen on https://github.com/langgenius/dify/commit/de57af46c03d65f1f0c951e8f530516ea450656d

@RW21 commented on GitHub (Oct 29, 2024): It doesn't happen on https://github.com/langgenius/dify/commit/de57af46c03d65f1f0c951e8f530516ea450656d
Author
Owner

@dosubot[bot] commented on GitHub (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.

@dosubot[bot] commented on GitHub (Oct 29, 2024): <!-- Greeting --> @RW21 Hello! I'm here to help with bug reports, questions, and becoming a contributor. <!-- Answer --> 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: ```yaml 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`: ```yaml 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 <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/configs/middleware/vdb/tidb_on_qdrant_config.py)</sup><sup>[[2]](https://github.com/langgenius/dify/blob/main/docker/docker-compose.yaml)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@crazywoola commented on GitHub (Oct 29, 2024):

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

@crazywoola commented on GitHub (Oct 29, 2024): Please switch to the v0.10.2 tag to start the application. We will fix it later.
Author
Owner

@dosubot[bot] commented on GitHub (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.

@dosubot[bot] commented on GitHub (Oct 29, 2024): <!-- Answer --> 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 <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/configs/middleware/vdb/tidb_on_qdrant_config.py)</sup>. 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: ```plaintext TIDB_ON_QDRANT_CLIENT_TIMEOUT=20.0 ``` This should help in resolving the `ValidationError` you're experiencing when running the application with Docker. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#6424