嗨,
升級 n8n 後,我遇到了 Qdrant 向量存儲節點的問題。
我之前運行的是:
n8n 2.36.8
Qdrant 運作正常。
我升級到:
n8n 2.37.10
沒有更改任何其他設定,但現在 Qdrant 向量存儲節點失敗了。
Qdrant 伺服器是自託管的,我透過 HTTP 連接:
http://<SERVER-IP>:6333
使用 API 金鑰。
我收到的主要錯誤是:
Api key is used with unsecure connection.
Failed to obtain server version. Unable to check client-server compatibility.
Set checkCompatibility=false to skip version check.
fetch failed
我也看到:
TypeError: fetch failed
以及:
InvalidArgumentError: invalid onError method
我單獨檢查了 Qdrant,它回應正常:
curl http://<SERVER-IP>:6333/collections
所以有趣的部分是:
2.36.8 → 可用
2.37.10 → 失敗
相同的 Qdrant、相同的 URL、相同的 API 金鑰、相同的 Docker 設定和相同的工作流。
有人在 2.37.10 中看到過這種情況嗎?Qdrant 節點/用戶端在這些版本之間有什麼改變嗎?
嘿 @Yash_Nerkar ,在您等待回應的同時,這裡有一些可能對您有幫助的內容:
建議的資源
自動與您的問題相符。
文檔:
論壇:
@shouchi_migari 、@jabbson 、@Jack - 你們之前幫助過類似的問題,可以看一下嗎?
由 n8n 社區機器人自動建議。這是一個試點 - 請在此分享您的反饋 。
更新: 我進一步測試了這個問題,看起來問題並不是特定於 n8n 2.37.10。
實際上我在 n8n 2.36.8 上也看到相同的 fetch failed 問題。
有趣的部分是當我使用 測試/手動執行 執行工作流程時,Qdrant 向量存儲工作正常,但當工作流程作為 生產執行 執行時,我收到 fetch failed 錯誤。
所以目前的行為是:
n8n 2.36.8 + 測試執行 → 可用
n8n 2.36.8 + 生產執行 → fetch failed
Qdrant 伺服器、URL、API 金鑰和工作流程都相同。
我收到的錯誤是:
fetch failed
連同:
Api key is used with unsecure connection.
Failed to obtain server version.
Unable to check client-server compatibility.
Set checkCompatibility=false to skip version check.
在某些情況下:
TypeError: fetch failed
我在 Docker/佇列模式中自行代管 n8n。
所以我想知道這是否可能與 生產執行/工作者/並發性或從工作者進行 Qdrant 連線的方式 有關,而不是 n8n 版本本身。
我已附加生產執行的螢幕擷圖,顯示錯誤。
有人看過 Qdrant 向量存儲節點手動/測試執行與生產執行 之間的這種差異嗎?
我們已查看過此問題,看起來可能已在最近的版本中修復。請更新並查看您是否仍然遇到相同的問題。
嗨 @Yash_Nerkar
手動執行在主要實例上執行,生產執行在 worker 上執行,所以你的兩個測試之間改變的是開啟連線的是哪個容器,而不是版本。你的 main 可以連線到 Qdrant,但你的 worker 無法連線,這也是為什麼升級無法解決這個問題。
fetch failed 是連線層級的故障,背後沒有 HTTP 回應。其他行都是雜訊。unsecure-connection 這一行是 Qdrant client 針對純 HTTP 上的 API 金鑰所一律列印的警告,version-check 這一行是 fetch 已經失敗後隨之出現的,所以 checkCompatibility=false 將無法幫助。
從實際失敗的容器測試,使用 node 使用的相同 fetch:
docker exec -it <your-worker-container> node -e "fetch('http://<SERVER-IP>:6333/collections').then(r=>console.log(r.status)).catch(e=>console.log(e.cause))"
如果這在 main 容器中失敗而相同的指令在 main 容器中成功,worker 就在不同的網路上或沒有到該 IP 的路由,修正方案在你的 compose 檔案中,而不是在 n8n 中。
嗨,我遇到了同樣的問題,我已經檢查了好幾次,但找不到問題所在,我採取了 Claude 提出的解決方案,就是使用舊版 Node 的編譯版本,這應該可以解決這個「Bug」。如果你們能確認在哪些 n8n 和 qdrant 版本中沒有錯誤,對我能夠保持更新會幫助很大。謝謝。
嗨 @Tomas1
這背後有個真正的錯誤,而且它有個名字。n8n 捆綁了 @qdrant/js-client-rest 1.16.2 版本,在 Node 26 上會以兩種不同的方式出現問題。它的相容性檢查會拒絕 1.19.x 版本的 Qdrant 伺服器,而它固定的 undici v6 dispatcher 與 Node 自身的 fetch 衝突,這就是 invalid onError method 的來源。這些問題分別被追蹤為 37907 和 37903。
所以沒有任何 n8n 和 Qdrant 版本組合是簡單安全的。降級 Node 只能解決 dispatcher 的一半問題,對伺服器版本的問題沒有幫助,而且你需要維護自訂映像。將 Qdrant 伺服器保持在 1.19 以下是較輕鬆的權宜之計。
修復已於 9 月 3 日作為 37758 合併,將客戶端移至 1.19.0 並移除 undici 固定版本。這是值得關注的內容,而不是版本對照表。
@Yash_Nerkar 這也涉及你的情況。你第一篇文章中的 invalid onError method 行就是那個 dispatcher 衝突,所以在追蹤 worker 的網路之前值得先排除這個問題。
master ← cat-4345-undici-v6-agent-dispatcher-handed-to-nodes-built-in-fetch-v7
opened 01:39PM - 03 Sep 26 UTC
## Summary
The global `fetch` of Node >= 26 rejects a dispatcher built from und… ici v6 (`invalid onError method`). Any node that hands such an `Agent` to the global fetch fails every request with an opaque `NodeApiError: fetch failed`. The `n8n@2.38.2` image runs Node 26.7.0 and ships both undici majors, which produced the Sentry issues behind CAT-4342 and CAT-4345 (~148 events, ~127 users).
Verified inside the `n8nio/n8n:2.38.2` image: `@n8n/ai-utilities` already resolves undici v7 there, so `getProxyAgent` was not the source. The one production code path that builds a v6 `Agent` and dispatches it through the global fetch is `@qdrant/js-client-rest` 1.16.2, used by the Qdrant Vector Store node. Reproduced with that client on Node 26.8.1: every call fails with `fetch failed`, cause `invalid onError method`; on Node 24 it works. Version 1.19.0 of the client builds its `Agent` from undici 7 and works on both.
This PR:
- Updates the `@qdrant/js-client-rest` catalog entry from `^1.16.2` to `^1.19.0` (`@langchain/qdrant` dedupes onto it).
- Removes the unused `undici` v6 pins from `n8n-nodes-base` (added incidentally by #28663, zero imports) and `@n8n/ai-workflow-builder`, so no first-party package depends on undici v6 and the `undici-v6` catalog entry drops out of the lockfile.
- Adds a test in `@n8n/ai-utilities` that fails if the package ever resolves an undici major below 7.
Remaining transitive v6 consumers (`discord.js` via `@langchain/community`) keep their own correctly nested copy and do not dispatch through the global fetch.
## How to test
1. On Node >= 26, create a workflow with a Qdrant Vector Store node against any Qdrant instance and run it. Before this change every request fails with `fetch failed`; after it the request succeeds.
2. Run `pnpm --filter @n8n/n8n-nodes-langchain test nodes/vector_store/VectorStoreQdrant` (9 tests pass).
3. Run `pnpm --filter @n8n/ai-utilities test src/__tests__/utils/http-proxy-agent.test.ts` (guard test passes).
## Related Linear tickets, Github issues, and Community forum posts
Fixes https://linear.app/n8n/issue/CAT-4342
Fixes https://linear.app/n8n/issue/CAT-4345
## Review / Merge checklist
- [x] I have seen this code, I have run this code, and I take responsibility for this code.
- [x] PR title and summary are descriptive. ([conventions](../blob/master/.github/pull_request_title_conventions.md))
- [ ] [Docs updated](https://github.com/n8n-io/n8n-docs) or follow-up ticket created.
- [x] Tests included.
- [ ] PR Labeled with `Backport to Beta`, `Backport to Stable`, or `Backport to v1` (if the PR is an urgent fix that needs to be backported)
🤖 PR Summary generated by AI
🤖 Generated with [Claude Code](https://claude.com/claude-code)