LightRAG icon indicating copy to clipboard operation
LightRAG copied to clipboard

[Bug]:httpx.ReadTimeout during document processing despite increased timeout in .env (LightRAG v1.3.7)

Open Ja1aia opened this issue 6 months ago • 1 comments

Do you need to file an issue?

  • [x] I have searched the existing issues and this bug is not already filed.
  • [x] I believe this is a legitimate bug, not just a question or feature request.

Describe the bug

I'm encountering a httpx.ReadTimeout error during document ingestion in LightRAG version 1.3.7. This issue had previously occurred in v1.3.4, but at that time, increasing the timeout settings in the .env file (e.g. TIMEOUT=180) resolved it.

However, in the latest version (1.3.7), adjusting the TIMEOUT variable in the .env file does not seem to have any effect. The document processing fails with the following error trace:

It seems like the timeout configuration is either being ignored or overridden internally in this version.

Steps to reproduce

Steps to Reproduce:

Use LightRAG v1.3.7

Set up environment using .env file with TIMEOUT=300

Load a larger document (e.g., document1.pdf)

Backend LLM: LLaMA 3.3B running via Ollama

Hardware: A40 GPU

Run the document ingestion pipeline

Expected: Document processes successfully with extended timeout Actual: httpx.ReadTimeout exception occurs, and the document fails to process

Logs and screenshots

File "/root/.local/lib/python3.11/site-packages/httpx/_client.py", line 1629, in send response = await self._send_handling_auth( ... File "/root/.local/lib/python3.11/site-packages/httpx/_transports/default.py", line 118, in map_httpcore_exceptions raise mapped_exc(message) from exc

httpx.ReadTimeout

ERROR: Failed to extract document 1/1: document1.pdf INFO: Document processing pipeline completed INFO: Scanning process completed: 1 files Processed.

Additional Information

Environment:

LightRAG Version: 1.3.7

LLM: Meta LLaMA 3.3B via Ollama

GPU: NVIDIA A40

OS: Ubuntu 22.04 (Docker container)

Python: 3.11

Relevant packages: httpx, httpcore

Ja1aia avatar May 26 '25 04:05 Ja1aia

Same error here. Have you managed to fix it yet?

berrujaime avatar May 30 '25 12:05 berrujaime

not yet, for the workaround im using the older version of lightrag

Ja1aia avatar Jun 03 '25 09:06 Ja1aia

I am also got this error, could you tell me what version not occur this error or can be fix by increasing timeout value?

vanhoabk95 avatar Jun 03 '25 09:06 vanhoabk95

same problem here

3wweiweiwu avatar Jun 03 '25 17:06 3wweiweiwu

I'm not encountering this problem in version 1.3.6 with the timeout set as None in the .env

berrujaime avatar Jun 03 '25 17:06 berrujaime

Same error in version 1.3.8.

Kzhang99-c avatar Jun 09 '25 02:06 Kzhang99-c

I discovered the cause of a persistent timeout issue when using Ollama with LightRAG. The root of the problem was a hardcoded default timeout value (300 seconds) inside ollama.py, which silently overrode any timeout value set in the environment (.env file) or passed via kwargs.

Original problematic line:

timeout = kwargs.pop("timeout", None) or 300 # Default timeout 300s

This logic forces the timeout to 300 seconds if none is explicitly passed in kwargs, ignoring external configuration like .env.

To allow external control over the timeout (e.g., from .env or OLLAMA_TIMEOUT), I removed the default fallback or 300, so the logic now correctly respects what's passed in or defaults to the Ollama client's internal handling:

timeout = kwargs.pop("timeout", None)

After applying this change, the timeout behavior now works as expected, and long-running tasks no longer fail prematurely.

note: i test this on version 1.3.8

Ja1aia avatar Jun 18 '25 10:06 Ja1aia