Arama Yap Mesaj Submit
Request a Callback
+90
X
X

Select Your Currency

Turkish Lira $ US Dollar Euro
X
X

Select Your Currency

Turkish Lira $ US Dollar Euro

Contact Us

Location Halkali merkez neighborhood fatih st ozgur apt no 46 , Kucukcekmece , Istanbul , 34303 , TR
n8n Ollama Error: Fix Error in sub-node Ollama Qwen3 4B
n8n, Ollama, Qwen3 and Docker

n8n Ollama Connection Error: Real Fix for 'Error in sub-node Ollama Qwen3 4B'

This article focuses on the real 'Error in sub-node Ollama Qwen3 4B' shown in our n8n screenshots. We isolated the issue through container localhost semantics, the eka-ai Docker network and the Ollama credential Base URL, then verified connectivity from inside n8n with /api/tags and /api/chat. After the fix, the same AI Agent workflow worked with qwen3:4b, Simple Memory, Calculator and an external HTTP tool.

n8n Ollama errorError in sub-node OllamaOllama Qwen3 4Bn8n AI Agentlocalhost Ollamahttp://ollama:11434Docker networkn8n credentialqwen3:4bSimple Memoryn8n self hostedUbuntu 24.04EKA Sunucu
n8n / Ollama / Qwen3 AI Agent / Ubuntu 24.04
n8n container
   ↓
http://ollama:11434
   ↓
eka-ai Docker network
   ↓
Ollama qwen3:4b

localhost:11434 ≠ Ollama container
n8n2.33.7 testModelqwen3:4b
24real WebP screenshots
3TR · EN · DE content
443public HTTPS
127.0.0.1AI service loopback
01real sub-node error screenshot
02localhost → ollama:11434 fix
03container API verification
04real successful Agent + tool results
00
Table of contents

n8n Ollama sub-node troubleshooting steps

  1. 01What did the n8n 'Error in sub-node Ollama Qwen3 4B' failure look like?
  2. 02Why is localhost inside the n8n container not Ollama?
  3. 03Verify n8n and Ollama are attached to the same Docker network
  4. 04Test Ollama /api/tags directly from inside the n8n container
  5. 05Send a real /api/chat request from the n8n container
  6. 06Set the n8n Ollama credential Base URL to http://ollama:11434
  7. 07The Ollama sub-node started running successfully
  8. 08Connect Chat Model and Simple Memory to the correct AI Agent inputs
  9. 09Verify the Agent with the Calculator tool
  10. 10Treat the later HTTP Request Tool failure as a separate issue
  11. 11After the tool fix, the Agent processed external API data successfully
  12. 12What should you check first when this error appears?
01
Real error

What did the n8n 'Error in sub-node Ollama Qwen3 4B' failure look like?

In our real workflow test the Chat Trigger succeeded, but the AI Agent failed and n8n highlighted the Ollama Qwen3 4B sub-node in red.

Instead of rebuilding the workflow, we isolated the Ollama credential and Docker-network path.

02
Root cause

Why is localhost inside the n8n container not Ollama?

n8n and Ollama run in separate containers. localhost inside n8n refers to the n8n container itself, not Ollama.

On the shared user-defined network, Docker DNS resolves the Ollama container name. Our working Base URL was http://ollama:11434.

Command 1
Wrong: http://localhost:11434
Command 2
Correct: http://ollama:11434
03
Network check

Verify n8n and Ollama are attached to the same Docker network

Our shared network was named eka-ai. Both containers must be attached to the same user-defined network for the ollama hostname to resolve.

If they are on different networks, the correct hostname still won't be reachable.

Command 1
docker network inspect eka-ai
Command 2
docker inspect n8n --format '{{json .NetworkSettings.Networks}}'
Command 3
docker inspect ollama --format '{{json .NetworkSettings.Networks}}'
04
Before the workflow

Test Ollama /api/tags directly from inside the n8n container

Our real container-to-container test returned HTTP 200 and found qwen3:4b.

If this works, focus on credentials and node configuration rather than Docker networking.

Command 1
docker exec n8n node -e "fetch('http://ollama:11434/api/tags').then(async r=>{console.log('HTTP:',r.status);console.log(await r.text())})"
05
End-to-end API

Send a real /api/chat request from the n8n container

We also sent a real chat request and received N8N-OLLAMA-BAGLANTISI-BASARILI.

That validates n8n→Ollama networking, the Ollama runtime and qwen3:4b inference together.

Command 1
docker exec n8n node -e "fetch('http://ollama:11434/api/chat',{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify({model:'qwen3:4b',messages:[{role:'user',content:'Write only N8N-OLLAMA-BAGLANTISI-BASARILI.'}],stream:false})}).then(r=>r.json()).then(j=>console.log(j.message.content))"
06
Credential fix

Set the n8n Ollama credential Base URL to http://ollama:11434

The working credential used http://ollama:11434 and was assigned to the Ollama Qwen3 4B sub-node.

The selected model was qwen3:4b.

Command 1
Base URL: http://ollama:11434
Command 2
Model: qwen3:4b
07
After the fix

The Ollama sub-node started running successfully

After fixing the credential and Docker address, the same workflow ran again without the previous red sub-node error.

The real screenshot shows the model node executing inside the existing workflow.

08
AI Agent wiring

Connect Chat Model and Simple Memory to the correct AI Agent inputs

Attach Ollama Chat Model to Chat Model and Simple Memory to Memory.

If the Agent still fails, use execution logs to identify the exact sub-node that turns red.

09
Successful tool test

Verify the Agent with the Calculator tool

After the model connection was fixed, the Agent used Calculator for 3478 × 129 and returned 448662.

This validates both model inference and tool calling.

10
Second error

Treat the later HTTP Request Tool failure as a separate issue

In a later test Ollama and the AI Agent were green while the HTTP Request Tool failed with a separate supplyData/execute error.

That is not an Ollama credential failure. The screenshot makes the layer separation clear.

11
External API success

After the tool fix, the Agent processed external API data successfully

The corrected workflow retrieved JSONPlaceholder TODO data and explained it in Turkish.

The final real screenshot shows the complete Agent + model + memory + tool chain succeeding.

12
Fast troubleshooting order

What should you check first when this error appears?

Check the Ollama container, Docker network, /api/tags from n8n, credential Base URL, model name and execution logs in that order.

This separates network, credential, model and tool failures quickly.

Command 1
docker ps --filter name='^/ollama$'
Command 2
docker network inspect eka-ai
Command 3
docker exec n8n node -e "fetch('http://ollama:11434/api/tags').then(r=>console.log(r.status)).catch(console.error)"
Command 4
docker exec ollama ollama list
Command 5
docker logs --tail 100 ollama
Production checklist

n8n + Ollama connectivity and security checklist

Do not expose Ollama port 11434 directly to the public Internet.
Use a private user-defined Docker network between n8n and Ollama.
Use Docker hostnames rather than localhost for container-to-container access.
Verify the Ollama credential Base URL against your network architecture.
Confirm the model is actually installed with ollama list.
Identify the exact failing sub-node from execution logs.
Run /api/tags and /api/chat from inside the n8n container independently of the UI.
Keep host ports 5678 and 11434 on localhost when possible.
R
Official sources

Official n8n and Ollama resources

+
EKA Sunucu

Related EKA Sunucu n8n, Ollama and Docker guides

?
FAQ

Frequently asked questions about n8n Ollama Qwen3 connection errors

What does Error in sub-node Ollama Qwen3 4B mean?

The connected Ollama model sub-node failed while the AI Agent executed.

Why can localhost:11434 fail inside n8n?

If n8n runs in its own container, localhost points to n8n itself, not the Ollama container.

What was the working Ollama Base URL?

http://ollama:11434 in our real Docker network.

Must n8n and Ollama share a network?

For container-name access, both need to be attached to the same user-defined Docker network.

What was the network called?

eka-ai.

How do I test the model list from n8n?

Call http://ollama:11434/api/tags from inside the n8n container.

What did the real network test return?

HTTP 200 and qwen3:4b was found.

What did the real chat test return?

N8N-OLLAMA-BAGLANTISI-BASARILI.

Which model was used?

qwen3:4b.

Was Simple Memory the original failure?

No. The real error screenshot highlighted the Ollama Qwen3 4B sub-node.

Did tools work after the fix?

Yes. Calculator returned 448662 for 3478 × 129.

Was the later HTTP Request Tool error the same issue?

No. Ollama was already green; the HTTP tool failed separately.

Did the external API eventually work?

Yes. JSONPlaceholder data was processed successfully.

What is the best troubleshooting order?

Container → Docker network → /api/tags → credential Base URL → model → execution logs.

EKA YAZILIM VE BİLİŞİM SİSTEMLERİ

Need a Linux VPS for n8n + Ollama AI Agent?

Run n8n, Ollama, Qwen3 and Open WebUI on your own EKA Sunucu Linux VPS.

Updated: 10.08.2026
View Linux VPS PlansLinux & VPS Guides
Top