描述問題/錯誤/問題
嗨,
我在使用最新版本的 Ollama 和 n8n 時遇到了奇怪的問題。
我的設置如下
[自託管 n8n 伺服器 docker 堆棧]
- n8n_container
- squid_proxy(用於白名單和記錄網路存取)
[ 配備 GPU 的專用伺服器(雲端)]
- ollama_container
- http://<dedicated_server>:11434/api/tags 和 /api/chat 在我的本機主機和 n8n_container 中使用 curl 時工作正常。
- 查詢專用伺服器上的任何模型也可以正確使用 n8n 工作流中的 http 請求節點
- 添加為 n8n Ollama 憑據時,http://<dedicated_server>:11434 連線似乎沒問題
- 如果我嘗試從工作流中的任何 AI 節點或 n8n 中的任何聊天模組呼叫此 ollama 執行個體,我會收到「節點 ‘AI Agent’ 出錯 - fetch 失敗」
感謝您的幫助,希望能解決此問題
請分享您的工作流
{
“nodes”: [
{
“parameters”: {},
“type”: “n8n-nodes-base.manualTrigger”,
“typeVersion”: 1,
“position”: [
0,
16
],
“id”: “cc9cc806-e14a-458d-afc4-76dcd2a560a7”,
“name”: “When clicking ‘Execute workflow’”
},
{
“parameters”: {
“method”: “POST”,
“url”: “http://fbhbxxxxxx.ikexpress.com:11434/api/chat”,
“sendBody”: true,
“specifyBody”: “json”,
“jsonBody”: “{\n “model”: “qwen3.5:9b”,\n “messages”: [\n {\n “role”: “user”,\n “content”: “quelle est la circonférence de la Terre?”\n }\n ],\n “stream”: false\n}”,
“options”: {}
},
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.4,
“position”: [
208,
16
],
“id”: “161403d3-fd98-41ea-9736-b4ee1435dff5”,
“name”: “HTTP Request”
},
{
“parameters”: {
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.chatTrigger”,
“typeVersion”: 1.4,
“position”: [
192,
192
],
“id”: “fdaf2809-b580-4937-854a-0927e2b0e32e”,
“name”: “When chat message received”,
“webhookId”: “d76a61ad-3cad-4d5c-8ade-17f5fbd64138”
},
{
“parameters”: {
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.agent”,
“typeVersion”: 3.1,
“position”: [
480,
192
],
“id”: “f47ddff9-d2a6-43cb-b883-7635b7610f7e”,
“name”: “AI Agent”
},
{
“parameters”: {
“model”: “qwen3.5:9b”,
“options”: {
“think”: true
}
},
“type”: “@n8n/n8n-nodes-langchain.lmChatOllama”,
“typeVersion”: 1,
“position”: [
320,
400
],
“id”: “78e04bfc-8a40-4f5c-a43b-972d195f6b5a”,
“name”: “Ollama Chat Model”,
“credentials”: {
“ollamaApi”: {
“id”: “PLO1mFbqxhIeusv5”,
“name”: “Ollama fbhbxxxxxx.ikexpress.com”
}
}
}
],
“connections”: {
“When clicking ‘Execute workflow’”: {
“main”: [
[
{
“node”: “HTTP Request”,
“type”: “main”,
“index”: 0
}
]
]
},
“When chat message received”: {
“main”: [
[
{
“node”: “AI Agent”,
“type”: “main”,
“index”: 0
}
]
]
},
“Ollama Chat Model”: {
“ai_languageModel”: [
[
{
“node”: “AI Agent”,
“type”: “ai_languageModel”,
“index”: 0
}
]
]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “b3dc2013ef538fd8ebfffd1dbb769a21f0519091604fee835d3a54dcbb102237”
}
}
分享最後一個節點返回的輸出
節點 ‘AI Agent’ 出錯 - fetch 失敗
關於您的 n8n 設置的資訊
- n8n 版本: 2.20.6
- 資料庫:SQLite
- n8n EXECUTIONS_PROCESS 設置(預設值:own, main):預設
- 執行 n8n 的方式(Docker、npm、n8n cloud、桌面應用程式):docker / 自託管
- 作業系統:Ubuntu 26.4