The MinerU node reports a connection timeout, but the plugin can set the Base URL and Server Type to Local. #825

Closed
opened 2026-02-16 10:20:37 -05:00 by yindo · 5 comments
Owner

Originally created by @one-leaf on GitHub (Nov 21, 2025).

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 Dify issues & Dify Official Plugins, 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

1.10.0

Plugin version

0.5.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

After uploading the file, the following was returned:
An error occurred in the langgenius/mineru/mineru, please contact the author of langgenius/mineru/mineru for help, error type: ConnectTimeout, error details: timed out

I have already set the following in .env:

HTTP_REQUEST_MAX_CONNECT_TIMEOUT=300
HTTP_REQUEST_MAX_READ_TIMEOUT=600
HTTP_REQUEST_MAX_WRITE_TIMEOUT=600

✔️ Error log

ERROR [GraphWorker-0] [base.py:277] - Error in stream response for plugin {'code': -500, 'message': '{"message":"{\"args\":{},\"error_type\":\"ConnectTimeout\",\"message\":\"timed out\"}","error_type":"PluginInvokeError","args":null}', 'data': None}

Originally created by @one-leaf on GitHub (Nov 21, 2025). ### 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 [Dify issues](https://github.com/langgenius/dify/issues) & [Dify Official Plugins](https://github.com/langgenius/dify-official-plugins/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 1.10.0 ### Plugin version 0.5.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce After uploading the file, the following was returned: An error occurred in the langgenius/mineru/mineru, please contact the author of langgenius/mineru/mineru for help, error type: ConnectTimeout, error details: timed out I have already set the following in .env: HTTP_REQUEST_MAX_CONNECT_TIMEOUT=300 HTTP_REQUEST_MAX_READ_TIMEOUT=600 HTTP_REQUEST_MAX_WRITE_TIMEOUT=600 ### ✔️ Error log ERROR [GraphWorker-0] [base.py:277] - Error in stream response for plugin {'code': -500, 'message': '{"message":"{\\"args\\":{},\\"error_type\\":\\"ConnectTimeout\\",\\"message\\":\\"timed out\\"}","error_type":"PluginInvokeError","args":null}', 'data': None}
yindo added the bug label 2026-02-16 10:20:37 -05:00
yindo closed this issue 2026-02-16 10:20:38 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Nov 21, 2025):

Hi @one-leaf! I'm Dosu and I’m helping the dify-official-plugins team.

The ConnectTimeout error in the MinerU plugin (Dify 1.10.0, plugin 0.5.1, Docker) is most often caused by Docker network misconfiguration or hardcoded timeout values in the plugin code. Even if you set high timeout values in .env, the plugin may still use a fixed timeout unless you update it in the plugin's Python code and rebuild the container. For local communication, make sure the Base URL is set to an address accessible from the Dify container—avoid localhost unless the service runs in the same container; use host.docker.internal, the host's LAN IP, or the Docker service name instead. All containers must be on the same Docker network and have correct port exposure.

To troubleshoot: check that the MinerU service is running and reachable from inside the Dify container (try curl or ping from the container), review Docker logs for api, worker, and plugin_daemon (set LOG_LEVEL=DEBUG and ENABLE_REQUEST_LOGGING=True for more detail), and confirm there are no hardcoded timeouts in the plugin code. After changing any environment variables or network settings, restart your containers for changes to take effect. More details and similar cases are discussed here, here, and here.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (Nov 21, 2025): <!-- Greeting --> Hi @one-leaf! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify-official-plugins team. <!-- Answer --> The ConnectTimeout error in the MinerU plugin (Dify 1.10.0, plugin 0.5.1, Docker) is most often caused by Docker network misconfiguration or hardcoded timeout values in the plugin code. Even if you set high timeout values in `.env`, the plugin may still use a fixed timeout unless you update it in the plugin's Python code and rebuild the container. For local communication, make sure the Base URL is set to an address accessible from the Dify container—avoid `localhost` unless the service runs in the same container; use `host.docker.internal`, the host's LAN IP, or the Docker service name instead. All containers must be on the same Docker network and have correct port exposure. To troubleshoot: check that the MinerU service is running and reachable from inside the Dify container (try `curl` or `ping` from the container), review Docker logs for `api`, `worker`, and `plugin_daemon` (set `LOG_LEVEL=DEBUG` and `ENABLE_REQUEST_LOGGING=True` for more detail), and confirm there are no hardcoded timeouts in the plugin code. After changing any environment variables or network settings, restart your containers for changes to take effect. More details and similar cases are discussed [here](https://github.com/langgenius/dify-official-plugins/issues/1542), [here](https://github.com/langgenius/dify-official-plugins/issues/1718), and [here](https://github.com/langgenius/dify-official-plugins/issues/1779). <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/b83be4e0-5e4e-4f71-a950-ceb72159948a?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/b83be4e0-5e4e-4f71-a950-ceb72159948a?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/b83be4e0-5e4e-4f71-a950-ceb72159948a?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/b83be4e0-5e4e-4f71-a950-ceb72159948a?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/b83be4e0-5e4e-4f71-a950-ceb72159948a?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/b83be4e0-5e4e-4f71-a950-ceb72159948a?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/b83be4e0-5e4e-4f71-a950-ceb72159948a?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify-official-plugins/issues/2116)
Author
Owner

@one-leaf commented on GitHub (Nov 21, 2025):

MinerU and Dify are not on the same server, so I can access MinerU’s API URL from Dify’s Docker container using curl. Moreover, MinerU’s plugin can also correctly configure its base URL. @dosu

api-1 | 2025-11-21 12:35:04.475 INFO [GraphDispatcher] [debug_logging.py:157] - ▶️ Node started: 1763702936618 - "Parse File" (type: tool)
plugin_daemon-1 | [GIN] 2025/11/21 - 12:35:04 | 200 | 1.748247ms | 192.168.32.9 | GET "/plugin/c21daaff-a3dd-4e42-8c1a-1fc5162e9c60/management/tool?provider=mineru&plugin_id=langgenius%2Fmineru"
api-1 | 2025-11-21 12:35:04.478 INFO [GraphWorker-0] [_client.py:1038] - HTTP Request: GET http://plugin_daemon:5002/plugin/c21daaff-a3dd-4e42-8c1a-1fc5162e9c60/management/tool?provider=mineru&plugin_id=langgenius%2Fmineru "HTTP/1.1 200 OK"
sandbox-1 | [GIN] 2025/11/21 - 12:35:06 | 200 | 80.008µs | 127.0.0.1 | GET "/health"
plugin_daemon-1 | [GIN] 2025/11/21 - 12:35:09 | 200 | 5.092558394s | 192.168.32.9 | POST "/plugin/c21daaff-a3dd-4e42-8c1a-1fc5162e9c60/dispatch/tool/invoke"
api-1 |
api-1 | [on_tool_start] ToolCall:parse-file
api-1 | {'file': File(dify_model_identity='dify__file', id=None, tenant_id='c21daaff-a3dd-4e42-8c1a-1fc5162e9c60', type=<FileType.DOCUMENT: 'document'>, transfer_method=<FileTransferMethod.LOCAL_FILE: 'local_file'>, remote_url='http://192.168.3.16:480/files/8a4bfd9a-86ef-482a-8249-94331b10af8a/file-preview?timestamp=1763728503&nonce=923712630442e8e1b1f896ab98810abc&sign=sfI2cVSLfbK-8j4fg_KpZM5GTfh4X72aLZbyd8YUvnc%3D', related_id='8a4bfd9a-86ef-482a-8249-94331b10af8a', filename='SZLU6012470 2.pdf', extension='.pdf', mime_type='application/pdf', size=326788)}
api-1 | 2025-11-21 12:35:09.624 INFO [GraphWorker-0] [_client.py:1038] - HTTP Request: POST http://plugin_daemon:5002/plugin/c21daaff-a3dd-4e42-8c1a-1fc5162e9c60/dispatch/tool/invoke "HTTP/1.1 200 OK"
api-1 | 2025-11-21 12:35:09.631 ERROR [GraphWorker-0] [base.py:277] - Error in stream response for plugin {'code': -500, 'message': '{"message":"{\"args\":{},\"error_type\":\"ConnectTimeout\",\"message\":\"timed out\"}","error_type":"PluginInvokeError","args":null}', 'data': None}
api-1 | 2025-11-21 12:35:09.717 DEBUG [GraphDispatcher] [debug_logging.py:187] - 📝 Stream chunk from 1763702936618 (FINAL): An error occurred in the langgenius/mineru/mineru, please contact the author of langgenius/mineru/mineru for help, error type: ConnectTimeout, error details: timed out
api-1 | 2025-11-21 12:35:09.719 WARNING [GraphDispatcher] [debug_logging.py:181] - ⚠️ Node exception handled: 1763702936618
api-1 | 2025-11-21 12:35:09.720 WARNING [GraphDispatcher] [debug_logging.py:182] - Error: An error occurred in the langgenius/mineru/mineru, please contact the author of langgenius/mineru/mineru for help, error type: ConnectTimeout, error details: timed out

@one-leaf commented on GitHub (Nov 21, 2025): MinerU and Dify are not on the same server, so I can access MinerU’s API URL from Dify’s Docker container using curl. Moreover, MinerU’s plugin can also correctly configure its base URL. @dosu ---------- api-1 | 2025-11-21 12:35:04.475 INFO [GraphDispatcher] [debug_logging.py:157] - ▶️ Node started: 1763702936618 - "Parse File" (type: tool) plugin_daemon-1 | [GIN] 2025/11/21 - 12:35:04 | 200 | 1.748247ms | 192.168.32.9 | GET "/plugin/c21daaff-a3dd-4e42-8c1a-1fc5162e9c60/management/tool?provider=mineru&plugin_id=langgenius%2Fmineru" api-1 | 2025-11-21 12:35:04.478 INFO [GraphWorker-0] [_client.py:1038] - HTTP Request: GET http://plugin_daemon:5002/plugin/c21daaff-a3dd-4e42-8c1a-1fc5162e9c60/management/tool?provider=mineru&plugin_id=langgenius%2Fmineru "HTTP/1.1 200 OK" sandbox-1 | [GIN] 2025/11/21 - 12:35:06 | 200 | 80.008µs | 127.0.0.1 | GET "/health" plugin_daemon-1 | [GIN] 2025/11/21 - 12:35:09 | 200 | 5.092558394s | 192.168.32.9 | POST "/plugin/c21daaff-a3dd-4e42-8c1a-1fc5162e9c60/dispatch/tool/invoke" api-1 | api-1 | [on_tool_start] ToolCall:parse-file api-1 | {'file': File(dify_model_identity='__dify__file__', id=None, tenant_id='c21daaff-a3dd-4e42-8c1a-1fc5162e9c60', type=<FileType.DOCUMENT: 'document'>, transfer_method=<FileTransferMethod.LOCAL_FILE: 'local_file'>, remote_url='http://192.168.3.16:480/files/8a4bfd9a-86ef-482a-8249-94331b10af8a/file-preview?timestamp=1763728503&nonce=923712630442e8e1b1f896ab98810abc&sign=sfI2cVSLfbK-8j4fg_KpZM5GTfh4X72aLZbyd8YUvnc%3D', related_id='8a4bfd9a-86ef-482a-8249-94331b10af8a', filename='SZLU6012470 2.pdf', extension='.pdf', mime_type='application/pdf', size=326788)} api-1 | 2025-11-21 12:35:09.624 INFO [GraphWorker-0] [_client.py:1038] - HTTP Request: POST http://plugin_daemon:5002/plugin/c21daaff-a3dd-4e42-8c1a-1fc5162e9c60/dispatch/tool/invoke "HTTP/1.1 200 OK" api-1 | 2025-11-21 12:35:09.631 ERROR [GraphWorker-0] [base.py:277] - Error in stream response for plugin {'code': -500, 'message': '{"message":"{\\"args\\":{},\\"error_type\\":\\"ConnectTimeout\\",\\"message\\":\\"timed out\\"}","error_type":"PluginInvokeError","args":null}', 'data': None} api-1 | 2025-11-21 12:35:09.717 DEBUG [GraphDispatcher] [debug_logging.py:187] - 📝 Stream chunk from 1763702936618 (FINAL): An error occurred in the langgenius/mineru/mineru, please contact the author of langgenius/mineru/mineru for help, error type: ConnectTimeout, error details: timed out api-1 | 2025-11-21 12:35:09.719 WARNING [GraphDispatcher] [debug_logging.py:181] - ⚠️ Node exception handled: 1763702936618 api-1 | 2025-11-21 12:35:09.720 WARNING [GraphDispatcher] [debug_logging.py:182] - Error: An error occurred in the langgenius/mineru/mineru, please contact the author of langgenius/mineru/mineru for help, error type: ConnectTimeout, error details: timed out
Author
Owner

@dosubot[bot] commented on GitHub (Nov 21, 2025):

The ConnectTimeout error is likely caused by a hardcoded timeout in the MinerU plugin code, not by your .env settings. The plugin sets MAX_REQUEST_TIMEOUT=120 seconds directly in its code, so if file parsing takes longer than this, you'll get a timeout even if your environment variables are higher. The plugin also uses a 10-second timeout for server validation and does not set explicit timeouts for the main file parsing requests, relying on the default behavior of the requests library (which is no timeout, but the plugin daemon itself enforces the 120s limit) [source].

To resolve this, increase the MAX_REQUEST_TIMEOUT value in tools/mineru/main.py, rebuild the plugin container, and redeploy. Also, check MinerU server logs to see if the file parsing is slow or failing, since the file is sent directly in the POST body and MinerU does not fetch it from Dify. This should help you avoid the ConnectTimeout and identify any server-side issues.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (Nov 21, 2025): <!-- Answer --> The ConnectTimeout error is likely caused by a hardcoded timeout in the MinerU plugin code, not by your .env settings. The plugin sets MAX_REQUEST_TIMEOUT=120 seconds directly in its code, so if file parsing takes longer than this, you'll get a timeout even if your environment variables are higher. The plugin also uses a 10-second timeout for server validation and does not set explicit timeouts for the main file parsing requests, relying on the default behavior of the requests library (which is no timeout, but the plugin daemon itself enforces the 120s limit) [[source]](https://github.com/langgenius/dify-official-plugins/blob/4a352e759c87e475153ccf2ff5e2b357bc28d205/tools/mineru/main.py#L1-L7). To resolve this, increase the MAX_REQUEST_TIMEOUT value in tools/mineru/main.py, rebuild the plugin container, and redeploy. Also, check MinerU server logs to see if the file parsing is slow or failing, since the file is sent directly in the POST body and MinerU does not fetch it from Dify. This should help you avoid the ConnectTimeout and identify any server-side issues. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/f34ae1e7-9b3e-4c07-a5dd-f9222701c024?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/f34ae1e7-9b3e-4c07-a5dd-f9222701c024?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/f34ae1e7-9b3e-4c07-a5dd-f9222701c024?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/f34ae1e7-9b3e-4c07-a5dd-f9222701c024?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/f34ae1e7-9b3e-4c07-a5dd-f9222701c024?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/f34ae1e7-9b3e-4c07-a5dd-f9222701c024?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/f34ae1e7-9b3e-4c07-a5dd-f9222701c024?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify-official-plugins/issues/2116)
Author
Owner

@one-leaf commented on GitHub (Nov 21, 2025):

You can see in the logs that from the start of the call to the error took only 5 seconds, which should not be related to MAX_REQUEST_TIMEOUT = 120.

@one-leaf commented on GitHub (Nov 21, 2025): You can see in the logs that from the start of the call to the error took only 5 seconds, which should not be related to MAX_REQUEST_TIMEOUT = 120.
Author
Owner

@one-leaf commented on GitHub (Nov 28, 2025):

I’ve found a solution—just set FILES_URL=http://nginx

@one-leaf commented on GitHub (Nov 28, 2025): I’ve found a solution—just set FILES_URL=http://nginx
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#825