[GH-ISSUE #1683] [BUG]: Fetch fails with semi long messages #1100

Closed
opened 2026-02-22 18:23:07 -05:00 by yindo · 2 comments
Owner

Originally created by @Ahmad4kTesting on GitHub (Jun 14, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1683

How are you running AnythingLLM?

Docker (local)

What happened?

When I send approximately 2500 character per message I get

2024-06-14T11:55:02.511132033Z [fillSourceWindow] Need to backfill 4 chunks to fill in the source window for RAG!
2024-06-14T12:00:04.361854113Z TypeError: fetch failed
2024-06-14T12:00:04.361897693Z at Object.fetch (node:internal/deps/undici/undici:11731:11)
2024-06-14T12:00:04.361908870Z at async createOllamaStream (/app/server/node_modules/@langchain/community/dist/utils/ollama.cjs:12:22)
2024-06-14T12:00:04.361917738Z at async createOllamaChatStream (/app/server/node_modules/@langchain/community/dist/utils/ollama.cjs:61:5)
2024-06-14T12:00:04.361926104Z at async ChatOllama._streamResponseChunks (/app/server/node_modules/@langchain/community/dist/chat_models/ollama.cjs:399:30)
2024-06-14T12:00:04.361935071Z at async ChatOllama._streamIterator (/app/server/node_modules/@langchain/core/dist/language_models/chat_models.cjs:82:34)
2024-06-14T12:00:04.361946324Z at async ChatOllama.transform (/app/server/node_modules/@langchain/core/dist/runnables/base.cjs:382:9)
2024-06-14T12:00:04.361954945Z at async wrapInputForTracing (/app/server/node_modules/@langchain/core/dist/runnables/base.cjs:258:30)
2024-06-14T12:00:04.361963216Z at async pipeGeneratorWithSetup (/app/server/node_modules/@langchain/core/dist/utils/stream.cjs:230:19)
2024-06-14T12:00:04.361971705Z at async StringOutputParser._transformStreamWithConfig (/app/server/node_modules/@langchain/core/dist/runnables/base.cjs:279:26)
2024-06-14T12:00:04.361980029Z at async StringOutputParser.transform (/app/server/node_modules/@langchain/core/dist/output_parsers/transform.cjs:36:9) {
2024-06-14T12:00:04.361988592Z cause: HeadersTimeoutError: Headers Timeout Error
2024-06-14T12:00:04.361996521Z at Timeout.onParserTimeout [as callback] (node:internal/deps/undici/undici:8228:32)
2024-06-14T12:00:04.362004581Z at Timeout.onTimeout [as _onTimeout] (node:internal/deps/undici/undici:6310:17)
2024-06-14T12:00:04.362012687Z at listOnTimeout (node:internal/timers:569:17)
2024-06-14T12:00:04.362020556Z at process.processTimers (node:internal/timers:512:7) {
2024-06-14T12:00:04.362028502Z code: 'UND_ERR_HEADERS_TIMEOUT'

I've tried different model sizes and quantization with no useful result. Currently this log is generated using the dolphin-llama3 q4
I'm running the lancedb_revert image

Are there known steps to reproduce?

No response

Originally created by @Ahmad4kTesting on GitHub (Jun 14, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1683 ### How are you running AnythingLLM? Docker (local) ### What happened? When I send approximately 2500 character per message I get > 2024-06-14T11:55:02.511132033Z [fillSourceWindow] Need to backfill 4 chunks to fill in the source window for RAG! > 2024-06-14T12:00:04.361854113Z TypeError: fetch failed > 2024-06-14T12:00:04.361897693Z at Object.fetch (node:internal/deps/undici/undici:11731:11) > 2024-06-14T12:00:04.361908870Z at async createOllamaStream (/app/server/node_modules/@langchain/community/dist/utils/ollama.cjs:12:22) > 2024-06-14T12:00:04.361917738Z at async createOllamaChatStream (/app/server/node_modules/@langchain/community/dist/utils/ollama.cjs:61:5) > 2024-06-14T12:00:04.361926104Z at async ChatOllama._streamResponseChunks (/app/server/node_modules/@langchain/community/dist/chat_models/ollama.cjs:399:30) > 2024-06-14T12:00:04.361935071Z at async ChatOllama._streamIterator (/app/server/node_modules/@langchain/core/dist/language_models/chat_models.cjs:82:34) > 2024-06-14T12:00:04.361946324Z at async ChatOllama.transform (/app/server/node_modules/@langchain/core/dist/runnables/base.cjs:382:9) > 2024-06-14T12:00:04.361954945Z at async wrapInputForTracing (/app/server/node_modules/@langchain/core/dist/runnables/base.cjs:258:30) > 2024-06-14T12:00:04.361963216Z at async pipeGeneratorWithSetup (/app/server/node_modules/@langchain/core/dist/utils/stream.cjs:230:19) > 2024-06-14T12:00:04.361971705Z at async StringOutputParser._transformStreamWithConfig (/app/server/node_modules/@langchain/core/dist/runnables/base.cjs:279:26) > 2024-06-14T12:00:04.361980029Z at async StringOutputParser.transform (/app/server/node_modules/@langchain/core/dist/output_parsers/transform.cjs:36:9) { > 2024-06-14T12:00:04.361988592Z cause: HeadersTimeoutError: Headers Timeout Error > 2024-06-14T12:00:04.361996521Z at Timeout.onParserTimeout [as callback] (node:internal/deps/undici/undici:8228:32) > 2024-06-14T12:00:04.362004581Z at Timeout.onTimeout [as _onTimeout] (node:internal/deps/undici/undici:6310:17) > 2024-06-14T12:00:04.362012687Z at listOnTimeout (node:internal/timers:569:17) > 2024-06-14T12:00:04.362020556Z at process.processTimers (node:internal/timers:512:7) { > 2024-06-14T12:00:04.362028502Z code: 'UND_ERR_HEADERS_TIMEOUT' I've tried different model sizes and quantization with no useful result. Currently this log is generated using the dolphin-llama3 q4 I'm running the `lancedb_revert` image ### Are there known steps to reproduce? _No response_
yindo added the possible bug label 2026-02-22 18:23:07 -05:00
yindo closed this issue 2026-02-22 18:23:07 -05:00
Author
Owner

@shatfield4 commented on GitHub (Jun 14, 2024):

If this only happens on longer messages, check to make sure your token context window is set to the proper value in LLM settings. This may cause Ollama to error out if it is not set correctly and it may be trying to take in more tokens than the model was meant for.

@shatfield4 commented on GitHub (Jun 14, 2024): If this only happens on longer messages, check to make sure your token context window is set to the proper value in LLM settings. This may cause Ollama to error out if it is not set correctly and it may be trying to take in more tokens than the model was meant for.
Author
Owner

@timothycarambat commented on GitHub (Jun 14, 2024):

The root cause is timeout:

UND_ERR_HEADERS_TIMEOUT

Relevant: https://github.com/Mintplex-Labs/anything-llm/issues/1585

Are you running the model on CPU or a model that might be a bit too bit to get an inference from in a reasonable timeframe? more tokens = longer time-to-first-token

@timothycarambat commented on GitHub (Jun 14, 2024): The root cause is timeout: > UND_ERR_HEADERS_TIMEOUT Relevant: https://github.com/Mintplex-Labs/anything-llm/issues/1585 Are you running the model on CPU or a model that might be a bit too bit to get an inference from in a reasonable timeframe? more tokens = longer time-to-first-token
yindo changed title from [BUG]: Fetch fails with semi long messages to [GH-ISSUE #1683] [BUG]: Fetch fails with semi long messages 2026-06-05 14:38:59 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#1100