tow docker image status always Restarting #7348

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

Originally created by @bugrootof on GitHub (Dec 22, 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

v0.8.3-fix1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

1.api-1 and worker-1 status always is Restarting.
image
2. cat api-1 logs:
2024-12-23 11:03:59 pydantic_core._pydantic_core.ValidationError: 1 validation error for DifyConfig
2024-12-23 11:03:59 CODE_EXECUTION_ENDPOINT
2024-12-23 11:03:59 Input should be a valid URL, relative URL without a base [type=url_parsing, input_value='"http://sandbox:8194"', input_type=str]
2024-12-23 11:03:59 For further information visit https://errors.pydantic.dev/2.9/v/url_parsing
2024-12-23 11:05:00 Traceback (most recent call last):
2024-12-23 11:05:00 File "/app/api/.venv/bin/flask", line 8, in
2024-12-23 11:05:00 sys.exit(main())
2024-12-23 11:05:00 ^^^^^^
2024-12-23 11:05:00 File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 1129, in main
2024-12-23 11:05:00 cli.main()
2024-12-23 11:05:00 File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1078, in main
2024-12-23 11:05:00 rv = self.invoke(ctx)
2024-12-23 11:05:00 ^^^^^^^^^^^^^^^^
2024-12-23 11:05:00 File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1682, in invoke
2024-12-23 11:05:00 cmd_name, cmd, args = self.resolve_command(ctx, args)
2024-12-23 11:05:00 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-12-23 11:05:00 File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1729, in resolve_command
2024-12-23 11:05:00 cmd = self.get_command(ctx, cmd_name)
2024-12-23 11:05:00 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-12-23 11:05:00 File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 631, in get_command
2024-12-23 11:05:00 app = info.load_app()
2024-12-23 11:05:00 ^^^^^^^^^^^^^^^
2024-12-23 11:05:00 File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 349, in load_app
2024-12-23 11:05:00 app = locate_app(import_name, name)
2024-12-23 11:05:00 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-12-23 11:05:00 File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 245, in locate_app
2024-12-23 11:05:00 import(module_name)
2024-12-23 11:05:00 File "/app/api/app.py", line 21, in
2024-12-23 11:05:00 from app_factory import create_app
2024-12-23 11:05:00 File "/app/api/app_factory.py", line 4, in
2024-12-23 11:05:00 from configs import dify_config
2024-12-23 11:05:00 File "/app/api/configs/__init__.py", line 3, in
2024-12-23 11:05:00 dify_config = DifyConfig()
2024-12-23 11:05:00 ^^^^^^^^^^^^
2024-12-23 11:05:00 File "/app/api/.venv/lib/python3.12/site-packages/pydantic_settings/main.py", line 167, in init
2024-12-23 11:05:00 super().init(
2024-12-23 11:05:00 File "/app/api/.venv/lib/python3.12/site-packages/pydantic/main.py", line 212, in init
2024-12-23 11:05:00 validated_self = self.pydantic_validator.validate_python(data, self_instance=self)
2024-12-23 11:05:00 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-12-23 11:05:00 pydantic_core._pydantic_core.ValidationError: 1 validation error for DifyConfig
2024-12-23 11:05:00 CODE_EXECUTION_ENDPOINT
2024-12-23 11:05:00 Input should be a valid URL, relative URL without a base [type=url_parsing, input_value='"http://sandbox:8194"', input_type=str]
2024-12-23 11:05:00 For further information visit https://errors.pydantic.dev/2.9/v/url_parsing
2024-12-23 10:56:51 Running migrations
2024-12-23 10:57:52 Running migrations
4. cat worker-1 logs:
2024-12-23 11:04:59 pydantic_core._pydantic_core.ValidationError: 1 validation error for DifyConfig
2024-12-23 11:04:59 CODE_EXECUTION_ENDPOINT
2024-12-23 11:04:59 Input should be a valid URL, relative URL without a base [type=url_parsing, input_value='"http://sandbox:8194"', input_type=str]
2024-12-23 11:04:59 For further information visit https://errors.pydantic.dev/2.9/v/url_parsing
2024-12-23 11:06:00 Traceback (most recent call last):
2024-12-23 11:06:00 File "/app/api/.venv/bin/flask", line 8, in
2024-12-23 11:06:00 sys.exit(main())
2024-12-23 11:06:00 ^^^^^^
2024-12-23 11:06:00 File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 1129, in main
2024-12-23 11:06:00 cli.main()
2024-12-23 11:06:00 File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1078, in main
2024-12-23 11:06:00 rv = self.invoke(ctx)
2024-12-23 11:06:00 ^^^^^^^^^^^^^^^^
2024-12-23 11:06:00 File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1682, in invoke
2024-12-23 11:06:00 cmd_name, cmd, args = self.resolve_command(ctx, args)
2024-12-23 11:06:00 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-12-23 11:06:00 File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1729, in resolve_command
2024-12-23 11:06:00 cmd = self.get_command(ctx, cmd_name)
2024-12-23 11:06:00 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-12-23 11:06:00 File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 631, in get_command
2024-12-23 11:06:00 app = info.load_app()
2024-12-23 11:06:00 ^^^^^^^^^^^^^^^
2024-12-23 11:06:00 File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 349, in load_app
2024-12-23 11:06:00 app = locate_app(import_name, name)
2024-12-23 11:06:00 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-12-23 11:06:00 File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 245, in locate_app
2024-12-23 11:06:00 import(module_name)
2024-12-23 11:06:00 File "/app/api/app.py", line 21, in
2024-12-23 11:06:00 from app_factory import create_app
2024-12-23 11:06:00 File "/app/api/app_factory.py", line 4, in
2024-12-23 11:06:00 from configs import dify_config
2024-12-23 11:06:00 File "/app/api/configs/__init__.py", line 3, in
2024-12-23 11:06:00 dify_config = DifyConfig()
2024-12-23 11:06:00 ^^^^^^^^^^^^
2024-12-23 11:06:00 File "/app/api/.venv/lib/python3.12/site-packages/pydantic_settings/main.py", line 167, in init
2024-12-23 11:06:00 super().init(
2024-12-23 11:06:00 File "/app/api/.venv/lib/python3.12/site-packages/pydantic/main.py", line 212, in init
2024-12-23 11:06:00 validated_self = self.pydantic_validator.validate_python(data, self_instance=self)
2024-12-23 11:06:00 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-12-23 11:06:00 pydantic_core._pydantic_core.ValidationError: 1 validation error for DifyConfig
2024-12-23 11:06:00 CODE_EXECUTION_ENDPOINT
2024-12-23 11:06:00 Input should be a valid URL, relative URL without a base [type=url_parsing, input_value='"http://sandbox:8194"', input_type=str]
2024-12-23 11:06:00 For further information visit https://errors.pydantic.dev/2.9/v/url_parsing

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @bugrootof on GitHub (Dec 22, 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 v0.8.3-fix1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 1.api-1 and worker-1 status always is Restarting. ![image](https://github.com/user-attachments/assets/47d294a6-6b82-481e-9bc8-643fd08aa4f3) 2. cat api-1 logs: 2024-12-23 11:03:59 pydantic_core._pydantic_core.ValidationError: 1 validation error for DifyConfig 2024-12-23 11:03:59 CODE_EXECUTION_ENDPOINT 2024-12-23 11:03:59 Input should be a valid URL, relative URL without a base [type=url_parsing, input_value='"http://sandbox:8194"', input_type=str] 2024-12-23 11:03:59 For further information visit https://errors.pydantic.dev/2.9/v/url_parsing 2024-12-23 11:05:00 Traceback (most recent call last): 2024-12-23 11:05:00 File "/app/api/.venv/bin/flask", line 8, in <module> 2024-12-23 11:05:00 sys.exit(main()) 2024-12-23 11:05:00 ^^^^^^ 2024-12-23 11:05:00 File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 1129, in main 2024-12-23 11:05:00 cli.main() 2024-12-23 11:05:00 File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1078, in main 2024-12-23 11:05:00 rv = self.invoke(ctx) 2024-12-23 11:05:00 ^^^^^^^^^^^^^^^^ 2024-12-23 11:05:00 File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1682, in invoke 2024-12-23 11:05:00 cmd_name, cmd, args = self.resolve_command(ctx, args) 2024-12-23 11:05:00 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-12-23 11:05:00 File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1729, in resolve_command 2024-12-23 11:05:00 cmd = self.get_command(ctx, cmd_name) 2024-12-23 11:05:00 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-12-23 11:05:00 File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 631, in get_command 2024-12-23 11:05:00 app = info.load_app() 2024-12-23 11:05:00 ^^^^^^^^^^^^^^^ 2024-12-23 11:05:00 File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 349, in load_app 2024-12-23 11:05:00 app = locate_app(import_name, name) 2024-12-23 11:05:00 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-12-23 11:05:00 File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 245, in locate_app 2024-12-23 11:05:00 __import__(module_name) 2024-12-23 11:05:00 File "/app/api/app.py", line 21, in <module> 2024-12-23 11:05:00 from app_factory import create_app 2024-12-23 11:05:00 File "/app/api/app_factory.py", line 4, in <module> 2024-12-23 11:05:00 from configs import dify_config 2024-12-23 11:05:00 File "/app/api/configs/__init__.py", line 3, in <module> 2024-12-23 11:05:00 dify_config = DifyConfig() 2024-12-23 11:05:00 ^^^^^^^^^^^^ 2024-12-23 11:05:00 File "/app/api/.venv/lib/python3.12/site-packages/pydantic_settings/main.py", line 167, in __init__ 2024-12-23 11:05:00 super().__init__( 2024-12-23 11:05:00 File "/app/api/.venv/lib/python3.12/site-packages/pydantic/main.py", line 212, in __init__ 2024-12-23 11:05:00 validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self) 2024-12-23 11:05:00 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-12-23 11:05:00 pydantic_core._pydantic_core.ValidationError: 1 validation error for DifyConfig 2024-12-23 11:05:00 CODE_EXECUTION_ENDPOINT 2024-12-23 11:05:00 Input should be a valid URL, relative URL without a base [type=url_parsing, input_value='"http://sandbox:8194"', input_type=str] 2024-12-23 11:05:00 For further information visit https://errors.pydantic.dev/2.9/v/url_parsing 2024-12-23 10:56:51 Running migrations 2024-12-23 10:57:52 Running migrations 4. cat worker-1 logs: 2024-12-23 11:04:59 pydantic_core._pydantic_core.ValidationError: 1 validation error for DifyConfig 2024-12-23 11:04:59 CODE_EXECUTION_ENDPOINT 2024-12-23 11:04:59 Input should be a valid URL, relative URL without a base [type=url_parsing, input_value='"http://sandbox:8194"', input_type=str] 2024-12-23 11:04:59 For further information visit https://errors.pydantic.dev/2.9/v/url_parsing 2024-12-23 11:06:00 Traceback (most recent call last): 2024-12-23 11:06:00 File "/app/api/.venv/bin/flask", line 8, in <module> 2024-12-23 11:06:00 sys.exit(main()) 2024-12-23 11:06:00 ^^^^^^ 2024-12-23 11:06:00 File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 1129, in main 2024-12-23 11:06:00 cli.main() 2024-12-23 11:06:00 File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1078, in main 2024-12-23 11:06:00 rv = self.invoke(ctx) 2024-12-23 11:06:00 ^^^^^^^^^^^^^^^^ 2024-12-23 11:06:00 File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1682, in invoke 2024-12-23 11:06:00 cmd_name, cmd, args = self.resolve_command(ctx, args) 2024-12-23 11:06:00 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-12-23 11:06:00 File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1729, in resolve_command 2024-12-23 11:06:00 cmd = self.get_command(ctx, cmd_name) 2024-12-23 11:06:00 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-12-23 11:06:00 File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 631, in get_command 2024-12-23 11:06:00 app = info.load_app() 2024-12-23 11:06:00 ^^^^^^^^^^^^^^^ 2024-12-23 11:06:00 File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 349, in load_app 2024-12-23 11:06:00 app = locate_app(import_name, name) 2024-12-23 11:06:00 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-12-23 11:06:00 File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 245, in locate_app 2024-12-23 11:06:00 __import__(module_name) 2024-12-23 11:06:00 File "/app/api/app.py", line 21, in <module> 2024-12-23 11:06:00 from app_factory import create_app 2024-12-23 11:06:00 File "/app/api/app_factory.py", line 4, in <module> 2024-12-23 11:06:00 from configs import dify_config 2024-12-23 11:06:00 File "/app/api/configs/__init__.py", line 3, in <module> 2024-12-23 11:06:00 dify_config = DifyConfig() 2024-12-23 11:06:00 ^^^^^^^^^^^^ 2024-12-23 11:06:00 File "/app/api/.venv/lib/python3.12/site-packages/pydantic_settings/main.py", line 167, in __init__ 2024-12-23 11:06:00 super().__init__( 2024-12-23 11:06:00 File "/app/api/.venv/lib/python3.12/site-packages/pydantic/main.py", line 212, in __init__ 2024-12-23 11:06:00 validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self) 2024-12-23 11:06:00 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-12-23 11:06:00 pydantic_core._pydantic_core.ValidationError: 1 validation error for DifyConfig 2024-12-23 11:06:00 CODE_EXECUTION_ENDPOINT 2024-12-23 11:06:00 Input should be a valid URL, relative URL without a base [type=url_parsing, input_value='"http://sandbox:8194"', input_type=str] 2024-12-23 11:06:00 For further information visit https://errors.pydantic.dev/2.9/v/url_parsing ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bugoutdated labels 2026-02-21 18:20:07 -05:00
yindo closed this issue 2026-02-21 18:20:07 -05:00
Author
Owner

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

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

The issue with the Docker containers "api-1" and "worker-1" constantly restarting in your self-hosted Dify setup is likely due to a misconfiguration of the CODE_EXECUTION_ENDPOINT URL. The error message indicates that the URL is not being recognized as valid, possibly because it is wrapped in quotes or missing a trailing slash.

To resolve this, ensure that the CODE_EXECUTION_ENDPOINT is correctly set in your docker/.env file. It should be configured as follows:

CODE_EXECUTION_ENDPOINT=http://sandbox:8194/

Make sure there are no quotes around the URL and that it includes a trailing slash. This configuration is necessary for the sandbox service to be correctly recognized and for the API and worker services to function properly [1][2].

Additionally, verify that the sandbox service is running correctly and is accessible at the specified endpoint. Check the docker-compose.yaml file to ensure the sandbox service is properly defined and part of the same Docker network as the api and worker services [3].

If these steps do not resolve the issue, further investigation into the logs of the sandbox service and network configurations might be necessary.

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 22, 2024): <!-- Greeting --> Hey @bugrootof, I'm here to help you with any bugs, questions, or contributions you have for the Dify project. Let's tackle this issue together! <!-- Answer --> The issue with the Docker containers "api-1" and "worker-1" constantly restarting in your self-hosted Dify setup is likely due to a misconfiguration of the `CODE_EXECUTION_ENDPOINT` URL. The error message indicates that the URL is not being recognized as valid, possibly because it is wrapped in quotes or missing a trailing slash. To resolve this, ensure that the `CODE_EXECUTION_ENDPOINT` is correctly set in your `docker/.env` file. It should be configured as follows: ```plaintext CODE_EXECUTION_ENDPOINT=http://sandbox:8194/ ``` Make sure there are no quotes around the URL and that it includes a trailing slash. This configuration is necessary for the sandbox service to be correctly recognized and for the API and worker services to function properly <sup>[[1]](https://github.com/langgenius/dify/issues/11788)</sup><sup>[[2]](https://github.com/langgenius/dify/blob/main/api/tests/unit_tests/configs/test_dify_config.py)</sup>. Additionally, verify that the `sandbox` service is running correctly and is accessible at the specified endpoint. Check the `docker-compose.yaml` file to ensure the `sandbox` service is properly defined and part of the same Docker network as the `api` and `worker` services <sup>[[3]](https://github.com/langgenius/dify/blob/main/docker/docker-compose.yaml)</sup>. If these steps do not resolve the issue, further investigation into the logs of the `sandbox` service and network configurations might be necessary. <!-- 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/0f5a074d-7378-4d22-acf7-260363d8cfe4?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/0f5a074d-7378-4d22-acf7-260363d8cfe4?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/0f5a074d-7378-4d22-acf7-260363d8cfe4?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/0f5a074d-7378-4d22-acf7-260363d8cfe4?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/0f5a074d-7378-4d22-acf7-260363d8cfe4?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/0f5a074d-7378-4d22-acf7-260363d8cfe4?feedback_type=other)</sup>
Author
Owner

@crazywoola commented on GitHub (Dec 22, 2024):

Please upgrade to latest version.

@crazywoola commented on GitHub (Dec 22, 2024): Please upgrade to latest version.
Author
Owner

@verigle commented on GitHub (Dec 23, 2024):

latest docker image of langgenius/dify-api:main also has this problem

CODE_EXECUTION_ENDPOINT has change to http://sandbox:8194/ in .env file

Traceback (most recent call last):
  File "/app/api/.venv/bin/flask", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 1129, in main
    cli.main()
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1682, in invoke
    cmd_name, cmd, args = self.resolve_command(ctx, args)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1729, in resolve_command
    cmd = self.get_command(ctx, cmd_name)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 631, in get_command
    app = info.load_app()
          ^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 349, in load_app
    app = locate_app(import_name, name)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 245, in locate_app
    __import__(module_name)
  File "/app/api/app.py", line 21, in <module>
    from app_factory import create_app
  File "/app/api/app_factory.py", line 4, in <module>
    from configs import dify_config
  File "/app/api/configs/__init__.py", line 3, in <module>
    dify_config = DifyConfig()
                  ^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/pydantic_settings/main.py", line 167, in __init__
    super().__init__(
  File "/app/api/.venv/lib/python3.12/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
CODE_EXECUTION_ENDPOINT
  Input should be a valid URL, relative URL without a base [type=url_parsing, input_value='"http://sandbox:8194/"', input_type=str]
    For further information visit https://errors.pydantic.dev/2.9/v/url_parsing
Running migrations
Traceback (most recent call last):
  File "/app/api/.venv/bin/flask", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 1129, in main
    cli.main()
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1682, in invoke
    cmd_name, cmd, args = self.resolve_command(ctx, args)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1729, in resolve_command
    cmd = self.get_command(ctx, cmd_name)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 631, in get_command
    app = info.load_app()
          ^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 349, in load_app
    app = locate_app(import_name, name)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 245, in locate_app
    __import__(module_name)
  File "/app/api/app.py", line 21, in <module>
    from app_factory import create_app
  File "/app/api/app_factory.py", line 4, in <module>
    from configs import dify_config
  File "/app/api/configs/__init__.py", line 3, in <module>
    dify_config = DifyConfig()
                  ^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/pydantic_settings/main.py", line 167, in __init__
    super().__init__(
  File "/app/api/.venv/lib/python3.12/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
CODE_EXECUTION_ENDPOINT
  Input should be a valid URL, relative URL without a base [type=url_parsing, input_value='"http://sandbox:8194/"', input_type=str]
@verigle commented on GitHub (Dec 23, 2024): latest docker image of `langgenius/dify-api:main` also has this problem CODE_EXECUTION_ENDPOINT has change to `http://sandbox:8194/` in `.env` file ``` Traceback (most recent call last): File "/app/api/.venv/bin/flask", line 8, in <module> sys.exit(main()) ^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 1129, in main cli.main() File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1682, in invoke cmd_name, cmd, args = self.resolve_command(ctx, args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1729, in resolve_command cmd = self.get_command(ctx, cmd_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 631, in get_command app = info.load_app() ^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 349, in load_app app = locate_app(import_name, name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 245, in locate_app __import__(module_name) File "/app/api/app.py", line 21, in <module> from app_factory import create_app File "/app/api/app_factory.py", line 4, in <module> from configs import dify_config File "/app/api/configs/__init__.py", line 3, in <module> dify_config = DifyConfig() ^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/pydantic_settings/main.py", line 167, in __init__ super().__init__( File "/app/api/.venv/lib/python3.12/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 CODE_EXECUTION_ENDPOINT Input should be a valid URL, relative URL without a base [type=url_parsing, input_value='"http://sandbox:8194/"', input_type=str] For further information visit https://errors.pydantic.dev/2.9/v/url_parsing Running migrations Traceback (most recent call last): File "/app/api/.venv/bin/flask", line 8, in <module> sys.exit(main()) ^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 1129, in main cli.main() File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1682, in invoke cmd_name, cmd, args = self.resolve_command(ctx, args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1729, in resolve_command cmd = self.get_command(ctx, cmd_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 631, in get_command app = info.load_app() ^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 349, in load_app app = locate_app(import_name, name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 245, in locate_app __import__(module_name) File "/app/api/app.py", line 21, in <module> from app_factory import create_app File "/app/api/app_factory.py", line 4, in <module> from configs import dify_config File "/app/api/configs/__init__.py", line 3, in <module> dify_config = DifyConfig() ^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/pydantic_settings/main.py", line 167, in __init__ super().__init__( File "/app/api/.venv/lib/python3.12/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 CODE_EXECUTION_ENDPOINT Input should be a valid URL, relative URL without a base [type=url_parsing, input_value='"http://sandbox:8194/"', input_type=str] ```
Author
Owner

@crazywoola commented on GitHub (Dec 23, 2024):

https://github.com/langgenius/dify/issues/11788

@crazywoola commented on GitHub (Dec 23, 2024): https://github.com/langgenius/dify/issues/11788
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#7348