custom tools (openapi) timeout after 60 seconds #4616

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

Originally created by @forrestsocool on GitHub (Jul 15, 2024).

Originally assigned to: @crazywoola on GitHub.

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).
  • 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.6.13

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Related issues:

All above issues have same feature:

  • used custom tool.
  • timeout is 60s
  • change timeout params in docker-compose.yaml can not work.

screenshot

reproduce

  • make a custom tool with openapi,on the endpoint, just sleep 70 seconds and return a text
  • add tool to dify
  • call tool with workflow with dify

Reason (maybe)

image

✔️ Expected Behavior

can control custom tool (openapi) timeout environment params on selfhost version

Actual Behavior

can not control custom tool(openapi) environment params timeout

Originally created by @forrestsocool on GitHub (Jul 15, 2024). Originally assigned to: @crazywoola on GitHub. ### 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] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.6.13 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ### Related issues: - https://github.com/langgenius/dify/issues/5673 (which used a custom tool in a loop node) - https://github.com/langgenius/dify/issues/1383 (which used a custom tool to segment text) - https://github.com/langgenius/dify/issues/4545 (which used a custom tool ) #### All above issues have same feature: - used custom tool. - timeout is 60s - change timeout params in docker-compose.yaml can not work. ### screenshot - tool call jina, timeout https://github.com/langgenius/dify/issues/5673 ![image](https://github.com/user-attachments/assets/dfd796f1-eca3-492b-bc01-5851daec0e2d) - custom tool to segment https://github.com/langgenius/dify/issues/1383 ![image](https://github.com/user-attachments/assets/ff5f17bf-3f6c-4997-ab3d-61fc230fca0a) - my custom tool timeout: ![image](https://github.com/user-attachments/assets/bebcae11-a833-4e60-9d3c-f1960b51093f) ### reproduce - make a custom tool with openapi,on the endpoint, just sleep 70 seconds and return a text - add tool to dify - call tool with workflow with dify ### Reason (maybe) ![image](https://github.com/user-attachments/assets/1f42d658-893e-48fb-95d2-dce6c1c23487) ### ✔️ Expected Behavior can control custom tool (openapi) timeout environment params on selfhost version ### ❌ Actual Behavior can not control custom tool(openapi) environment params timeout
yindo added the 💪 enhancement label 2026-02-21 18:07:15 -05:00
yindo closed this issue 2026-02-21 18:07:15 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jul 15, 2024):

To control the custom tool (openapi) timeout environment parameters on the self-hosted version of Dify (version 0.6.13) using Docker, you need to edit the environment variable values in the .env file located in the docker/dotenvs directory. Specifically, you should look for the GUNICORN_TIMEOUT parameter and set it to your desired timeout value. After making the changes, restart Dify with the following commands:

  1. Edit the .env file in the docker/dotenvs directory to set the desired timeout parameters, such as GUNICORN_TIMEOUT.
  2. Restart Dify:
docker compose down
docker compose up -d

This process ensures that the new environment variable values are applied [1][2][3].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Jul 15, 2024): <!-- Answer --> To control the custom tool (openapi) timeout environment parameters on the self-hosted version of Dify (version 0.6.13) using Docker, you need to edit the environment variable values in the `.env` file located in the `docker/dotenvs` directory. Specifically, you should look for the `GUNICORN_TIMEOUT` parameter and set it to your desired timeout value. After making the changes, restart Dify with the following commands: 1. Edit the `.env` file in the `docker/dotenvs` directory to set the desired timeout parameters, such as `GUNICORN_TIMEOUT`. 2. Restart Dify: ```bash docker compose down docker compose up -d ``` This process ensures that the new environment variable values are applied <sup>[[1]](https://github.com/langgenius/dify-docs/blob/main/en/getting-started/install-self-hosted/docker-compose.md)</sup><sup>[[2]](https://github.com/langgenius/dify-docs/blob/main/jp/getting-started/install-self-hosted/docker-compose.md)</sup><sup>[[3]](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 (Jul 15, 2024):

Which env variable did you change?

@crazywoola commented on GitHub (Jul 15, 2024): Which env variable did you change?
Author
Owner

@forrestsocool commented on GitHub (Jul 15, 2024):

Which env variable did you change?

GUNICORN_TIMEOUT default is 360, which is larger than 60; so I tried SANDBOX_WORKER_TIMEOUT = 150; (default is 15s)

by the way, the inverse nginx proxy on my server works well when I called from browser with builtin swagger, the related timeout of nginx is more than 300s

@forrestsocool commented on GitHub (Jul 15, 2024): > Which env variable did you change? GUNICORN_TIMEOUT default is 360, which is larger than 60; so I tried SANDBOX_WORKER_TIMEOUT = 150; (default is 15s) by the way, the inverse nginx proxy on my server works well when I called from browser with builtin swagger, the related timeout of nginx is more than 300s
Author
Owner

@crazywoola commented on GitHub (Jul 16, 2024):

# Request handling timeout. The default is 200,
# it is recommended to set it to 360 to support a longer sse connection time.
GUNICORN_TIMEOUT=360

# The timeout for the worker in seconds
SANDBOX_WORKER_TIMEOUT=15

# API Tool configuration
API_TOOL_DEFAULT_CONNECT_TIMEOUT=10
API_TOOL_DEFAULT_READ_TIMEOUT=60

# HTTP Node configuration
HTTP_REQUEST_MAX_CONNECT_TIMEOUT=300
HTTP_REQUEST_MAX_READ_TIMEOUT=600
HTTP_REQUEST_MAX_WRITE_TIMEOUT=600
HTTP_REQUEST_NODE_MAX_BINARY_SIZE=10485760 # 10MB
HTTP_REQUEST_NODE_MAX_TEXT_SIZE=1048576 # 1MB

# App configuration
APP_MAX_EXECUTION_TIME=1200
APP_MAX_ACTIVE_REQUESTS=0

Actually there are several timeout settings.
I guess you have solved this by setting the SANDBOX_WORKER_TIMEOUT ?

@crazywoola commented on GitHub (Jul 16, 2024): ``` # Request handling timeout. The default is 200, # it is recommended to set it to 360 to support a longer sse connection time. GUNICORN_TIMEOUT=360 # The timeout for the worker in seconds SANDBOX_WORKER_TIMEOUT=15 # API Tool configuration API_TOOL_DEFAULT_CONNECT_TIMEOUT=10 API_TOOL_DEFAULT_READ_TIMEOUT=60 # HTTP Node configuration HTTP_REQUEST_MAX_CONNECT_TIMEOUT=300 HTTP_REQUEST_MAX_READ_TIMEOUT=600 HTTP_REQUEST_MAX_WRITE_TIMEOUT=600 HTTP_REQUEST_NODE_MAX_BINARY_SIZE=10485760 # 10MB HTTP_REQUEST_NODE_MAX_TEXT_SIZE=1048576 # 1MB # App configuration APP_MAX_EXECUTION_TIME=1200 APP_MAX_ACTIVE_REQUESTS=0 ``` Actually there are several timeout settings. I guess you have solved this by setting the `SANDBOX_WORKER_TIMEOUT `?
Author
Owner

@crazywoola commented on GitHub (Jul 16, 2024):

For this thread, it should be.

# API Tool configuration
API_TOOL_DEFAULT_CONNECT_TIMEOUT=10
API_TOOL_DEFAULT_READ_TIMEOUT=60
@crazywoola commented on GitHub (Jul 16, 2024): For this thread, it should be. ``` # API Tool configuration API_TOOL_DEFAULT_CONNECT_TIMEOUT=10 API_TOOL_DEFAULT_READ_TIMEOUT=60 ```
Author
Owner

@forrestsocool commented on GitHub (Jul 16, 2024):

I didn't see API Tool configuration in env or compose.yaml of version 0.6.13, should I add it mannually? @crazywoola
image

@forrestsocool commented on GitHub (Jul 16, 2024): I didn't see API Tool configuration in env or compose.yaml of version 0.6.13, should I add it mannually? @crazywoola ![image](https://github.com/user-attachments/assets/4928b684-8f65-4229-a51c-8e80db41ef08)
Author
Owner

@crazywoola commented on GitHub (Jul 16, 2024):

Yes

@crazywoola commented on GitHub (Jul 16, 2024): Yes
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#4616