[{"data":1,"prerenderedAt":5562},["ShallowReactive",2],{"blog-post-failed-to-fetch-significado-e-solucao":3,"related-posts-failed-to-fetch-significado-e-solucao":1031},{"id":4,"title":5,"author":6,"body":11,"category":1000,"date":1001,"description":1002,"extension":1003,"featured":1004,"hideToc":1004,"image":1005,"imageAlt":1006,"imageHeight":1007,"imageWidth":1008,"lang":1009,"meta":1010,"navigation":645,"path":1011,"readingTime":1012,"redirected":1004,"relatedSlugs":1013,"seo":1017,"seoTitle":1018,"stem":1019,"tags":1020,"updatedDate":1029,"__hash__":1030},"blog/blog/failed-to-fetch-significado-e-solucao.md","Failed to Fetch: O Que Significa e Como Resolver",{"name":7,"role":8,"avatar":9,"url":10},"Shabnam Katoch","Growth Head","/img/avatars/shabnam-profile.jpeg","https://www.betterclaw.io/about",{"type":12,"value":13,"toc":982},"minimark",[14,18,26,29,41,44,51,56,59,72,82,93,97,100,134,137,143,147,150,210,217,221,224,333,336,343,348,351,377,390,396,403,406,417,424,430,433,471,475,485,519,525,579,600,606,610,613,618,710,715,749,756,763,784,788,791,795,802,833,837,847,850,858,865,871,875,887,891,899,905,908,919,923,928,931,936,947,952,955,960,970,975,978],[15,16,17],"p",{},"Apareceu \"Failed to fetch\" na tela e nada funciona? Calma. Não é vírus, não é hackeamento e, na maioria das vezes, nem é culpa sua. Aqui está o que o erro significa em português e como resolver, primeiro para quem só está usando um app, depois para quem está escrevendo o código.",[15,19,20,21,25],{},"Você clicou num botão. Esperou. E em vez do resultado apareceu isto: ",[22,23,24],"code",{},"Failed to fetch",".",[15,27,28],{},"Traduzindo ao pé da letra, é \"falha ao buscar\". O navegador tentou buscar dados num servidor e não recebeu resposta nenhuma. Não um erro. Nenhuma resposta.",[30,31,34],"callout",{"label":32,"type":33},"Resposta rápida","quick-fix",[15,35,36,40],{},[37,38,39],"strong",{},"\"Failed to fetch\" significa que o navegador enviou uma requisição e nunca recebeu resposta do servidor."," Não é um erro 404 nem 500, porque nesses casos o servidor respondeu. As causas mais comuns são um bloqueio de CORS, um servidor fora do ar ou com endereço errado, uma página HTTPS tentando acessar algo em HTTP, ou uma extensão do navegador bloqueando a requisição.",[15,42,43],{},"Essa diferença é a chave de tudo. Um erro 404 quer dizer \"cheguei ao servidor e ele disse que a página não existe\". Um \"Failed to fetch\" quer dizer \"nem consegui conversar com o servidor\". Por isso a mensagem é tão vaga: o navegador não sabe o que aconteceu do outro lado, só sabe que ninguém respondeu.",[15,45,46],{},[47,48],"img",{"alt":49,"src":50},"Um 404 é uma resposta do servidor; Failed to fetch é silêncio, sem resposta nenhuma","/img/blog/failed-to-fetch-significado-e-solucao-404.jpg",[52,53,55],"h2",{"id":54},"primeiro-onde-esse-erro-apareceu","Primeiro: onde esse erro apareceu?",[15,57,58],{},"O caminho para resolver depende totalmente disso. Escolha o seu:",[15,60,61,62,65,66,71],{},"→ ",[37,63,64],{},"Apareceu num app ou site que não é seu"," (um sistema da empresa, um app no celular, uma ferramenta online). Siga para a ",[67,68,70],"a",{"href":69},"#apareceu-num-app-ou-site-o-que-fazer","próxima seção",". Você não precisa saber programar.",[15,73,61,74,77,78,25],{},[37,75,76],{},"Apareceu no seu próprio código"," (JavaScript, Node.js, um backend em Python). Pule para ",[67,79,81],{"href":80},"#corre%C3%A7%C3%B5es-para-desenvolvedores","Correções para desenvolvedores",[15,83,61,84,87,88,92],{},[37,85,86],{},"Apareceu num agente de IA"," (n8n, OpenClaw, Ollama). Tem uma ",[67,89,91],{"href":90},"#failed-to-fetch-em-agentes-de-ia-n8n-openclaw-e-ollama","seção só para isso"," mais abaixo.",[52,94,96],{"id":95},"apareceu-num-app-ou-site-o-que-fazer","Apareceu num app ou site: o que fazer",[15,98,99],{},"Aqui vai a notícia boa: se você só está usando o app, quase sempre não foi você que quebrou nada. Faça estes testes na ordem, porque cada um descarta uma causa.",[101,102,103,110,116,122,128],"ol",{},[104,105,106,109],"li",{},[37,107,108],{},"Recarregue de verdade."," No computador, use Ctrl+Shift+R (Cmd+Shift+R no Mac), que ignora o cache. No celular, feche o app por completo e abra de novo. Parece bobo, mas resolve uma boa parte dos casos em que a requisição foi interrompida no meio.",[104,111,112,115],{},[37,113,114],{},"Teste numa aba anônima."," Se funcionar ali e não na aba normal, o culpado é uma extensão, quase sempre um bloqueador de anúncios ou de privacidade. Desative as extensões uma por uma até achar qual é.",[104,117,118,121],{},[37,119,120],{},"Desligue a VPN, o proxy ou o antivírus por um minuto."," Qualquer coisa que fique entre o seu navegador e a internet pode barrar a requisição sem avisar. Firewall de rede corporativa também entra nessa lista.",[104,123,124,127],{},[37,125,126],{},"Troque de rede."," Saia do Wi-Fi e use os dados do celular, ou o contrário. Se funcionar numa rede e não na outra, o problema é a rede (DNS, bloqueio da empresa, roteador), não o app.",[104,129,130,133],{},[37,131,132],{},"Talvez o serviço esteja fora do ar."," Se nada disso resolveu e o erro aparece em qualquer rede e em qualquer navegador, provavelmente o servidor do serviço caiu. Não há nada para você consertar. Espere alguns minutos e tente de novo.",[15,135,136],{},"Se funcionou numa aba anônima, numa outra rede ou num outro dispositivo, o app está bom. O problema está entre você e ele.",[15,138,139],{},[47,140],{"alt":141,"src":142},"Teste nesta ordem: recarregar, aba anônima, VPN e proxy, Wi-Fi ou 4G/5G, servidor fora do ar","/img/blog/failed-to-fetch-significado-e-solucao-ordem.jpg",[52,144,146],{"id":145},"a-mensagem-muda-conforme-o-navegador","A mensagem muda conforme o navegador",[15,148,149],{},"É o mesmo erro com nomes diferentes. Se você chegou aqui procurando uma dessas frases, está no lugar certo:",[151,152,153,166],"table",{},[154,155,156],"thead",{},[157,158,159,163],"tr",{},[160,161,162],"th",{},"Onde aparece",[160,164,165],{},"Mensagem exata",[167,168,169,180,190,200],"tbody",{},[157,170,171,175],{},[172,173,174],"td",{},"Chrome, Edge, Brave, Opera",[172,176,177],{},[22,178,179],{},"TypeError: Failed to fetch",[157,181,182,185],{},[172,183,184],{},"Firefox",[172,186,187],{},[22,188,189],{},"TypeError: NetworkError when attempting to fetch resource.",[157,191,192,195],{},[172,193,194],{},"Safari (Mac e iPhone)",[172,196,197],{},[22,198,199],{},"TypeError: Load failed",[157,201,202,205],{},[172,203,204],{},"Node.js (servidor)",[172,206,207],{},[22,208,209],{},"TypeError: fetch failed",[15,211,212,213,92],{},"As três primeiras significam exatamente a mesma coisa. A última, do Node.js, parece igual mas é outro bicho, e tem uma ",[67,214,216],{"href":215},"#nodejs-fetch-failed-n%C3%A3o-%C3%A9-failed-to-fetch","seção própria",[52,218,220],{"id":219},"tabela-de-diagnóstico","Tabela de diagnóstico",[15,222,223],{},"Use o sintoma para chegar à causa sem adivinhar:",[151,225,226,239],{},[154,227,228],{},[157,229,230,233,236],{},[160,231,232],{},"O que você observa",[160,234,235],{},"Causa provável",[160,237,238],{},"O que fazer",[167,240,241,252,263,274,288,305,316],{},[157,242,243,246,249],{},[172,244,245],{},"Funciona em aba anônima, falha na normal",[172,247,248],{},"Extensão ou bloqueador de anúncios",[172,250,251],{},"Desativar extensões uma a uma",[157,253,254,257,260],{},[172,255,256],{},"Funciona no 4G/5G, falha no Wi-Fi",[172,258,259],{},"Rede, DNS ou firewall",[172,261,262],{},"Trocar de rede ou de DNS",[157,264,265,268,271],{},[172,266,267],{},"Falha para todo mundo, em qualquer rede",[172,269,270],{},"Servidor fora do ar",[172,272,273],{},"Aguardar",[157,275,276,282,285],{},[172,277,278,279],{},"Console mostra ",[22,280,281],{},"blocked by CORS policy",[172,283,284],{},"CORS",[172,286,287],{},"Configurar o servidor (veja abaixo)",[157,289,290,295,298],{},[172,291,278,292],{},[22,293,294],{},"Mixed Content",[172,296,297],{},"Página HTTPS chamando HTTP",[172,299,300,301,304],{},"Usar ",[22,302,303],{},"https://"," na URL",[157,306,307,310,313],{},[172,308,309],{},"A URL abre direto no navegador, mas o fetch falha",[172,311,312],{},"Quase sempre CORS",[172,314,315],{},"Configurar o servidor",[157,317,318,324,327],{},[172,319,320,321],{},"Node.js mostra ",[22,322,323],{},"fetch failed",[172,325,326],{},"Rede do lado do servidor",[172,328,329,330],{},"Ler o ",[22,331,332],{},"error.cause",[52,334,81],{"id":335},"correções-para-desenvolvedores",[15,337,338,339,342],{},"Se o erro está no seu código, a primeira regra é esta: ",[37,340,341],{},"\"Failed to fetch\" nunca é a mensagem verdadeira."," Abra o console do navegador (F12) e procure a linha logo acima ou abaixo. Ela quase sempre diz o motivo real.",[344,345,347],"h3",{"id":346},"javascript-no-navegador","JavaScript no navegador",[15,349,350],{},"Um teste resolve metade dos casos. Rode a mesma URL no terminal:",[352,353,358],"pre",{"className":354,"code":355,"language":356,"meta":357,"style":357},"language-bash shiki shiki-themes github-light","curl -I https://api.seusite.com.br/dados\n","bash","",[22,359,360],{"__ignoreMap":357},[361,362,365,369,373],"span",{"class":363,"line":364},"line",1,[361,366,368],{"class":367},"s7eDp","curl",[361,370,372],{"class":371},"sYu0t"," -I",[361,374,376],{"class":375},"sYBdl"," https://api.seusite.com.br/dados\n",[15,378,379,380,382,383,386,387,389],{},"Se o ",[22,381,368],{}," responder e o ",[22,384,385],{},"fetch"," falhar, o problema é CORS, não o servidor. O ",[22,388,368],{}," não aplica regras de CORS. O navegador aplica.",[15,391,392],{},[47,393],{"alt":394,"src":395},"Um teste resolve: curl responde, fetch falha, então o problema é CORS e não o servidor","/img/blog/failed-to-fetch-significado-e-solucao-curl.jpg",[15,397,398,399,402],{},"E CORS se resolve no servidor, não no front-end. O servidor precisa devolver o cabeçalho ",[22,400,401],{},"Access-Control-Allow-Origin"," com a origem do seu site. Se você não controla esse servidor, a saída é um proxy no seu próprio backend.",[15,404,405],{},"Um erro muito comum é tentar \"resolver\" com isto:",[352,407,411],{"className":408,"code":409,"language":410,"meta":357,"style":357},"language-js shiki shiki-themes github-light","fetch(url, { mode: 'no-cors' })\n","js",[22,412,413],{"__ignoreMap":357},[361,414,415],{"class":363,"line":364},[361,416,409],{},[15,418,419,420,423],{},"Isso não resolve. O erro some, mas a resposta volta \"opaca\": o status fica ",[22,421,422],{},"0"," e você não consegue ler o corpo. Você troca um erro visível por um bug silencioso.",[15,425,426],{},[47,427],{"alt":428,"src":429},"mode no-cors não resolve, só esconde: a resposta opaca volta com status 0 e corpo ilegível","/img/blog/failed-to-fetch-significado-e-solucao-no-cors.jpg",[15,431,432],{},"As outras causas no navegador, em ordem de frequência:",[434,435,436,442,455,465],"ul",{},[104,437,438,441],{},[37,439,440],{},"URL, porta ou DNS errados."," Um erro de digitação no domínio, a porta errada, ou o servidor local que você esqueceu de subir.",[104,443,444,447,448,450,451,454],{},[37,445,446],{},"Conteúdo misto."," Sua página está em ",[22,449,303],{}," e o fetch aponta para ",[22,452,453],{},"http://",". O navegador bloqueia sem pedir licença.",[104,456,457,460,461,464],{},[37,458,459],{},"Requisição interrompida."," Um redirecionamento (",[22,462,463],{},"window.location = ...",") ou um recarregamento logo depois do fetch cancela a requisição antes da resposta chegar.",[104,466,467,470],{},[37,468,469],{},"Certificado inválido."," Um HTTPS com certificado autoassinado ou expirado também aparece como \"Failed to fetch\".",[52,472,474],{"id":473},"nodejs-fetch-failed-não-é-failed-to-fetch","Node.js: \"fetch failed\" não é \"Failed to fetch\"",[15,476,477,478,480,481,484],{},"No Node.js a mensagem é parecida, mas o contexto é outro. Não existe CORS no Node. Se você vê ",[22,479,209],{},", o problema é de rede do lado do servidor, e o motivo real está escondido no ",[22,482,483],{},"cause",":",[352,486,488],{"className":408,"code":487,"language":410,"meta":357,"style":357},"try {\n  await fetch(url);\n} catch (err) {\n  console.error(err.cause); // o motivo verdadeiro está aqui\n}\n",[22,489,490,495,501,507,513],{"__ignoreMap":357},[361,491,492],{"class":363,"line":364},[361,493,494],{},"try {\n",[361,496,498],{"class":363,"line":497},2,[361,499,500],{},"  await fetch(url);\n",[361,502,504],{"class":363,"line":503},3,[361,505,506],{},"} catch (err) {\n",[361,508,510],{"class":363,"line":509},4,[361,511,512],{},"  console.error(err.cause); // o motivo verdadeiro está aqui\n",[361,514,516],{"class":363,"line":515},5,[361,517,518],{},"}\n",[15,520,521,522,524],{},"O que o ",[22,523,483],{}," costuma mostrar:",[151,526,527,539],{},[154,528,529],{},[157,530,531,536],{},[160,532,533],{},[22,534,535],{},"err.cause",[160,537,538],{},"Significa",[167,540,541,551,561,571],{},[157,542,543,548],{},[172,544,545],{},[22,546,547],{},"ECONNREFUSED",[172,549,550],{},"Nada está escutando naquela porta. O serviço não está rodando.",[157,552,553,558],{},[172,554,555],{},[22,556,557],{},"ENOTFOUND",[172,559,560],{},"O DNS não achou o domínio. Erro de digitação ou rede sem DNS.",[157,562,563,568],{},[172,564,565],{},[22,566,567],{},"UND_ERR_CONNECT_TIMEOUT",[172,569,570],{},"Tentou conectar e desistiu. Firewall ou servidor lento.",[157,572,573,576],{},[172,574,575],{},"Erro de certificado",[172,577,578],{},"HTTPS com certificado autoassinado ou inválido.",[15,580,581,582,585,586,589,590,593,594,596,597,599],{},"Uma pegadinha clássica: em algumas versões do Node, ",[22,583,584],{},"localhost"," resolve primeiro para o endereço IPv6 (",[22,587,588],{},"::1","). Se o seu servidor escuta só em ",[22,591,592],{},"127.0.0.1",", a conexão é recusada. Trocar ",[22,595,584],{}," por ",[22,598,592],{}," na URL resolve na hora.",[15,601,602],{},[47,603],{"alt":604,"src":605},"O motivo está no err.cause: ECONNREFUSED, ENOTFOUND e timeout, e localhost trocado por 127.0.0.1","/img/blog/failed-to-fetch-significado-e-solucao-err-cause.jpg",[52,607,609],{"id":608},"python-quando-o-backend-é-seu","Python: quando o backend é seu",[15,611,612],{},"O Python não gera \"Failed to fetch\". Mas se o seu backend é em Python (FastAPI, Flask, Django) e o seu front-end mostra esse erro, quase sempre falta configurar o CORS no servidor Python.",[15,614,615],{},[37,616,617],{},"FastAPI:",[352,619,623],{"className":620,"code":621,"language":622,"meta":357,"style":357},"language-python shiki shiki-themes github-light","from fastapi.middleware.cors import CORSMiddleware\n\napp.add_middleware(\n    CORSMiddleware,\n    allow_origins=[\"https://seusite.com.br\"],\n    allow_methods=[\"*\"],\n    allow_headers=[\"*\"],\n)\n","python",[22,624,625,641,647,652,657,675,690,704],{"__ignoreMap":357},[361,626,627,631,635,638],{"class":363,"line":364},[361,628,630],{"class":629},"sD7c4","from",[361,632,634],{"class":633},"sgsFI"," fastapi.middleware.cors ",[361,636,637],{"class":629},"import",[361,639,640],{"class":633}," CORSMiddleware\n",[361,642,643],{"class":363,"line":497},[361,644,646],{"emptyLinePlaceholder":645},true,"\n",[361,648,649],{"class":363,"line":503},[361,650,651],{"class":633},"app.add_middleware(\n",[361,653,654],{"class":363,"line":509},[361,655,656],{"class":633},"    CORSMiddleware,\n",[361,658,659,663,666,669,672],{"class":363,"line":515},[361,660,662],{"class":661},"sqxcx","    allow_origins",[361,664,665],{"class":629},"=",[361,667,668],{"class":633},"[",[361,670,671],{"class":375},"\"https://seusite.com.br\"",[361,673,674],{"class":633},"],\n",[361,676,678,681,683,685,688],{"class":363,"line":677},6,[361,679,680],{"class":661},"    allow_methods",[361,682,665],{"class":629},[361,684,668],{"class":633},[361,686,687],{"class":375},"\"*\"",[361,689,674],{"class":633},[361,691,693,696,698,700,702],{"class":363,"line":692},7,[361,694,695],{"class":661},"    allow_headers",[361,697,665],{"class":629},[361,699,668],{"class":633},[361,701,687],{"class":375},[361,703,674],{"class":633},[361,705,707],{"class":363,"line":706},8,[361,708,709],{"class":633},")\n",[15,711,712],{},[37,713,714],{},"Flask:",[352,716,718],{"className":620,"code":717,"language":622,"meta":357,"style":357},"from flask_cors import CORS\nCORS(app, origins=[\"https://seusite.com.br\"])\n",[22,719,720,732],{"__ignoreMap":357},[361,721,722,724,727,729],{"class":363,"line":364},[361,723,630],{"class":629},[361,725,726],{"class":633}," flask_cors ",[361,728,637],{"class":629},[361,730,731],{"class":371}," CORS\n",[361,733,734,737,740,742,744,746],{"class":363,"line":497},[361,735,736],{"class":633},"CORS(app, ",[361,738,739],{"class":661},"origins",[361,741,665],{"class":629},[361,743,668],{"class":633},[361,745,671],{"class":375},[361,747,748],{"class":633},"])\n",[15,750,751,752,755],{},"Um detalhe que pega muita gente: se a requisição envia credenciais (cookies), o navegador rejeita ",[22,753,754],{},"Access-Control-Allow-Origin: *",". Nesse caso, liste as origens de forma explícita, como nos exemplos acima.",[15,757,758,759,762],{},"E se o Python é o cliente, o equivalente ao \"Failed to fetch\" é a ",[22,760,761],{},"requests.exceptions.ConnectionError",". Mesmo significado: o servidor não respondeu.",[30,764,767,772,775,781],{"label":765,"type":766},"Experimente o BetterClaw","cta",[15,768,769],{},[37,770,771],{},"Você queria um agente de IA rodando, não uma tarde inteira acertando CORS.",[15,773,774],{},"Se o seu tempo está indo em CORS entre o n8n, o Ollama e a sua API, foi exatamente por isso que criamos o BetterClaw. O agente roda na nuvem, as integrações já vêm conectadas e não tem servidor seu para configurar.",[15,776,777],{},[67,778,780],{"href":779},"/free-plan","Comece grátis →",[15,782,783],{},"Plano grátis · 1 agente · 100 créditos por mês · sem cartão de crédito",[52,785,787],{"id":786},"failed-to-fetch-em-agentes-de-ia-n8n-openclaw-e-ollama","Failed to fetch em agentes de IA: n8n, OpenClaw e Ollama",[15,789,790],{},"Esse erro aparece muito em quem está montando agentes de IA com modelos locais. E quase sempre a causa é uma de três.",[344,792,794],{"id":793},"ollama-o-servidor-não-está-rodando-ou-não-está-visível","Ollama: o servidor não está rodando ou não está visível",[15,796,797,798,801],{},"O Ollama escuta por padrão na porta ",[22,799,800],{},"11434",", e só na sua própria máquina. Três situações geram o erro:",[434,803,804,814,824],{},[104,805,806,809,810,813],{},[37,807,808],{},"O Ollama não está rodando."," Rode ",[22,811,812],{},"ollama serve"," e tente de novo. Se a porta responder, o problema era só esse.",[104,815,816,819,820,823],{},[37,817,818],{},"Você está acessando de outra máquina ou de um container."," Por padrão o Ollama só aceita conexões locais. Defina ",[22,821,822],{},"OLLAMA_HOST=0.0.0.0"," antes de iniciar para ele escutar em todas as interfaces.",[104,825,826,829,830,25],{},[37,827,828],{},"Um front-end no navegador chama o Ollama direto."," Aí é CORS de novo. O Ollama aceita origens extras pela variável ",[22,831,832],{},"OLLAMA_ORIGINS",[344,834,836],{"id":835},"n8n-no-docker-o-localhost-que-não-é-o-seu","n8n no Docker: o localhost que não é o seu",[15,838,839,840,843,844,846],{},"Esse é o mais traiçoeiro. Se o n8n roda num container Docker e você configura o Ollama como ",[22,841,842],{},"http://localhost:11434",", o ",[22,845,584],{}," ali dentro é o próprio container, não o seu computador. Por isso a conexão falha mesmo com o Ollama funcionando perfeitamente.",[15,848,849],{},"A correção é trocar o endereço por:",[352,851,856],{"className":852,"code":854,"language":855},[853],"language-text","http://host.docker.internal:11434\n","text",[22,857,854],{"__ignoreMap":357},[15,859,860,861,864],{},"Isso funciona direto no Docker Desktop (Windows e Mac). No Linux, adicione ",[22,862,863],{},"--add-host=host.docker.internal:host-gateway"," ao iniciar o container.",[15,866,867],{},[47,868],{"alt":869,"src":870},"Localhost errado: dentro do container do n8n, localhost aponta para o próprio container; use host.docker.internal","/img/blog/failed-to-fetch-significado-e-solucao-docker-localhost.jpg",[344,872,874],{"id":873},"openclaw","OpenClaw",[15,876,877,878,882,883,25],{},"No OpenClaw, o \"fetch failed\" quase sempre aponta para o endpoint do modelo, geralmente um Ollama que não está acessível. Temos um guia só com as variações desse erro em ",[67,879,881],{"href":880},"/blog/openclaw-ollama-fetch-failed","OpenClaw Ollama fetch failed",", e um passo a passo para ",[67,884,886],{"href":885},"/blog/ollama-fetch-failed-connection-refused-fix","conexão recusada e timeout no Ollama",[52,888,890],{"id":889},"ainda-com-erro","Ainda com erro?",[15,892,893,894,898],{},"Se você passou por tudo e o erro continua, cole a mensagem exata no nosso ",[67,895,897],{"href":896},"/tools/agent-error-decoder","decodificador de erros do OpenClaw",". Ele mostra a causa provável e a correção para as variações mais comuns.",[15,900,901,902,904],{},"E um último conselho, que vale mais que qualquer comando desta página: \"Failed to fetch\" não é um diagnóstico, é um sintoma. É o navegador dizendo \"não ouvi resposta\" sem saber o porquê. A pista verdadeira quase sempre está uma linha acima no console, e o ",[22,903,368],{}," separa em segundos um problema de rede de um problema de CORS.",[15,906,907],{},"Para quem não programa, a lição é ainda mais simples. Se funcionou em outra aba, em outra rede ou em outro aparelho, você não quebrou nada.",[15,909,910,911,914,915,25],{},"Se você chegou até aqui porque estava montando um agente de IA e passou mais tempo brigando com rede do que construindo o agente, experimente o BetterClaw. O plano grátis tem 1 agente e 100 créditos por mês, sem cartão de crédito e sem prazo para acabar, e você usa sua própria chave de API. Quando precisar de mais, o Pro custa US$ 49 por mês, cobrado em dólar. ",[67,912,913],{"href":779},"Comece grátis"," ou veja os ",[67,916,918],{"href":917},"/pricing","detalhes dos planos",[52,920,922],{"id":921},"perguntas-frequentes","Perguntas frequentes",[15,924,925],{},[37,926,927],{},"O que significa \"Failed to fetch\"?",[15,929,930],{},"Significa \"falha ao buscar\": o navegador tentou buscar dados num servidor e não recebeu nenhuma resposta. Não é um erro 404 ou 500, porque nesses casos o servidor chegou a responder. As causas mais comuns são bloqueio de CORS, servidor fora do ar, URL errada, página HTTPS chamando HTTP ou uma extensão bloqueando a requisição.",[15,932,933],{},[37,934,935],{},"Qual a diferença entre \"Failed to fetch\" e \"fetch failed\"?",[15,937,938,939,941,942,944,945,25],{},"\"Failed to fetch\" vem do navegador (Chrome, Edge) e muitas vezes é CORS. \"fetch failed\" vem do Node.js, onde CORS nem existe, e significa um problema de rede do lado do servidor. No Node, leia o ",[22,940,535],{}," para ver o motivo real, como ",[22,943,547],{}," ou ",[22,946,557],{},[15,948,949],{},[37,950,951],{},"Como resolver \"Failed to fetch\" no celular?",[15,953,954],{},"Feche o app por completo e abra de novo, depois troque entre Wi-Fi e dados móveis para descartar a rede. Se tiver VPN ou bloqueador de anúncios ativo, desligue por um minuto e teste. Se o erro aparece em qualquer rede, provavelmente o serviço está fora do ar e basta esperar.",[15,956,957],{},[37,958,959],{},"Vale a pena usar mode: 'no-cors' para resolver?",[15,961,962,963,966,967,969],{},"Não. Com ",[22,964,965],{},"no-cors"," o erro some da tela, mas a resposta volta \"opaca\": status 0 e corpo ilegível pelo seu código. Você troca um erro visível por um bug silencioso. A correção de verdade é o servidor enviar o cabeçalho ",[22,968,401],{}," com a origem do seu site.",[15,971,972],{},[37,973,974],{},"\"Failed to fetch\" é vírus ou sinal de que fui hackeado?",[15,976,977],{},"Não. É uma mensagem técnica comum que só indica que uma requisição não recebeu resposta. Não tem relação com vírus nem com invasão. Na maioria das vezes a causa é uma extensão do navegador, a rede que você está usando ou o próprio serviço fora do ar.",[979,980,981],"style",{},"html pre.shiki code .s7eDp, html code.shiki .s7eDp{--shiki-default:#6F42C1}html pre.shiki code .sYu0t, html code.shiki .sYu0t{--shiki-default:#005CC5}html pre.shiki code .sYBdl, html code.shiki .sYBdl{--shiki-default:#032F62}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sD7c4, html code.shiki .sD7c4{--shiki-default:#D73A49}html pre.shiki code .sgsFI, html code.shiki .sgsFI{--shiki-default:#24292E}html pre.shiki code .sqxcx, html code.shiki .sqxcx{--shiki-default:#E36209}",{"title":357,"searchDepth":497,"depth":497,"links":983},[984,985,986,987,988,991,992,993,998,999],{"id":54,"depth":497,"text":55},{"id":95,"depth":497,"text":96},{"id":145,"depth":497,"text":146},{"id":219,"depth":497,"text":220},{"id":335,"depth":497,"text":81,"children":989},[990],{"id":346,"depth":503,"text":347},{"id":473,"depth":497,"text":474},{"id":608,"depth":497,"text":609},{"id":786,"depth":497,"text":787,"children":994},[995,996,997],{"id":793,"depth":503,"text":794},{"id":835,"depth":503,"text":836},{"id":873,"depth":503,"text":874},{"id":889,"depth":497,"text":890},{"id":921,"depth":497,"text":922},"Troubleshooting","2026-09-22","Apareceu \"Failed to fetch\" no app, site ou código? Não é vírus nem problema seu. O que significa em português e como resolver em 2 minutos.","md",false,"/img/blog/failed-to-fetch-significado-e-solucao.jpg","Failed to Fetch: o que significa e como resolver no app, no site ou no código",512,1024,"pt-BR",{},"/blog/failed-to-fetch-significado-e-solucao","8 min de leitura",[1014,1015,1016],"openclaw-ollama-fetch-failed","ollama-fetch-failed-connection-refused-fix","openclaw-dns-lookup-failed",{"title":5,"description":1002},"Failed to Fetch: O Que Significa e Como Resolver (2026)","blog/failed-to-fetch-significado-e-solucao",[1021,1022,1023,1024,1025,1026,1027,1028],"failed to fetch o que significa","failed to fetch como resolver","erro failed to fetch","typeerror failed to fetch","failed to fetch tradução","fetch failed node","failed to fetch cors","load failed safari",null,"m5VsW0gyAv-Gdg4m8K5ytjl0pvFcy5aLxUuonzRnx2o",[1032,3840,4550],{"id":1033,"title":1034,"author":1035,"body":1036,"category":3821,"date":3822,"description":3823,"extension":1003,"featured":1004,"hideToc":1004,"image":3824,"imageAlt":1029,"imageHeight":1007,"imageWidth":1008,"lang":1029,"meta":3825,"navigation":645,"path":885,"readingTime":3826,"redirected":1004,"relatedSlugs":1029,"seo":3827,"seoTitle":3828,"stem":3829,"tags":3830,"updatedDate":1001,"__hash__":3839},"blog/blog/ollama-fetch-failed-connection-refused-fix.md","Ollama Fetch Failed, Connection Refused, \"Could Not Connect\": Every Fix (Updated Sept 2026)",{"name":7,"role":8,"avatar":9},{"type":12,"value":1037,"toc":3763},[1038,1043,1064,1067,1081,1084,1087,1091,1094,1403,1409,1413,1416,1467,1525,1531,1535,1539,1551,1557,1562,1638,1643,1664,1670,1674,1678,1685,1696,1700,1805,1818,1824,1858,1868,1897,1906,1910,1915,1919,1988,1993,1996,2028,2034,2038,2046,2055,2066,2071,2074,2080,2086,2109,2138,2150,2155,2167,2173,2177,2182,2187,2198,2204,2213,2217,2224,2229,2233,2281,2293,2297,2302,2307,2311,2387,2394,2411,2424,2430,2434,2438,2450,2458,2462,2531,2534,2556,2560,2571,2579,2583,2595,2638,2656,2681,2685,2697,2785,2800,2806,2810,2814,2829,2838,2853,2858,2906,2912,2916,2920,2926,2929,2940,2946,2972,2985,2989,2993,2999,3040,3057,3061,3065,3068,3071,3077,3097,3101,3105,3108,3144,3154,3158,3162,3165,3185,3192,3234,3242,3246,3250,3253,3323,3329,3336,3340,3344,3352,3392,3401,3405,3409,3417,3489,3493,3524,3528,3532,3535,3565,3570,3574,3577,3580,3586,3590,3595,3602,3607,3614,3619,3626,3631,3637,3642,3658,3663,3679,3684,3695,3700,3735,3740,3743,3760],[15,1039,1040],{},[37,1041,1042],{},"Your agent framework says it can't reach Ollama. The model was running five minutes ago. Now it's \"connection refused.\" Below are 15 fixes, plus the Windows, browser and crash variants, each under the exact error message you're seeing, with a copy-paste fix for each.",[30,1044,1045,1050,1053,1061],{"type":766},[15,1046,1047],{},[37,1048,1049],{},"Skip the Ollama connection debugging.",[15,1051,1052],{},"Connect your model by API or your own endpoint and let BetterClaw handle the plumbing. BYOK across 28+ providers, zero markup. Free forever, not a trial.",[15,1054,1055],{},[67,1056,1060],{"href":1057,"rel":1058},"https://app.betterclaw.io/sign-in",[1059],"nofollow","Start free →",[15,1062,1063],{},"No credit card · No Docker networking · No port binding",[15,1065,1066],{},"It was 11 PM. The agent had been running fine all day. Qwen3.8 27B on Ollama, classifying emails, posting digests to Slack. Solid.",[15,1068,1069,1070,1072,1073,1076,1077,1080],{},"Then the Slack digest didn't arrive. I checked the agent logs. Error: ",[22,1071,323],{},". Checked Ollama. ",[22,1074,1075],{},"curl localhost:11434"," said connection refused. ",[22,1078,1079],{},"ollama ps"," said \"could not connect to ollama app\". The server had silently died because my laptop went to sleep for ten minutes and Ollama didn't recover on wake.",[15,1082,1083],{},"This is the most frustrating class of agent errors because everything looks right. The model is pulled. The config is correct. It was working an hour ago. And now... connection refused.",[15,1085,1086],{},"Here's every Ollama fetch failed and connection error variant, why it happens, and the copy-paste fix. Bookmark this page. You'll be back.",[52,1088,1090],{"id":1089},"find-your-error","Find your error",[15,1092,1093],{},"Search this table for the message you're seeing (Ctrl+F works), then jump to its fix.",[151,1095,1096,1106],{},[154,1097,1098],{},[157,1099,1100,1103],{},[160,1101,1102],{},"Error you see",[160,1104,1105],{},"Cause, and where to fix it",[167,1107,1108,1127,1143,1159,1173,1186,1198,1213,1225,1237,1249,1261,1275,1287,1301,1315,1330,1344,1361,1375,1389],{},[157,1109,1110,1119],{},[172,1111,1112,1115,1116],{},[22,1113,1114],{},"could not connect to ollama app"," / ",[22,1117,1118],{},"ollama server",[172,1120,1121,1122,1126],{},"Server not running. ",[67,1123,1125],{"href":1124},"#fix-10-could-not-connect-to-ollama-app","Fix 10",": start the app or the service",[157,1128,1129,1135],{},[172,1130,1131,1115,1133],{},[22,1132,323],{},[22,1134,547],{},[172,1136,1137,1138,1142],{},"Ollama not running. ",[67,1139,1141],{"href":1140},"#fix-1-ollama-service-isnt-running-the-1-cause","Fix 1",": restart the app or service",[157,1144,1145,1151],{},[172,1146,1147,1150],{},[22,1148,1149],{},"connection refused"," from Docker, works in terminal",[172,1152,1153,1154,1158],{},"Ollama listens on 127.0.0.1 only. ",[67,1155,1157],{"href":1156},"#fix-2-ollama-is-running-but-bound-to-the-wrong-address","Fix 2",": bind to 0.0.0.0",[157,1160,1161,1166],{},[172,1162,1163,1165],{},[22,1164,1149],{}," (Docker)",[172,1167,1168,1169],{},"App uses localhost inside a container. ",[67,1170,1172],{"href":1171},"#fix-4-agent-is-using-the-wrong-url-docker-networking","Fix 4",[157,1174,1175,1180],{},[172,1176,1177],{},[22,1178,1179],{},"('172.17.0.1', 11434)",[172,1181,1153,1182],{},[67,1183,1185],{"href":1184},"#fix-12-python-cannot-connect-to-host-localhost11434-ssldefault","Fix 12",[157,1187,1188,1193],{},[172,1189,1190],{},[22,1191,1192],{},"Cannot connect to host ... ssl:default",[172,1194,1195,1196],{},"Server down, or the container can't reach the host. ",[67,1197,1185],{"href":1184},[157,1199,1200,1205],{},[172,1201,1202],{},[22,1203,1204],{},"bind: address already in use",[172,1206,1207,1208,1212],{},"Ollama is already running. ",[67,1209,1211],{"href":1210},"#fix-11-bind-address-already-in-use-on-11434","Fix 11",": use it",[157,1214,1215,1218],{},[172,1216,1217],{},"port blocked by firewall",[172,1219,1220,1221],{},"Firewall on 11434. ",[67,1222,1224],{"href":1223},"#fix-3-port-11434-is-blocked-or-in-use","Fix 3",[157,1226,1227,1230],{},[172,1228,1229],{},"SSL/TLS error",[172,1231,1232,1233],{},"HTTPS instead of HTTP. ",[67,1234,1236],{"href":1235},"#fix-5-https-vs-http-mismatch","Fix 5",[157,1238,1239,1242],{},[172,1240,1241],{},"timeout on load",[172,1243,1244,1245],{},"Model too large for memory. ",[67,1246,1248],{"href":1247},"#fix-6-model-too-large-for-available-memory-silent-oom","Fix 6",[157,1250,1251,1254],{},[172,1252,1253],{},"timeout after a few messages",[172,1255,1256,1257],{},"Context window overflow. ",[67,1258,1260],{"href":1259},"#fix-7-context-window-overflow-causes-timeout","Fix 7",[157,1262,1263,1268],{},[172,1264,1265],{},[22,1266,1267],{},"model not found",[172,1269,1270,1271],{},"Wrong tag or outdated Ollama. ",[67,1272,1274],{"href":1273},"#fix-8-ollama-version-mismatch-model-not-found","Fix 8",[157,1276,1277,1280],{},[172,1278,1279],{},"Hermes/OpenClaw can't connect",[172,1281,1282,1283],{},"Wrong base URL. Hermes needs /v1, OpenClaw must not have it. ",[67,1284,1286],{"href":1285},"#fix-9-hermesopenclaw-specific-connection-issues","Fix 9",[157,1288,1289,1294],{},[172,1290,1291],{},[22,1292,1293],{},"Problem in node 'AI Agent': fetch failed",[172,1295,1296,1297],{},"n8n points at the wrong host. ",[67,1298,1300],{"href":1299},"#fix-13-n8n-fetch-failed-econnrefused","Fix 13",[157,1302,1303,1308],{},[172,1304,1305,1306],{},"VS Code ",[22,1307,323],{},[172,1309,1310,1311],{},"Extension runs remotely or uses the wrong endpoint. ",[67,1312,1314],{"href":1313},"#fix-14-vs-code-ollama-fetch-failed","Fix 14",[157,1316,1317,1323],{},[172,1318,1319,1320],{},"Claude Code ",[22,1321,1322],{},"Connection refused",[172,1324,1325,1326],{},"Server down or wrong base URL. ",[67,1327,1329],{"href":1328},"#fix-15-claude-code-connection-refused","Fix 15",[157,1331,1332,1337],{},[172,1333,1334],{},[22,1335,1336],{},"target machine actively refused it",[172,1338,1339,1340],{},"Windows, server not running. ",[67,1341,1343],{"href":1342},"#windows-target-machine-actively-refused-it","Windows",[157,1345,1346,1354],{},[172,1347,1348,1115,1351,1353],{},[22,1349,1350],{},"NetworkError",[22,1352,24],{}," (browser)",[172,1355,1356,1357],{},"CORS. ",[67,1358,1360],{"href":1359},"#browser-apps-and-extensions-networkerror-failed-to-fetch","Browser apps",[157,1362,1363,1368],{},[172,1364,1365],{},[22,1366,1367],{},"POST .../api/generate: EOF",[172,1369,1370,1371],{},"Runner crashed, usually out of memory. ",[67,1372,1374],{"href":1373},"#runner-crashed-post-apigenerate-eof-or-server-disconnected","EOF",[157,1376,1377,1382],{},[172,1378,1379],{},[22,1380,1381],{},"Engine protocol predict request failed",[172,1383,1384,1385],{},"That's LM Studio, not Ollama. ",[67,1386,1388],{"href":1387},"#not-actually-ollama","Not Ollama?",[157,1390,1391,1397],{},[172,1392,1393,1396],{},[22,1394,1395],{},"Verification failed: fetch failed"," (OpenClaw)",[172,1398,1399,1400],{},"OpenClaw can't reach Ollama during setup. ",[67,1401,874],{"href":1402},"#openclaw-verification-failed-fetch-failed",[15,1404,1405],{},[47,1406],{"alt":1407,"src":1408},"Find your error: lookup cards pairing each Ollama error message with the fix number that solves it","/img/blog/ollama-fetch-failed-connection-refused-fix-find-your-error.jpg",[52,1410,1412],{"id":1411},"the-30-second-diagnostic-run-this-first","The 30-second diagnostic (run this first)",[15,1414,1415],{},"Before trying fifteen different fixes, run these three commands:",[352,1417,1419],{"className":354,"code":1418,"language":356,"meta":357,"style":357},"# 1. Is the server up? (the real test)\ncurl http://localhost:11434/api/version\n\n# 2. Which models are downloaded?\nollama list\n\n# 3. Which models are loaded in memory right now? (empty is fine)\nollama ps\n",[22,1420,1421,1427,1434,1438,1443,1451,1455,1460],{"__ignoreMap":357},[361,1422,1423],{"class":363,"line":364},[361,1424,1426],{"class":1425},"sAwPA","# 1. Is the server up? (the real test)\n",[361,1428,1429,1431],{"class":363,"line":497},[361,1430,368],{"class":367},[361,1432,1433],{"class":375}," http://localhost:11434/api/version\n",[361,1435,1436],{"class":363,"line":503},[361,1437,646],{"emptyLinePlaceholder":645},[361,1439,1440],{"class":363,"line":509},[361,1441,1442],{"class":1425},"# 2. Which models are downloaded?\n",[361,1444,1445,1448],{"class":363,"line":515},[361,1446,1447],{"class":367},"ollama",[361,1449,1450],{"class":375}," list\n",[361,1452,1453],{"class":363,"line":677},[361,1454,646],{"emptyLinePlaceholder":645},[361,1456,1457],{"class":363,"line":692},[361,1458,1459],{"class":1425},"# 3. Which models are loaded in memory right now? (empty is fine)\n",[361,1461,1462,1464],{"class":363,"line":706},[361,1463,1447],{"class":367},[361,1465,1466],{"class":375}," ps\n",[434,1468,1469,1477,1499,1504,1517],{},[104,1470,1471,1472,1474,1475,25],{},"If ",[22,1473,368],{}," says \"connection refused\": the server isn't running or isn't listening where you think. Go to ",[67,1476,1141],{"href":1140},[104,1478,1471,1479,1481,1482,1484,1485,1487,1488,1491,1492,1491,1495,1498],{},[22,1480,368],{}," works in your terminal but not in your app: the app is looking at a different ",[22,1483,584],{},". Go to ",[67,1486,1172],{"href":1171}," (Docker) or the app sections (",[67,1489,1490],{"href":1299},"n8n",", ",[67,1493,1494],{"href":1313},"VS Code",[67,1496,1497],{"href":1328},"Claude Code",").",[104,1500,1471,1501,1503],{},[22,1502,1079],{}," shows an empty table: nothing is wrong. It only lists models loaded in memory, and the model loads on the first request.",[104,1505,1471,1506,1508,1509,1511,1512,1514,1515,25],{},[22,1507,1079],{}," prints ",[22,1510,1114],{}," (or ",[22,1513,1118],{}," on newer versions): that's a down server, not a model problem. Go to ",[67,1516,1125],{"href":1124},[104,1518,1519,1520,1522,1523,25],{},"If everything connects but it's slow or timing out: go to ",[67,1521,1248],{"href":1247}," or ",[67,1524,1260],{"href":1259},[15,1526,1527],{},[47,1528],{"alt":1529,"src":1530},"The 30-second diagnostic: curl the version endpoint to test the server, ollama list for downloaded models, ollama ps for loaded models, with an empty ollama ps table marked as normal","/img/blog/ollama-fetch-failed-connection-refused-fix-diagnostic.jpg",[52,1532,1534],{"id":1533},"fix-1-ollama-service-isnt-running-the-1-cause","Fix 1: Ollama service isn't running (the #1 cause)",[344,1536,1538],{"id":1537},"fetch-failed-econnrefused-12700111434","\"fetch failed\" / \"ECONNREFUSED 127.0.0.1:11434\"",[15,1540,1541,1544,1545,1547,1548,1550],{},[37,1542,1543],{},"Symptoms:"," ",[22,1546,1075],{}," returns \"connection refused.\" Your agent logs show \"fetch failed\" or \"ECONNREFUSED.\" ",[22,1549,1079],{}," prints \"could not connect to ollama app.\"",[15,1552,1553,1556],{},[37,1554,1555],{},"Why it happens:"," Ollama crashed, was never started, or died after laptop sleep/restart. On macOS, the Ollama app might have quit. On Linux, the systemd service might have failed.",[15,1558,1559],{},[37,1560,1561],{},"Copy-paste fix:",[352,1563,1565],{"className":354,"code":1564,"language":356,"meta":357,"style":357},"# macOS: Relaunch the Ollama app\n# Or from terminal:\nollama serve &\n\n# Linux: Restart the service\nsudo systemctl restart ollama\nsudo systemctl status ollama\n\n# Verify it's running\ncurl http://localhost:11434/api/version\n",[22,1566,1567,1572,1577,1587,1591,1596,1610,1621,1625,1631],{"__ignoreMap":357},[361,1568,1569],{"class":363,"line":364},[361,1570,1571],{"class":1425},"# macOS: Relaunch the Ollama app\n",[361,1573,1574],{"class":363,"line":497},[361,1575,1576],{"class":1425},"# Or from terminal:\n",[361,1578,1579,1581,1584],{"class":363,"line":503},[361,1580,1447],{"class":367},[361,1582,1583],{"class":375}," serve",[361,1585,1586],{"class":633}," &\n",[361,1588,1589],{"class":363,"line":509},[361,1590,646],{"emptyLinePlaceholder":645},[361,1592,1593],{"class":363,"line":515},[361,1594,1595],{"class":1425},"# Linux: Restart the service\n",[361,1597,1598,1601,1604,1607],{"class":363,"line":677},[361,1599,1600],{"class":367},"sudo",[361,1602,1603],{"class":375}," systemctl",[361,1605,1606],{"class":375}," restart",[361,1608,1609],{"class":375}," ollama\n",[361,1611,1612,1614,1616,1619],{"class":363,"line":692},[361,1613,1600],{"class":367},[361,1615,1603],{"class":375},[361,1617,1618],{"class":375}," status",[361,1620,1609],{"class":375},[361,1622,1623],{"class":363,"line":706},[361,1624,646],{"emptyLinePlaceholder":645},[361,1626,1628],{"class":363,"line":1627},9,[361,1629,1630],{"class":1425},"# Verify it's running\n",[361,1632,1634,1636],{"class":363,"line":1633},10,[361,1635,368],{"class":367},[361,1637,1433],{"class":375},[15,1639,1640],{},[37,1641,1642],{},"Make it permanent (Linux):",[352,1644,1646],{"className":354,"code":1645,"language":356,"meta":357,"style":357},"# Enable auto-start on boot\nsudo systemctl enable ollama\n",[22,1647,1648,1653],{"__ignoreMap":357},[361,1649,1650],{"class":363,"line":364},[361,1651,1652],{"class":1425},"# Enable auto-start on boot\n",[361,1654,1655,1657,1659,1662],{"class":363,"line":497},[361,1656,1600],{"class":367},[361,1658,1603],{"class":375},[361,1660,1661],{"class":375}," enable",[361,1663,1609],{"class":375},[15,1665,1666,1667,25],{},"On macOS, add Ollama to Login Items (System Settings → General → Login Items) so it starts automatically. On Windows, see the ",[67,1668,1669],{"href":1342},"Windows section",[52,1671,1673],{"id":1672},"fix-2-ollama-is-running-but-bound-to-the-wrong-address","Fix 2: Ollama is running but bound to the wrong address",[344,1675,1677],{"id":1676},"connection-refused-from-docker-or-another-machine","\"connection refused\" from Docker or another machine",[15,1679,1680,1544,1682,1684],{},[37,1681,1543],{},[22,1683,1075],{}," works on the machine itself, but your agent (running in Docker, WSL or on another machine) gets \"connection refused.\"",[15,1686,1687,1689,1690,1693,1694,25],{},[37,1688,1555],{}," By default, Ollama binds to ",[22,1691,1692],{},"127.0.0.1:11434",". This means only processes on the same machine can connect. If your agent runs in Docker, a VM, or a different machine, it can't reach ",[22,1695,592],{},[15,1697,1698],{},[37,1699,1561],{},[352,1701,1703],{"className":354,"code":1702,"language":356,"meta":357,"style":357},"# Linux: Set Ollama to listen on all interfaces\nsudo systemctl edit ollama\n\n# Add these lines:\n[Service]\nEnvironment=\"OLLAMA_HOST=0.0.0.0:11434\"\n\n# Restart\nsudo systemctl daemon-reload\nsudo systemctl restart ollama\n\n# macOS: Set the environment variable\nlaunchctl setenv OLLAMA_HOST \"0.0.0.0:11434\"\n# Then quit and reopen the Ollama app\n",[22,1704,1705,1710,1721,1725,1730,1735,1745,1749,1754,1763,1773,1778,1784,1799],{"__ignoreMap":357},[361,1706,1707],{"class":363,"line":364},[361,1708,1709],{"class":1425},"# Linux: Set Ollama to listen on all interfaces\n",[361,1711,1712,1714,1716,1719],{"class":363,"line":497},[361,1713,1600],{"class":367},[361,1715,1603],{"class":375},[361,1717,1718],{"class":375}," edit",[361,1720,1609],{"class":375},[361,1722,1723],{"class":363,"line":503},[361,1724,646],{"emptyLinePlaceholder":645},[361,1726,1727],{"class":363,"line":509},[361,1728,1729],{"class":1425},"# Add these lines:\n",[361,1731,1732],{"class":363,"line":515},[361,1733,1734],{"class":633},"[Service]\n",[361,1736,1737,1740,1742],{"class":363,"line":677},[361,1738,1739],{"class":633},"Environment",[361,1741,665],{"class":629},[361,1743,1744],{"class":375},"\"OLLAMA_HOST=0.0.0.0:11434\"\n",[361,1746,1747],{"class":363,"line":692},[361,1748,646],{"emptyLinePlaceholder":645},[361,1750,1751],{"class":363,"line":706},[361,1752,1753],{"class":1425},"# Restart\n",[361,1755,1756,1758,1760],{"class":363,"line":1627},[361,1757,1600],{"class":367},[361,1759,1603],{"class":375},[361,1761,1762],{"class":375}," daemon-reload\n",[361,1764,1765,1767,1769,1771],{"class":363,"line":1633},[361,1766,1600],{"class":367},[361,1768,1603],{"class":375},[361,1770,1606],{"class":375},[361,1772,1609],{"class":375},[361,1774,1776],{"class":363,"line":1775},11,[361,1777,646],{"emptyLinePlaceholder":645},[361,1779,1781],{"class":363,"line":1780},12,[361,1782,1783],{"class":1425},"# macOS: Set the environment variable\n",[361,1785,1787,1790,1793,1796],{"class":363,"line":1786},13,[361,1788,1789],{"class":367},"launchctl",[361,1791,1792],{"class":375}," setenv",[361,1794,1795],{"class":375}," OLLAMA_HOST",[361,1797,1798],{"class":375}," \"0.0.0.0:11434\"\n",[361,1800,1802],{"class":363,"line":1801},14,[361,1803,1804],{"class":1425},"# Then quit and reopen the Ollama app\n",[15,1806,1807,1544,1810,1813,1814,1817],{},[37,1808,1809],{},"Security warning:",[22,1811,1812],{},"0.0.0.0"," exposes Ollama's API, which has no authentication, to your whole network, and to the internet on a VPS with an open port. Only do this behind a firewall, or bind to the default Docker bridge IP (usually ",[22,1815,1816],{},"172.17.0.1:11434",") instead so only containers can reach it.",[15,1819,1820,1823],{},[37,1821,1822],{},"Verify from inside the container,"," because testing from the host proves nothing about Docker:",[352,1825,1827],{"className":354,"code":1826,"language":356,"meta":357,"style":357},"docker exec -it \u003Ccontainer> curl http://host.docker.internal:11434/api/tags\n",[22,1828,1829],{"__ignoreMap":357},[361,1830,1831,1834,1837,1840,1843,1846,1849,1852,1855],{"class":363,"line":364},[361,1832,1833],{"class":367},"docker",[361,1835,1836],{"class":375}," exec",[361,1838,1839],{"class":371}," -it",[361,1841,1842],{"class":629}," \u003C",[361,1844,1845],{"class":375},"containe",[361,1847,1848],{"class":633},"r",[361,1850,1851],{"class":629},">",[361,1853,1854],{"class":375}," curl",[361,1856,1857],{"class":375}," http://host.docker.internal:11434/api/tags\n",[15,1859,1860,1861,1863,1864,1867],{},"If the container image has no ",[22,1862,368],{},", use ",[22,1865,1866],{},"wget"," instead:",[352,1869,1871],{"className":354,"code":1870,"language":356,"meta":357,"style":357},"docker exec -it \u003Ccontainer> wget -qO- http://host.docker.internal:11434/api/tags\n",[22,1872,1873],{"__ignoreMap":357},[361,1874,1875,1877,1879,1881,1883,1885,1887,1889,1892,1895],{"class":363,"line":364},[361,1876,1833],{"class":367},[361,1878,1836],{"class":375},[361,1880,1839],{"class":371},[361,1882,1842],{"class":629},[361,1884,1845],{"class":375},[361,1886,1848],{"class":633},[361,1888,1851],{"class":629},[361,1890,1891],{"class":375}," wget",[361,1893,1894],{"class":371}," -qO-",[361,1896,1857],{"class":375},[15,1898,1899,1900,1902,1903,1905],{},"The single most common reason agents in Docker can't reach Ollama: the server is bound to ",[22,1901,592],{}," (localhost only). Agents in Docker need Ollama on ",[22,1904,1812],{}," or the bridge IP.",[52,1907,1909],{"id":1908},"fix-3-port-11434-is-blocked-or-in-use","Fix 3: Port 11434 is blocked or in use",[15,1911,1912,1914],{},[37,1913,1543],{}," Ollama starts but other machines can't reach it, or another process is sitting on port 11434.",[15,1916,1917],{},[37,1918,1561],{},[352,1920,1922],{"className":354,"code":1921,"language":356,"meta":357,"style":357},"# Check what's using port 11434\nlsof -i :11434   # macOS/Linux\nss -tlnp | grep 11434   # Linux\n\n# If a process that is NOT Ollama holds it, move Ollama to another port\nOLLAMA_HOST=127.0.0.1:11435 ollama serve\n",[22,1923,1924,1929,1943,1963,1967,1972],{"__ignoreMap":357},[361,1925,1926],{"class":363,"line":364},[361,1927,1928],{"class":1425},"# Check what's using port 11434\n",[361,1930,1931,1934,1937,1940],{"class":363,"line":497},[361,1932,1933],{"class":367},"lsof",[361,1935,1936],{"class":371}," -i",[361,1938,1939],{"class":375}," :11434",[361,1941,1942],{"class":1425},"   # macOS/Linux\n",[361,1944,1945,1948,1951,1954,1957,1960],{"class":363,"line":503},[361,1946,1947],{"class":367},"ss",[361,1949,1950],{"class":371}," -tlnp",[361,1952,1953],{"class":629}," |",[361,1955,1956],{"class":367}," grep",[361,1958,1959],{"class":371}," 11434",[361,1961,1962],{"class":1425},"   # Linux\n",[361,1964,1965],{"class":363,"line":509},[361,1966,646],{"emptyLinePlaceholder":645},[361,1968,1969],{"class":363,"line":515},[361,1970,1971],{"class":1425},"# If a process that is NOT Ollama holds it, move Ollama to another port\n",[361,1973,1974,1977,1979,1982,1985],{"class":363,"line":677},[361,1975,1976],{"class":633},"OLLAMA_HOST",[361,1978,665],{"class":629},[361,1980,1981],{"class":375},"127.0.0.1:11435",[361,1983,1984],{"class":367}," ollama",[361,1986,1987],{"class":375}," serve\n",[15,1989,1990,1991,25],{},"If the process on 11434 is Ollama itself, nothing is wrong. See ",[67,1992,1211],{"href":1210},[15,1994,1995],{},"If a firewall is blocking the port:",[352,1997,1999],{"className":354,"code":1998,"language":356,"meta":357,"style":357},"# Linux (ufw)\nsudo ufw allow 11434/tcp\n\n# macOS: System Settings → Network → Firewall\n",[22,2000,2001,2006,2019,2023],{"__ignoreMap":357},[361,2002,2003],{"class":363,"line":364},[361,2004,2005],{"class":1425},"# Linux (ufw)\n",[361,2007,2008,2010,2013,2016],{"class":363,"line":497},[361,2009,1600],{"class":367},[361,2011,2012],{"class":375}," ufw",[361,2014,2015],{"class":375}," allow",[361,2017,2018],{"class":375}," 11434/tcp\n",[361,2020,2021],{"class":363,"line":503},[361,2022,646],{"emptyLinePlaceholder":645},[361,2024,2025],{"class":363,"line":509},[361,2026,2027],{"class":1425},"# macOS: System Settings → Network → Firewall\n",[15,2029,2030],{},[47,2031],{"alt":2032,"src":2033},"Fixes 1 to 3, the server side: nothing is listening, listening on 127.0.0.1 only, or the port is blocked or held by another app, each with its copy-paste command","/img/blog/ollama-fetch-failed-connection-refused-fix-crime-scenes.jpg",[52,2035,2037],{"id":2036},"fix-4-agent-is-using-the-wrong-url-docker-networking","Fix 4: Agent is using the wrong URL (Docker networking)",[344,2039,2041,2042,2045],{"id":2040},"fetch-failed-in-the-app-but-ollama-run-works","\"fetch failed\" in the app, but ",[22,2043,2044],{},"ollama run"," works",[15,2047,2048,2050,2051,2054],{},[37,2049,1543],{}," Ollama works fine in terminal (",[22,2052,2053],{},"ollama run qwen3.8:27b"," works). But your agent framework (OpenClaw, Hermes, n8n) returns \"fetch failed\" or \"connection refused.\"",[15,2056,2057,2059,2060,2062,2063,2065],{},[37,2058,1555],{}," Your agent is pointing to ",[22,2061,842],{}," but it's running inside Docker. Inside Docker, ",[22,2064,584],{}," means the container itself, not your host machine.",[15,2067,2068],{},[37,2069,2070],{},"Copy-paste fix by framework:",[15,2072,2073],{},"OpenAI-compatible clients (Hermes and most agent frameworks) running in Docker:",[352,2075,2078],{"className":2076,"code":2077,"language":855,"meta":357},[853],"http://host.docker.internal:11434/v1\n",[22,2079,2077],{"__ignoreMap":357},[15,2081,2082,2085],{},[22,2083,2084],{},"host.docker.internal"," resolves to the host machine from inside a Docker container. Works on macOS and Windows Docker Desktop. On Linux, add it yourself:",[352,2087,2089],{"className":354,"code":2088,"language":356,"meta":357,"style":357},"# docker run\ndocker run --add-host=host.docker.internal:host-gateway ...\n",[22,2090,2091,2096],{"__ignoreMap":357},[361,2092,2093],{"class":363,"line":364},[361,2094,2095],{"class":1425},"# docker run\n",[361,2097,2098,2100,2103,2106],{"class":363,"line":497},[361,2099,1833],{"class":367},[361,2101,2102],{"class":375}," run",[361,2104,2105],{"class":371}," --add-host=host.docker.internal:host-gateway",[361,2107,2108],{"class":375}," ...\n",[352,2110,2114],{"className":2111,"code":2112,"language":2113,"meta":357,"style":357},"language-yaml shiki shiki-themes github-light","# docker compose\nextra_hosts:\n  - \"host.docker.internal:host-gateway\"\n","yaml",[22,2115,2116,2121,2130],{"__ignoreMap":357},[361,2117,2118],{"class":363,"line":364},[361,2119,2120],{"class":1425},"# docker compose\n",[361,2122,2123,2127],{"class":363,"line":497},[361,2124,2126],{"class":2125},"shJU0","extra_hosts",[361,2128,2129],{"class":633},":\n",[361,2131,2132,2135],{"class":363,"line":503},[361,2133,2134],{"class":633},"  - ",[361,2136,2137],{"class":375},"\"host.docker.internal:host-gateway\"\n",[15,2139,2140,2141,2143,2144,2146,2147,2149],{},"On Linux, Ollama on the host also has to listen beyond ",[22,2142,592],{},", or the container reaches the host and still gets refused (",[67,2145,1157],{"href":1156},"). Docker Desktop on macOS and Windows forwards ",[22,2148,2084],{}," to the host's localhost, so the default bind works there.",[15,2151,2152,2153,25],{},"n8n (running in Docker): see ",[67,2154,1300],{"href":1299},[15,2156,2157,2158,1522,2160,2163,2164,2166],{},"Any framework (running natively, not Docker): use ",[22,2159,842],{},[22,2161,2162],{},"http://127.0.0.1:11434",". Don't put ",[22,2165,1812],{}," in a client URL. It's a bind address for servers, not an address to connect to.",[15,2168,2169],{},[47,2170],{"alt":2171,"src":2172},"Where localhost points: on the host it reaches Ollama directly, inside a Docker container it needs host.docker.internal, and in WSL2 or a VS Code remote it needs mirrored networking or Ollama on the same side","/img/blog/ollama-fetch-failed-connection-refused-fix-localhost-map.jpg",[52,2174,2176],{"id":2175},"fix-5-https-vs-http-mismatch","Fix 5: HTTPS vs HTTP mismatch",[15,2178,2179,2181],{},[37,2180,1543],{}," \"fetch failed\" with an SSL/TLS error in the logs. Or the agent framework requires HTTPS but Ollama serves HTTP.",[15,2183,2184,2186],{},[37,2185,1555],{}," Ollama serves HTTP by default (no SSL). Some agent frameworks or reverse proxies expect HTTPS.",[15,2188,2189,2191,2192,2194,2195,2197],{},[37,2190,1561],{}," Use ",[22,2193,453],{}," not ",[22,2196,303],{}," in your Ollama URL. If you need HTTPS (for remote access), put a reverse proxy (Nginx, Caddy) in front of Ollama:",[352,2199,2202],{"className":2200,"code":2201,"language":855,"meta":357},[853],"# Caddy (simplest HTTPS reverse proxy)\n# In Caddyfile:\nollama.yourdomain.com {\n    reverse_proxy localhost:11434\n}\n",[22,2203,2201],{"__ignoreMap":357},[15,2205,2206,2207,2210,2211,25],{},"A Python error that says ",[22,2208,2209],{},"ssl:default"," is not this problem. See ",[67,2212,1185],{"href":1184},[52,2214,2216],{"id":2215},"fix-6-model-too-large-for-available-memory-silent-oom","Fix 6: Model too large for available memory (silent OOM)",[15,2218,2219,2221,2222,25],{},[37,2220,1543],{}," Ollama starts. The model begins loading. Then... silence. No response. Eventually: timeout. Or the model loads but inference is impossibly slow (under 1 tok/s). Or the connection drops with ",[67,2223,1374],{"href":1373},[15,2225,2226,2228],{},[37,2227,1555],{}," The model's memory requirements exceed your available RAM or VRAM. Ollama doesn't always error clearly. It just hangs, spills onto the CPU, or the runner dies.",[15,2230,2231],{},[37,2232,1561],{},[352,2234,2236],{"className":354,"code":2235,"language":356,"meta":357,"style":357},"# Check what's loaded, its size, and whether it spilled to CPU\nollama ps\n\n# If the model is too large, use a smaller quant\nollama pull qwen3.8:27b-q4_K_M    # about 18 GB\n# Instead of:\n# ollama pull qwen3.8:27b-q8_0    # about 30 GB\n",[22,2237,2238,2243,2249,2253,2258,2271,2276],{"__ignoreMap":357},[361,2239,2240],{"class":363,"line":364},[361,2241,2242],{"class":1425},"# Check what's loaded, its size, and whether it spilled to CPU\n",[361,2244,2245,2247],{"class":363,"line":497},[361,2246,1447],{"class":367},[361,2248,1466],{"class":375},[361,2250,2251],{"class":363,"line":503},[361,2252,646],{"emptyLinePlaceholder":645},[361,2254,2255],{"class":363,"line":509},[361,2256,2257],{"class":1425},"# If the model is too large, use a smaller quant\n",[361,2259,2260,2262,2265,2268],{"class":363,"line":515},[361,2261,1447],{"class":367},[361,2263,2264],{"class":375}," pull",[361,2266,2267],{"class":375}," qwen3.8:27b-q4_K_M",[361,2269,2270],{"class":1425},"    # about 18 GB\n",[361,2272,2273],{"class":363,"line":677},[361,2274,2275],{"class":1425},"# Instead of:\n",[361,2277,2278],{"class":363,"line":692},[361,2279,2280],{"class":1425},"# ollama pull qwen3.8:27b-q8_0    # about 30 GB\n",[15,2282,2283,2284,2287,2288,2292],{},"A mixture-of-experts model does not save memory here. ",[22,2285,2286],{},"qwen3.6:35b-a3b"," only activates 3B parameters per token, but all 23 GB of weights still have to fit. See our ",[67,2289,2291],{"href":2290},"/blog/local-llm-agent-consumer-hardware-2026","local LLM hardware guide"," for what fits at each RAM tier.",[52,2294,2296],{"id":2295},"fix-7-context-window-overflow-causes-timeout","Fix 7: Context window overflow causes timeout",[15,2298,2299,2301],{},[37,2300,1543],{}," First few messages work fine. Then after 5-10 messages, responses stop or time out. No error. Just... waiting.",[15,2303,2304,2306],{},[37,2305,1555],{}," The conversation grew beyond the model's allocated context window. Ollama tries to process all tokens and runs out of memory or slows to a crawl.",[15,2308,2309],{},[37,2310,1561],{},[352,2312,2314],{"className":354,"code":2313,"language":356,"meta":357,"style":357},"# Set a context window in a Modelfile\n# Don't use the maximum, use what you need\n\ncat > agent.modelfile \u003C\u003C 'EOF'\nFROM qwen3.8:27b\nPARAMETER num_ctx 32768\nPARAMETER num_predict 2048\nEOF\n\nollama create agent -f agent.modelfile\n",[22,2315,2316,2321,2326,2330,2347,2352,2357,2362,2367,2371],{"__ignoreMap":357},[361,2317,2318],{"class":363,"line":364},[361,2319,2320],{"class":1425},"# Set a context window in a Modelfile\n",[361,2322,2323],{"class":363,"line":497},[361,2324,2325],{"class":1425},"# Don't use the maximum, use what you need\n",[361,2327,2328],{"class":363,"line":503},[361,2329,646],{"emptyLinePlaceholder":645},[361,2331,2332,2335,2338,2341,2344],{"class":363,"line":509},[361,2333,2334],{"class":367},"cat",[361,2336,2337],{"class":629}," >",[361,2339,2340],{"class":375}," agent.modelfile",[361,2342,2343],{"class":629}," \u003C\u003C",[361,2345,2346],{"class":375}," 'EOF'\n",[361,2348,2349],{"class":363,"line":515},[361,2350,2351],{"class":375},"FROM qwen3.8:27b\n",[361,2353,2354],{"class":363,"line":677},[361,2355,2356],{"class":375},"PARAMETER num_ctx 32768\n",[361,2358,2359],{"class":363,"line":692},[361,2360,2361],{"class":375},"PARAMETER num_predict 2048\n",[361,2363,2364],{"class":363,"line":706},[361,2365,2366],{"class":375},"EOF\n",[361,2368,2369],{"class":363,"line":1627},[361,2370,646],{"emptyLinePlaceholder":645},[361,2372,2373,2375,2378,2381,2384],{"class":363,"line":1633},[361,2374,1447],{"class":367},[361,2376,2377],{"class":375}," create",[361,2379,2380],{"class":375}," agent",[361,2382,2383],{"class":371}," -f",[361,2385,2386],{"class":375}," agent.modelfile\n",[15,2388,2389,2390,2393],{},"Then point your agent at the new ",[22,2391,2392],{},"agent"," model instead of the original tag, or the setting won't apply.",[15,2395,2396,2399,2400,2403,2404,2407,2408,2410],{},[22,2397,2398],{},"32768"," is the floor for simple agents. Hermes Agent needs at least 64K for tool use, so set ",[22,2401,2402],{},"PARAMETER num_ctx 64000"," for Hermes, and give Claude Code at least as much. Every extra token of context costs memory, so if raising ",[22,2405,2406],{},"num_ctx"," tips you into ",[67,2409,1248],{"href":1247},", step down a model size.",[15,2412,2413,2414,2418,2419,2423],{},"Our ",[67,2415,2417],{"href":2416},"/blog/ai-agent-context-window-explained","context window management guide"," covers how to prevent context overflow, and our guide to ",[67,2420,2422],{"href":2421},"/blog/ollama-context-window-truncates-agent-config","Ollama's default context window"," explains why the defaults are too small for agent tasks.",[15,2425,2426],{},[47,2427],{"alt":2428,"src":2429},"Fixes 6 and 7: the model does not fit in memory, or the conversation outgrows num_ctx, with the commands and context sizes for each","/img/blog/ollama-fetch-failed-connection-refused-fix-overflow.jpg",[52,2431,2433],{"id":2432},"fix-8-ollama-version-mismatch-model-not-found","Fix 8: Ollama version mismatch (model not found)",[344,2435,2437],{"id":2436},"error-pull-model-manifest-file-does-not-exist-model-not-found","\"Error: pull model manifest: file does not exist\" / \"model not found\"",[15,2439,2440,1544,2442,2445,2446,2449],{},[37,2441,1543],{},[22,2443,2444],{},"ollama run modelname"," returns \"model not found\" even though you pulled it. Or the model exists in ",[22,2447,2448],{},"ollama list"," but won't load. Or a brand new model refuses to pull.",[15,2451,2452,2454,2455,2457],{},[37,2453,1555],{}," New models often use new architectures, and an older Ollama can't load them. The tag in your agent config also has to match ",[22,2456,2448],{}," exactly.",[15,2459,2460],{},[37,2461,1561],{},[352,2463,2465],{"className":354,"code":2464,"language":356,"meta":357,"style":357},"# Check your version\nollama --version\n\n# Update Ollama\n# macOS / Windows: the app auto-updates, or reinstall from ollama.com\n# Linux:\ncurl -fsSL https://ollama.com/install.sh | sh\n\n# Re-pull the model after updating\nollama pull qwen3.8:27b\n",[22,2466,2467,2472,2479,2483,2488,2493,2498,2513,2517,2522],{"__ignoreMap":357},[361,2468,2469],{"class":363,"line":364},[361,2470,2471],{"class":1425},"# Check your version\n",[361,2473,2474,2476],{"class":363,"line":497},[361,2475,1447],{"class":367},[361,2477,2478],{"class":371}," --version\n",[361,2480,2481],{"class":363,"line":503},[361,2482,646],{"emptyLinePlaceholder":645},[361,2484,2485],{"class":363,"line":509},[361,2486,2487],{"class":1425},"# Update Ollama\n",[361,2489,2490],{"class":363,"line":515},[361,2491,2492],{"class":1425},"# macOS / Windows: the app auto-updates, or reinstall from ollama.com\n",[361,2494,2495],{"class":363,"line":677},[361,2496,2497],{"class":1425},"# Linux:\n",[361,2499,2500,2502,2505,2508,2510],{"class":363,"line":692},[361,2501,368],{"class":367},[361,2503,2504],{"class":371}," -fsSL",[361,2506,2507],{"class":375}," https://ollama.com/install.sh",[361,2509,1953],{"class":629},[361,2511,2512],{"class":367}," sh\n",[361,2514,2515],{"class":363,"line":706},[361,2516,646],{"emptyLinePlaceholder":645},[361,2518,2519],{"class":363,"line":1627},[361,2520,2521],{"class":1425},"# Re-pull the model after updating\n",[361,2523,2524,2526,2528],{"class":363,"line":1633},[361,2525,1447],{"class":367},[361,2527,2264],{"class":375},[361,2529,2530],{"class":375}," qwen3.8:27b\n",[15,2532,2533],{},"If a pull was interrupted, the partial download can leave a broken model behind. Remove it and pull again:",[352,2535,2537],{"className":354,"code":2536,"language":356,"meta":357,"style":357},"ollama rm qwen3.8:27b\nollama pull qwen3.8:27b\n",[22,2538,2539,2548],{"__ignoreMap":357},[361,2540,2541,2543,2546],{"class":363,"line":364},[361,2542,1447],{"class":367},[361,2544,2545],{"class":375}," rm",[361,2547,2530],{"class":375},[361,2549,2550,2552,2554],{"class":363,"line":497},[361,2551,1447],{"class":367},[361,2553,2264],{"class":375},[361,2555,2530],{"class":375},[52,2557,2559],{"id":2558},"fix-9-hermesopenclaw-specific-connection-issues","Fix 9: Hermes/OpenClaw specific connection issues",[15,2561,2562,2564,2565,2567,2568,2570],{},[37,2563,1543],{}," Hermes or OpenClaw can't connect to Ollama, even though ",[22,2566,368],{}," and ",[22,2569,2044],{}," work fine from the terminal.",[15,2572,2573,2575,2576,25],{},[37,2574,1555],{}," Each framework wants the base URL in a specific format, and the two don't agree on ",[22,2577,2578],{},"/v1",[344,2580,2582],{"id":2581},"hermes-agent-connection-error-or-fetch-failed","Hermes Agent: \"Connection error\" or \"fetch failed\"",[15,2584,2585,2586,2591,2592,484],{},"Hermes uses Ollama's OpenAI-compatible endpoint, so its base URL ",[37,2587,2588,2589],{},"ends in ",[22,2590,2578],{},". Hermes is configured in ",[22,2593,2594],{},"~/.hermes/config.yaml",[352,2596,2598],{"className":2111,"code":2597,"language":2113,"meta":357,"style":357},"model:\n  default: \"qwen3.8:27b\"\n  provider: \"custom\"\n  base_url: \"http://localhost:11434/v1\"\n",[22,2599,2600,2607,2618,2628],{"__ignoreMap":357},[361,2601,2602,2605],{"class":363,"line":364},[361,2603,2604],{"class":2125},"model",[361,2606,2129],{"class":633},[361,2608,2609,2612,2615],{"class":363,"line":497},[361,2610,2611],{"class":2125},"  default",[361,2613,2614],{"class":633},": ",[361,2616,2617],{"class":375},"\"qwen3.8:27b\"\n",[361,2619,2620,2623,2625],{"class":363,"line":503},[361,2621,2622],{"class":2125},"  provider",[361,2624,2614],{"class":633},[361,2626,2627],{"class":375},"\"custom\"\n",[361,2629,2630,2633,2635],{"class":363,"line":509},[361,2631,2632],{"class":2125},"  base_url",[361,2634,2614],{"class":633},[361,2636,2637],{"class":375},"\"http://localhost:11434/v1\"\n",[15,2639,2640,2641,2644,2645,2647,2648,2650,2651,2653,2654,1498],{},"Leave the API key empty or set it to ",[22,2642,2643],{},"no-key",". If Hermes runs in Docker, swap ",[22,2646,584],{}," for ",[22,2649,2084],{}," and keep the ",[22,2652,2578],{},". Hermes needs at least 64K of context for tool use (",[67,2655,1260],{"href":1259},[15,2657,2658,2659,2661,2662,2666,2667,2670,2671,2675,2676,2680],{},"If tool calls hang with Qwen3.8 on ",[22,2660,2578],{},", update Ollama first, then see our ",[67,2663,2665],{"href":2664},"/blog/qwen-3-8-27b-tool-calling-fails-agents-fix","Qwen3.8 27B tool calling fix",". ",[22,2668,2669],{},"qwen3.6:27b"," is the fallback that works on the same endpoint. For other Hermes errors, see our ",[67,2672,2674],{"href":2673},"/blog/hermes-agent-error-400","error 400 diagnostic guide",", and if Ollama connects but local models hang on tool calls, our guide to ",[67,2677,2679],{"href":2678},"/blog/hermes-agent-not-working","Hermes Agent not working"," covers the failures specific to local backends.",[344,2682,2684],{"id":2683},"openclaw-typeerror-fetch-failed","OpenClaw: \"TypeError: fetch failed\"",[15,2686,2687,2688,2693,2694,2696],{},"OpenClaw is the opposite. Its Ollama provider talks to Ollama's native API, so the base URL has ",[37,2689,2690,2691],{},"no ",[22,2692,2578],{},". OpenClaw's docs warn that ",[22,2695,2578],{}," breaks tool calling:",[352,2698,2702],{"className":2699,"code":2700,"language":2701,"meta":357,"style":357},"language-json shiki shiki-themes github-light","{\n  \"models\": {\n    \"providers\": {\n      \"ollama\": {\n        \"baseUrl\": \"http://127.0.0.1:11434\",\n        \"api\": \"ollama\",\n        \"apiKey\": \"ollama-local\"\n      }\n    }\n  }\n}\n","json",[22,2703,2704,2709,2717,2724,2731,2744,2756,2766,2771,2776,2781],{"__ignoreMap":357},[361,2705,2706],{"class":363,"line":364},[361,2707,2708],{"class":633},"{\n",[361,2710,2711,2714],{"class":363,"line":497},[361,2712,2713],{"class":371},"  \"models\"",[361,2715,2716],{"class":633},": {\n",[361,2718,2719,2722],{"class":363,"line":503},[361,2720,2721],{"class":371},"    \"providers\"",[361,2723,2716],{"class":633},[361,2725,2726,2729],{"class":363,"line":509},[361,2727,2728],{"class":371},"      \"ollama\"",[361,2730,2716],{"class":633},[361,2732,2733,2736,2738,2741],{"class":363,"line":515},[361,2734,2735],{"class":371},"        \"baseUrl\"",[361,2737,2614],{"class":633},[361,2739,2740],{"class":375},"\"http://127.0.0.1:11434\"",[361,2742,2743],{"class":633},",\n",[361,2745,2746,2749,2751,2754],{"class":363,"line":677},[361,2747,2748],{"class":371},"        \"api\"",[361,2750,2614],{"class":633},[361,2752,2753],{"class":375},"\"ollama\"",[361,2755,2743],{"class":633},[361,2757,2758,2761,2763],{"class":363,"line":692},[361,2759,2760],{"class":371},"        \"apiKey\"",[361,2762,2614],{"class":633},[361,2764,2765],{"class":375},"\"ollama-local\"\n",[361,2767,2768],{"class":363,"line":706},[361,2769,2770],{"class":633},"      }\n",[361,2772,2773],{"class":363,"line":1627},[361,2774,2775],{"class":633},"    }\n",[361,2777,2778],{"class":363,"line":1633},[361,2779,2780],{"class":633},"  }\n",[361,2782,2783],{"class":363,"line":1775},[361,2784,518],{"class":633},[15,2786,2787,2788,2791,2792,2795,2796,25],{},"The easiest route is ",[22,2789,2790],{},"ollama launch openclaw --model qwen3.8:27b",", which writes this config for you. For every OpenClaw variant (model discovery timeouts, TUI errors, WSL2), see our ",[67,2793,2794],{"href":880},"OpenClaw Ollama fetch failed guide",", and for tool-calling and \"no response\" problems, our ",[67,2797,2799],{"href":2798},"/blog/openclaw-local-model-not-working","OpenClaw local model not working guide",[15,2801,2802],{},[47,2803],{"alt":2804,"src":2805},"The switchboard: which Ollama URL each client needs, with /v1 for OpenAI-compatible clients like Hermes, no /v1 for native clients like n8n, OpenClaw and Claude Code, and host.docker.internal inside Docker","/img/blog/ollama-fetch-failed-connection-refused-fix-switchboard.jpg",[52,2807,2809],{"id":2808},"fix-10-could-not-connect-to-ollama-app","Fix 10: \"could not connect to ollama app\"",[344,2811,2813],{"id":2812},"error-could-not-connect-to-ollama-app-is-it-running","\"Error: could not connect to ollama app, is it running?\"",[15,2815,2816,2817,2820,2821,1491,2823,1491,2825,2828],{},"Newer Ollama versions word it as ",[22,2818,2819],{},"Error: could not connect to ollama server, run 'ollama serve' to start it",". Same meaning: the Ollama CLI is telling you the server isn't up. The CLI (",[22,2822,2044],{},[22,2824,1079],{},[22,2826,2827],{},"ollama pull",") is only a client. It needs the background server on port 11434.",[15,2830,2831,2834,2835,2837],{},[37,2832,2833],{},"Windows:"," check the system tray for the llama icon. If it's missing, open Ollama from the Start menu. Still failing? Quit it from the tray, open a new terminal and run ",[22,2836,812],{}," to see the actual error.",[15,2839,2840,2843,2844,2567,2846,2848,2849,2852],{},[37,2841,2842],{},"macOS:"," open the Ollama app from Applications. The menu bar icon means the server is running. (On macOS and Windows, ",[22,2845,1079],{},[22,2847,2448],{}," try to start the app for you, so if you still see this error, the app is failing to start. Check the log in the ",[67,2850,2851],{"href":1373},"EOF section",".)",[15,2854,2855],{},[37,2856,2857],{},"Linux:",[352,2859,2861],{"className":354,"code":2860,"language":356,"meta":357,"style":357},"sudo systemctl start ollama\nsudo systemctl enable ollama\njournalctl -u ollama -n 50 --no-pager   # see why it died\n",[22,2862,2863,2874,2884],{"__ignoreMap":357},[361,2864,2865,2867,2869,2872],{"class":363,"line":364},[361,2866,1600],{"class":367},[361,2868,1603],{"class":375},[361,2870,2871],{"class":375}," start",[361,2873,1609],{"class":375},[361,2875,2876,2878,2880,2882],{"class":363,"line":497},[361,2877,1600],{"class":367},[361,2879,1603],{"class":375},[361,2881,1661],{"class":375},[361,2883,1609],{"class":375},[361,2885,2886,2889,2892,2894,2897,2900,2903],{"class":363,"line":503},[361,2887,2888],{"class":367},"journalctl",[361,2890,2891],{"class":371}," -u",[361,2893,1984],{"class":375},[361,2895,2896],{"class":371}," -n",[361,2898,2899],{"class":371}," 50",[361,2901,2902],{"class":371}," --no-pager",[361,2904,2905],{"class":1425},"   # see why it died\n",[15,2907,2908,2909,2911],{},"If you set ",[22,2910,1976],{}," to a custom port, the CLI needs the same variable, or it'll look on 11434 and fail.",[52,2913,2915],{"id":2914},"fix-11-bind-address-already-in-use-on-11434","Fix 11: \"bind: address already in use\" on 11434",[344,2917,2919],{"id":2918},"error-listen-tcp-12700111434-bind-address-already-in-use","\"Error: listen tcp 127.0.0.1:11434: bind: address already in use\"",[15,2921,2922,2923,2925],{},"This almost always means Ollama is already running. The desktop app or the systemd service started it, and you ran ",[22,2924,812],{}," a second time.",[15,2927,2928],{},"You don't need to fix anything. Just use it:",[352,2930,2932],{"className":354,"code":2931,"language":356,"meta":357,"style":357},"curl http://localhost:11434/api/version\n",[22,2933,2934],{"__ignoreMap":357},[361,2935,2936,2938],{"class":363,"line":364},[361,2937,368],{"class":367},[361,2939,1433],{"class":375},[15,2941,2942,2943,2945],{},"If you really want to run ",[22,2944,812],{}," by hand (for example, to set env vars), stop the other one first:",[352,2947,2949],{"className":354,"code":2948,"language":356,"meta":357,"style":357},"# Linux\nsudo systemctl stop ollama\n# macOS / Windows: quit Ollama from the menu bar or system tray\n",[22,2950,2951,2956,2967],{"__ignoreMap":357},[361,2952,2953],{"class":363,"line":364},[361,2954,2955],{"class":1425},"# Linux\n",[361,2957,2958,2960,2962,2965],{"class":363,"line":497},[361,2959,1600],{"class":367},[361,2961,1603],{"class":375},[361,2963,2964],{"class":375}," stop",[361,2966,1609],{"class":375},[361,2968,2969],{"class":363,"line":503},[361,2970,2971],{"class":1425},"# macOS / Windows: quit Ollama from the menu bar or system tray\n",[15,2973,2974,2975,2978,2979,2982,2983,1498],{},"Only if ",[22,2976,2977],{},"lsof -i :11434"," (macOS/Linux) or ",[22,2980,2981],{},"netstat -ano | findstr 11434"," (Windows) shows a process that isn't Ollama, move Ollama to another port (",[67,2984,1224],{"href":1223},[52,2986,2988],{"id":2987},"fix-12-python-cannot-connect-to-host-localhost11434-ssldefault","Fix 12: Python \"Cannot connect to host localhost:11434 ssl:default\"",[344,2990,2992],{"id":2991},"cannot-connect-to-host-localhost11434-ssldefault-connect-call-failed-127001-11434","\"Cannot connect to host localhost:11434 ssl:default [Connect call failed ('127.0.0.1', 11434)]\"",[15,2994,2995,2996,2998],{},"This is aiohttp (used by Open WebUI, LiteLLM and many async Python agents) saying the TCP connection was refused. The ",[22,2997,2209],{}," part is just aiohttp's label. It does not mean an SSL problem.",[434,3000,3001,3014,3029],{},[104,3002,3003,3008,3009,1115,3011,3013],{},[37,3004,3005,484],{},[22,3006,3007],{},"('127.0.0.1', 11434)"," the server isn't running (",[67,3010,1141],{"href":1140},[67,3012,1125],{"href":1124},"), or your Python code is in a container where localhost is the container.",[104,3015,3016,3021,3022,3025,3026,3028],{},[37,3017,3018,484],{},[22,3019,3020],{},"host.docker.internal:11434 ... ('172.17.0.1', 11434)"," your container found the host fine, but Ollama on the host is only listening on 127.0.0.1. Set ",[22,3023,3024],{},"OLLAMA_HOST=0.0.0.0:11434"," (",[67,3027,1157],{"href":1156},") and restart Ollama.",[104,3030,3031,3036,3037,3039],{},[37,3032,3033,484],{},[22,3034,3035],{},"host.docker.internal ... [Domain name not found]"," Linux Docker doesn't create that name by default. Add ",[22,3038,863],{}," or, in compose:",[352,3041,3043],{"className":2111,"code":3042,"language":2113,"meta":357,"style":357},"extra_hosts:\n  - \"host.docker.internal:host-gateway\"\n",[22,3044,3045,3051],{"__ignoreMap":357},[361,3046,3047,3049],{"class":363,"line":364},[361,3048,2126],{"class":2125},[361,3050,2129],{"class":633},[361,3052,3053,3055],{"class":363,"line":497},[361,3054,2134],{"class":633},[361,3056,2137],{"class":375},[52,3058,3060],{"id":3059},"fix-13-n8n-fetch-failed-econnrefused","Fix 13: n8n \"fetch failed\" / \"ECONNREFUSED\"",[344,3062,3064],{"id":3063},"problem-in-node-ai-agent-fetch-failed-couldnt-connect-with-these-settings-econnrefused","\"Problem in node 'AI Agent': fetch failed\" / \"Couldn't connect with these settings ECONNREFUSED\"",[15,3066,3067],{},"The n8n Ollama credential test runs from where n8n runs, not from your browser.",[15,3069,3070],{},"Set the Base URL in the Ollama credential to match your setup:",[352,3072,3075],{"className":3073,"code":3074,"language":855,"meta":357},[853],"# n8n and Ollama both installed natively\nhttp://localhost:11434\n\n# n8n in Docker, Ollama on the host\nhttp://host.docker.internal:11434\n\n# Both in the same docker compose (use the service name)\nhttp://ollama:11434\n",[22,3076,3074],{"__ignoreMap":357},[15,3078,3079,3080,3082,3083,3085,3086,3088,3089,3091,3092,3096],{},"On Linux, the Docker case also needs the ",[22,3081,2126],{}," line from ",[67,3084,1185],{"href":1184}," and Ollama bound beyond 127.0.0.1 (",[67,3087,1157],{"href":1156},"). No ",[22,3090,2578],{}," here. The n8n Ollama node uses Ollama's native API. If the credential saves but the AI Agent node fails mid-run, it's usually a timeout on a slow model. Use a smaller model or raise the n8n execution timeout. Our ",[67,3093,3095],{"href":3094},"/blog/n8n-vs-make-ai-agents","n8n vs Make comparison"," covers the full agent setup.",[52,3098,3100],{"id":3099},"fix-14-vs-code-ollama-fetch-failed","Fix 14: VS Code \"Ollama fetch failed\"",[344,3102,3104],{"id":3103},"fetch-failed-in-a-vs-code-extension","\"fetch failed\" in a VS Code extension",[15,3106,3107],{},"VS Code extensions (Continue, Copilot's bring-your-own-model, Cline and others) connect from the machine the extension runs on.",[434,3109,3110,3123,3138],{},[104,3111,3112,1544,3115,3117,3118,3025,3120,3122],{},[37,3113,3114],{},"Remote SSH, WSL or Dev Containers:",[22,3116,584],{}," now means the remote machine or container, not your laptop. Either run Ollama on that remote, or point the extension at your host's IP with Ollama bound to ",[22,3119,1812],{},[67,3121,1157],{"href":1156},", and read its security warning).",[104,3124,3125,3128,3129,3131,3132,3134,3135,25],{},[37,3126,3127],{},"Check the endpoint field."," Most want ",[22,3130,842],{}," (no ",[22,3133,2578],{},"). Extensions that use the OpenAI format want ",[22,3136,3137],{},"http://localhost:11434/v1",[104,3139,3140,3143],{},[37,3141,3142],{},"Test from VS Code's own terminal."," If the command below fails there, it's a network location issue, not the extension.",[352,3145,3146],{"className":354,"code":2931,"language":356,"meta":357,"style":357},[22,3147,3148],{"__ignoreMap":357},[361,3149,3150,3152],{"class":363,"line":364},[361,3151,368],{"class":367},[361,3153,1433],{"class":375},[52,3155,3157],{"id":3156},"fix-15-claude-code-connection-refused","Fix 15: Claude Code \"Connection refused\"",[344,3159,3161],{"id":3160},"connection-refused-a-firewall-or-proxy-may-be-blocking-it","\"Connection refused, a firewall or proxy may be blocking it\"",[15,3163,3164],{},"If you're running Claude Code on Ollama models, the easiest path is Ollama's own launcher, which sets everything up:",[352,3166,3168],{"className":354,"code":3167,"language":356,"meta":357,"style":357},"ollama launch claude --model qwen3.8:27b\n",[22,3169,3170],{"__ignoreMap":357},[361,3171,3172,3174,3177,3180,3183],{"class":363,"line":364},[361,3173,1447],{"class":367},[361,3175,3176],{"class":375}," launch",[361,3178,3179],{"class":375}," claude",[361,3181,3182],{"class":371}," --model",[361,3184,2530],{"class":375},[15,3186,3187,3188,484],{},"Setting it up by hand? Claude Code speaks the Anthropic API, which Ollama serves natively, so the base URL takes ",[37,3189,2690,3190],{},[22,3191,2578],{},[352,3193,3195],{"className":354,"code":3194,"language":356,"meta":357,"style":357},"export ANTHROPIC_BASE_URL=http://localhost:11434\nexport ANTHROPIC_AUTH_TOKEN=ollama\nexport ANTHROPIC_API_KEY=\"\"\n",[22,3196,3197,3210,3222],{"__ignoreMap":357},[361,3198,3199,3202,3205,3207],{"class":363,"line":364},[361,3200,3201],{"class":629},"export",[361,3203,3204],{"class":633}," ANTHROPIC_BASE_URL",[361,3206,665],{"class":629},[361,3208,3209],{"class":633},"http://localhost:11434\n",[361,3211,3212,3214,3217,3219],{"class":363,"line":497},[361,3213,3201],{"class":629},[361,3215,3216],{"class":633}," ANTHROPIC_AUTH_TOKEN",[361,3218,665],{"class":629},[361,3220,3221],{"class":633},"ollama\n",[361,3223,3224,3226,3229,3231],{"class":363,"line":503},[361,3225,3201],{"class":629},[361,3227,3228],{"class":633}," ANTHROPIC_API_KEY",[361,3230,665],{"class":629},[361,3232,3233],{"class":375},"\"\"\n",[15,3235,3236,3237,3239,3240,1498],{},"Connection refused here is the same root cause as everywhere else: the server isn't up, or Claude Code runs somewhere (container, WSL) where ",[22,3238,584],{}," isn't your Ollama. Give it at least 64K of context for real repos (",[67,3241,1260],{"href":1259},[52,3243,3245],{"id":3244},"windows-target-machine-actively-refused-it","Windows: \"target machine actively refused it\"",[344,3247,3249],{"id":3248},"no-connection-could-be-made-because-the-target-machine-actively-refused-it","\"No connection could be made because the target machine actively refused it\"",[15,3251,3252],{},"That's Windows for \"connection refused\". Checks:",[101,3254,3255,3263,3289,3301],{},[104,3256,3257,3260,3261,1498],{},[37,3258,3259],{},"Is Ollama in the system tray?"," If not, start it (",[67,3262,1125],{"href":1124},[104,3264,3265,3274,3275,3277,3278,3281,3282,3284,3285,3288],{},[37,3266,3267,3268,3271,3272,25],{},"Test with ",[22,3269,3270],{},"curl.exe",", not ",[22,3273,368],{}," In PowerShell, ",[22,3276,368],{}," alone is an alias for ",[22,3279,3280],{},"Invoke-WebRequest",". Run ",[22,3283,3270],{}," against ",[22,3286,3287],{},"127.0.0.1:11434/api/version",", as shown below.",[104,3290,3291,3297,3298,3300],{},[37,3292,3293,3294,3296],{},"To set ",[22,3295,1976],{}," on Windows:"," quit Ollama from the system tray first. Open Settings (Windows 11) or Control Panel (Windows 10), search for \"environment variables\", choose \"Edit environment variables for your account\", add ",[22,3299,1976],{},", then start Ollama again from the Start menu.",[104,3302,3303,3306,3307,3310,3311,3314,3315,3318,3319,3322],{},[37,3304,3305],{},"WSL2:"," an app inside WSL can't reach Windows Ollama on localhost by default. Either install Ollama inside WSL, or turn on mirrored networking (",[22,3308,3309],{},"networkingMode=mirrored"," under ",[22,3312,3313],{},"[wsl2]"," in ",[22,3316,3317],{},".wslconfig",") and run ",[22,3320,3321],{},"wsl --shutdown"," to restart WSL. Mirrored mode needs Windows 11 22H2 or later.",[352,3324,3327],{"className":3325,"code":3326,"language":855,"meta":357},[853],"curl.exe http://127.0.0.1:11434/api/version\n",[22,3328,3326],{"__ignoreMap":357},[15,3330,3331,3332,25],{},"For firewall, antivirus and PowerShell-specific fixes, see our ",[67,3333,3335],{"href":3334},"/blog/ollama-connection-refused-windows-fix","Ollama connection refused on Windows guide",[52,3337,3339],{"id":3338},"browser-apps-and-extensions-networkerror-failed-to-fetch","Browser apps and extensions: \"NetworkError\" / \"Failed to fetch\"",[344,3341,3343],{"id":3342},"networkerror-when-attempting-to-fetch-resource-typeerror-failed-to-fetch","\"NetworkError when attempting to fetch resource\" / \"TypeError: Failed to fetch\"",[15,3345,3346,3347,2567,3349,3351],{},"Ollama is running, but it's rejecting requests from a browser origin it doesn't trust (CORS). Pages on ",[22,3348,584],{},[22,3350,592],{}," are allowed by default. Browser extensions and web apps on any other domain are not, so allow them explicitly:",[352,3353,3355],{"className":354,"code":3354,"language":356,"meta":357,"style":357},"# Linux (sudo systemctl edit ollama)\nEnvironment=\"OLLAMA_ORIGINS=chrome-extension://*,moz-extension://*,safari-web-extension://*,https://your-app.com\"\n\n# macOS\nlaunchctl setenv OLLAMA_ORIGINS \"chrome-extension://*,moz-extension://*,safari-web-extension://*\"\n",[22,3356,3357,3362,3371,3375,3380],{"__ignoreMap":357},[361,3358,3359],{"class":363,"line":364},[361,3360,3361],{"class":1425},"# Linux (sudo systemctl edit ollama)\n",[361,3363,3364,3366,3368],{"class":363,"line":497},[361,3365,1739],{"class":633},[361,3367,665],{"class":629},[361,3369,3370],{"class":375},"\"OLLAMA_ORIGINS=chrome-extension://*,moz-extension://*,safari-web-extension://*,https://your-app.com\"\n",[361,3372,3373],{"class":363,"line":503},[361,3374,646],{"emptyLinePlaceholder":645},[361,3376,3377],{"class":363,"line":509},[361,3378,3379],{"class":1425},"# macOS\n",[361,3381,3382,3384,3386,3389],{"class":363,"line":515},[361,3383,1789],{"class":367},[361,3385,1792],{"class":375},[361,3387,3388],{"class":375}," OLLAMA_ORIGINS",[361,3390,3391],{"class":375}," \"chrome-extension://*,moz-extension://*,safari-web-extension://*\"\n",[15,3393,3394,3395,3397,3398,3400],{},"Restart Ollama after. On Windows, add ",[22,3396,832],{}," as a User environment variable the same way as ",[22,3399,1976],{}," above.",[52,3402,3404],{"id":3403},"runner-crashed-post-apigenerate-eof-or-server-disconnected","Runner crashed: \"POST .../api/generate: EOF\" or \"server disconnected\"",[344,3406,3408],{"id":3407},"error-post-apigenerate-eof-server-disconnected-without-sending-a-response","\"Error: POST .../api/generate: EOF\" / \"Server disconnected without sending a response\"",[15,3410,3411,3412,2567,3414,3416],{},"The connection opened, then the model runner died mid-response. Nine times out of ten it's memory: the model plus its context doesn't fit. See ",[67,3413,1248],{"href":1247},[67,3415,1260],{"href":1259},". Check the log for \"out of memory\":",[352,3418,3420],{"className":354,"code":3419,"language":356,"meta":357,"style":357},"# Linux\njournalctl -u ollama --no-pager | grep -i \"out of memory\"\n# macOS\ngrep -i \"out of memory\" ~/.ollama/logs/server.log\n# Windows (PowerShell)\nSelect-String -Path \"$env:LOCALAPPDATA\\Ollama\\server.log\" -Pattern \"out of memory\"\n",[22,3421,3422,3426,3445,3449,3462,3467],{"__ignoreMap":357},[361,3423,3424],{"class":363,"line":364},[361,3425,2955],{"class":1425},[361,3427,3428,3430,3432,3434,3436,3438,3440,3442],{"class":363,"line":497},[361,3429,2888],{"class":367},[361,3431,2891],{"class":371},[361,3433,1984],{"class":375},[361,3435,2902],{"class":371},[361,3437,1953],{"class":629},[361,3439,1956],{"class":367},[361,3441,1936],{"class":371},[361,3443,3444],{"class":375}," \"out of memory\"\n",[361,3446,3447],{"class":363,"line":503},[361,3448,3379],{"class":1425},[361,3450,3451,3454,3456,3459],{"class":363,"line":509},[361,3452,3453],{"class":367},"grep",[361,3455,1936],{"class":371},[361,3457,3458],{"class":375}," \"out of memory\"",[361,3460,3461],{"class":375}," ~/.ollama/logs/server.log\n",[361,3463,3464],{"class":363,"line":515},[361,3465,3466],{"class":1425},"# Windows (PowerShell)\n",[361,3468,3469,3472,3475,3478,3481,3484,3487],{"class":363,"line":677},[361,3470,3471],{"class":367},"Select-String",[361,3473,3474],{"class":371}," -Path",[361,3476,3477],{"class":375}," \"",[361,3479,3480],{"class":633},"$env",[361,3482,3483],{"class":375},":LOCALAPPDATA\\Ollama\\server.log\"",[361,3485,3486],{"class":371}," -Pattern",[361,3488,3444],{"class":375},[52,3490,3492],{"id":3491},"not-actually-ollama","Not actually Ollama?",[30,3494,3496,3511],{"type":3495},"info",[15,3497,3498,3501,3502,3505,3506,3510],{},[37,3499,3500],{},"\"Engine protocol predict request failed: fetch failed\""," is an LM Studio error, not Ollama. LM Studio's server runs on port 1234. Make sure the server is started in LM Studio's Developer tab and your agent points at ",[22,3503,3504],{},"http://localhost:1234/v1",". Our ",[67,3507,3509],{"href":3508},"/blog/ollama-vs-lm-studio-agents","Ollama vs LM Studio comparison"," covers the differences.",[15,3512,3513,3516,3517,3520,3521,25],{},[37,3514,3515],{},"Port 12434 / \"Docker Model Runner\""," is Docker's own model runtime, not Ollama. In Docker Desktop, go to Settings → AI, turn on \"Enable host-side TCP support\", and point your config at ",[22,3518,3519],{},"http://localhost:12434",". From the CLI: ",[22,3522,3523],{},"docker desktop enable model-runner --tcp 12434",[52,3525,3527],{"id":3526},"openclaw-verification-failed-fetch-failed","OpenClaw: \"Verification failed: fetch failed\"",[344,3529,3531],{"id":3530},"verification-failed-fetch-failed-model-verification-failed","\"Verification failed: fetch failed\" / \"model verification failed\"",[15,3533,3534],{},"OpenClaw checks the model during setup by calling your endpoint. \"Fetch failed\" at this step means it couldn't reach Ollama at all, not that the model is bad (people often search it as \"qwen3.8-27b model verification failed\").",[101,3536,3537,3552,3559],{},[104,3538,3539,3540,3543,3544,3547,3548,3551],{},"Confirm ",[22,3541,3542],{},"curl http://127.0.0.1:11434/api/tags"," lists the exact model tag you typed. ",[22,3545,3546],{},"qwen3.8:27b"," (colon) is not ",[22,3549,3550],{},"qwen3.8-27b"," (hyphen).",[104,3553,3554,3555,3025,3557,1498],{},"Make sure the base URL has no ",[22,3556,2578],{},[67,3558,1286],{"href":1285},[104,3560,3561,3562,3564],{},"Or skip the manual setup: ",[22,3563,2790],{}," lets Ollama write the config for you.",[15,3566,3567,3568,25],{},"For every other OpenClaw variant, see our full ",[67,3569,2794],{"href":880},[52,3571,3573],{"id":3572},"the-honest-truth-about-local-agent-backends","The honest truth about local agent backends",[15,3575,3576],{},"The honest truth about running local models as agent backends: connection errors are part of the deal. Ollama is excellent software. But it runs on your machine, depends on your network configuration, and interacts with your Docker setup, your firewall, your sleep settings, and your memory limits. Every one of these is a potential failure point.",[15,3578,3579],{},"For agents that need to run reliably 24/7, the question isn't \"can I fix this error?\" It's \"do I want to keep fixing these errors?\"",[15,3581,3582,3585],{},[67,3583,3584],{"href":779},"Give BetterClaw a look"," if you'd rather build agents than debug connection strings. Free plan with 1 agent and 100 credits a month. Pro is $49/month for 5 agents. 200+ verified skills. 28+ model providers via BYOK with zero markup. We handle the connections. You handle the agent logic.",[52,3587,3589],{"id":3588},"frequently-asked-questions","Frequently Asked Questions",[15,3591,3592],{},[37,3593,3594],{},"Why does Ollama say \"fetch failed\"?",[15,3596,3597,3598,3601],{},"\"Fetch failed\" means the client (your agent framework, browser, or CLI tool) couldn't establish a connection to Ollama's HTTP server. The three most common causes: the Ollama service isn't running (Fix 1), the server is bound to localhost but the client is in Docker (Fix 4), or the port is blocked by a firewall (Fix 3). Run ",[22,3599,3600],{},"curl http://localhost:11434/api/version"," to check if the server is responding.",[15,3603,3604],{},[37,3605,3606],{},"What does \"could not connect to ollama app, is it running?\" mean?",[15,3608,3609,3610,3613],{},"The Ollama CLI can't reach the background server on port 11434. Newer versions say \"could not connect to ollama server\" instead. Start the Ollama app (Windows, macOS) or run ",[22,3611,3612],{},"sudo systemctl start ollama"," (Linux), then retry.",[15,3615,3616],{},[37,3617,3618],{},"Why does \"ollama ps\" show nothing?",[15,3620,3621,3623,3624,25],{},[22,3622,1079],{}," only lists models loaded in memory. An empty list is normal when nothing has been used recently. Models load on the first request. To check the server itself, run ",[22,3625,3600],{},[15,3627,3628],{},[37,3629,3630],{},"What does \"bind: address already in use\" mean in Ollama?",[15,3632,3633,3634,3636],{},"Ollama is already running, usually started by the desktop app or systemd. You don't need a second ",[22,3635,812],{},". Use the running one, or stop it first.",[15,3638,3639],{},[37,3640,3641],{},"How do I fix Ollama connection refused in Docker?",[15,3643,3644,3645,3647,3648,3651,3652,3654,3655,3657],{},"Docker containers can't reach localhost on the host machine. Replace ",[22,3646,842],{}," with ",[22,3649,3650],{},"http://host.docker.internal:11434"," in your agent framework's config. On Linux Docker, add ",[22,3653,863],{}," to your Docker run command, and make Ollama accept connections from the container by setting ",[22,3656,3024],{}," behind a firewall. Docker Desktop on macOS and Windows works with the default bind.",[15,3659,3660],{},[37,3661,3662],{},"Does Ollama need /v1 at the end of the URL?",[15,3664,3665,3666,3668,3669,3671,3672,3675,3676,3678],{},"Only for clients that use the OpenAI-compatible format, such as Hermes Agent and most agent frameworks: ",[22,3667,3137],{},". Clients that use Ollama's native API take the base URL with no ",[22,3670,2578],{},": OpenClaw's Ollama provider, the n8n Ollama node, Claude Code via ",[22,3673,3674],{},"ANTHROPIC_BASE_URL",", and the Ollama Python library. Adding ",[22,3677,2578],{}," to OpenClaw breaks tool calling.",[15,3680,3681],{},[37,3682,3683],{},"Why does Ollama time out after a few messages?",[15,3685,3686,3687,3690,3691,3694],{},"Conversation context grows with each message. By message 10-15, the accumulated tokens may exceed Ollama's allocated context window, causing it to hang or become extremely slow. Fix: set ",[22,3688,3689],{},"PARAMETER num_ctx 32768"," in your Modelfile as a floor, or 64000 for Hermes Agent. Also set ",[22,3692,3693],{},"PARAMETER num_predict 2048"," to cap output length. If the model is too large for your RAM, switch to a smaller model or quantization.",[15,3696,3697],{},[37,3698,3699],{},"How do I connect Hermes or OpenClaw to Ollama?",[15,3701,3702,3703,3705,3706,2567,3709,3310,3712,3714,3715,3718,3719,3647,3721,3724,3725,3727,3728,3731,3732,3734],{},"For Hermes: in ",[22,3704,2594],{},", set ",[22,3707,3708],{},"provider: \"custom\"",[22,3710,3711],{},"base_url: \"http://localhost:11434/v1\"",[22,3713,2604],{},", and leave the API key empty. For OpenClaw: set ",[22,3716,3717],{},"baseUrl"," to ",[22,3720,2162],{},[22,3722,3723],{},"api: \"ollama\""," and no ",[22,3726,2578],{},", or run ",[22,3729,3730],{},"ollama launch openclaw"," to write the config for you. If either runs in Docker, use ",[22,3733,2084],{}," instead of localhost.",[15,3736,3737],{},[37,3738,3739],{},"Should I use Ollama or a cloud API for agent backends?",[15,3741,3742],{},"Ollama is ideal for development, testing, privacy-sensitive workloads, and high-volume inference where API costs compound. Cloud APIs (via BYOK on platforms like BetterClaw) are better for production reliability (no connection errors, no sleep/wake issues, no port debugging), access to frontier models, and 24/7 uptime. Many teams use Ollama for development and cloud APIs for production.",[30,3744,3745,3750,3753,3758],{"type":766},[15,3746,3747],{},[37,3748,3749],{},"Build agents, not connection strings.",[15,3751,3752],{},"BetterClaw handles model connections at the platform level. BYOK across 28+ providers, 200+ verified skills, zero markup. Free forever, not a trial.",[15,3754,3755],{},[67,3756,1060],{"href":1057,"rel":3757},[1059],[15,3759,1063],{},[979,3761,3762],{},"html pre.shiki code .sAwPA, html code.shiki .sAwPA{--shiki-default:#6A737D}html pre.shiki code .s7eDp, html code.shiki .s7eDp{--shiki-default:#6F42C1}html pre.shiki code .sYBdl, html code.shiki .sYBdl{--shiki-default:#032F62}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sgsFI, html code.shiki .sgsFI{--shiki-default:#24292E}html pre.shiki code .sD7c4, html code.shiki .sD7c4{--shiki-default:#D73A49}html pre.shiki code .sYu0t, html code.shiki .sYu0t{--shiki-default:#005CC5}html pre.shiki code .shJU0, html code.shiki .shJU0{--shiki-default:#22863A}",{"title":357,"searchDepth":497,"depth":497,"links":3764},[3765,3766,3767,3770,3773,3774,3778,3779,3780,3781,3784,3788,3791,3794,3797,3800,3803,3806,3809,3812,3815,3816,3819,3820],{"id":1089,"depth":497,"text":1090},{"id":1411,"depth":497,"text":1412},{"id":1533,"depth":497,"text":1534,"children":3768},[3769],{"id":1537,"depth":503,"text":1538},{"id":1672,"depth":497,"text":1673,"children":3771},[3772],{"id":1676,"depth":503,"text":1677},{"id":1908,"depth":497,"text":1909},{"id":2036,"depth":497,"text":2037,"children":3775},[3776],{"id":2040,"depth":503,"text":3777},"\"fetch failed\" in the app, but ollama run works",{"id":2175,"depth":497,"text":2176},{"id":2215,"depth":497,"text":2216},{"id":2295,"depth":497,"text":2296},{"id":2432,"depth":497,"text":2433,"children":3782},[3783],{"id":2436,"depth":503,"text":2437},{"id":2558,"depth":497,"text":2559,"children":3785},[3786,3787],{"id":2581,"depth":503,"text":2582},{"id":2683,"depth":503,"text":2684},{"id":2808,"depth":497,"text":2809,"children":3789},[3790],{"id":2812,"depth":503,"text":2813},{"id":2914,"depth":497,"text":2915,"children":3792},[3793],{"id":2918,"depth":503,"text":2919},{"id":2987,"depth":497,"text":2988,"children":3795},[3796],{"id":2991,"depth":503,"text":2992},{"id":3059,"depth":497,"text":3060,"children":3798},[3799],{"id":3063,"depth":503,"text":3064},{"id":3099,"depth":497,"text":3100,"children":3801},[3802],{"id":3103,"depth":503,"text":3104},{"id":3156,"depth":497,"text":3157,"children":3804},[3805],{"id":3160,"depth":503,"text":3161},{"id":3244,"depth":497,"text":3245,"children":3807},[3808],{"id":3248,"depth":503,"text":3249},{"id":3338,"depth":497,"text":3339,"children":3810},[3811],{"id":3342,"depth":503,"text":3343},{"id":3403,"depth":497,"text":3404,"children":3813},[3814],{"id":3407,"depth":503,"text":3408},{"id":3491,"depth":497,"text":3492},{"id":3526,"depth":497,"text":3527,"children":3817},[3818],{"id":3530,"depth":503,"text":3531},{"id":3572,"depth":497,"text":3573},{"id":3588,"depth":497,"text":3589},"Guides","2026-06-25","\"Could not connect to ollama app\", fetch failed, ECONNREFUSED on 11434? Find your exact error and paste the fix. Docker, Windows, n8n, VS Code, OpenClaw.","/img/blog/ollama-fetch-failed-connection-refused-fix.jpg",{},"18 min read",{"title":1034,"description":3823},"Ollama Connection Refused or Fetch Failed? 15 Fixes (2026)","blog/ollama-fetch-failed-connection-refused-fix",[3831,3832,1114,3833,3834,3835,3836,3837,3838],"ollama fetch failed","ollama connection refused","ollama not responding","ollama localhost 11434","ollama timeout","ollama docker","n8n ollama","hermes ollama connection","GLFBJ2gf6O1IzYAxekz_O2R2Jb2k2Ms2lWeZK4WuqXU",{"id":3841,"title":3842,"author":3843,"body":3844,"category":1000,"date":4529,"description":4530,"extension":1003,"featured":1004,"hideToc":1004,"image":4531,"imageAlt":1029,"imageHeight":1029,"imageWidth":1029,"lang":1029,"meta":4532,"navigation":645,"path":4533,"readingTime":4534,"redirected":1004,"relatedSlugs":1029,"seo":4535,"seoTitle":4536,"stem":4537,"tags":4538,"updatedDate":4529,"__hash__":4549},"blog/blog/openclaw-dns-lookup-failed.md","OpenClaw \"DNS Lookup Failed\" Error: VPS Fix in Under 5 Minutes",{"name":7,"role":8,"avatar":9},{"type":12,"value":3845,"toc":4521},[3846,3906,3909,3912,3915,3918,3922,3932,3937,3956,3962,3984,3991,3999,4026,4029,4059,4073,4083,4091,4097,4101,4104,4119,4125,4130,4151,4154,4164,4173,4179,4183,4191,4194,4214,4226,4237,4256,4259,4276,4282,4286,4289,4294,4314,4320,4325,4343,4346,4355,4365,4373,4382,4393,4399,4401,4406,4421,4426,4437,4442,4451,4456,4459,4464,4473,4477,4518],[30,3847,3848,3869],{"type":33},[15,3849,3850,1544,3853,3856,3857,3860,3861,3864,3865,3868],{},[37,3851,3852],{},"Quick fix:",[22,3854,3855],{},"DNS lookup failed"," (often shown as ",[22,3858,3859],{},"EAI_AGAIN",") means your container can't resolve hostnames — usually because Docker's bridge DNS isn't forwarding to a working resolver. The 90% fix: give Docker explicit public DNS servers in ",[22,3862,3863],{},"/etc/docker/daemon.json",", then restart Docker and your container. If that doesn't fix it, the error is lying — it's either a Cloudflare rate limit mislabeled as DNS or a dropped ",[22,3866,3867],{},"NET_RAW"," capability (see Causes 2 and 3).",[352,3870,3872],{"className":2699,"code":3871,"language":2701,"meta":357,"style":357},"// /etc/docker/daemon.json\n{\n  \"dns\": [\"8.8.8.8\", \"8.8.4.4\"]\n}\n",[22,3873,3874,3879,3883,3902],{"__ignoreMap":357},[361,3875,3876],{"class":363,"line":364},[361,3877,3878],{"class":1425},"// /etc/docker/daemon.json\n",[361,3880,3881],{"class":363,"line":497},[361,3882,2708],{"class":633},[361,3884,3885,3888,3891,3894,3896,3899],{"class":363,"line":503},[361,3886,3887],{"class":371},"  \"dns\"",[361,3889,3890],{"class":633},": [",[361,3892,3893],{"class":375},"\"8.8.8.8\"",[361,3895,1491],{"class":633},[361,3897,3898],{"class":375},"\"8.8.4.4\"",[361,3900,3901],{"class":633},"]\n",[361,3903,3904],{"class":363,"line":509},[361,3905,518],{"class":633},[15,3907,3908],{},"A user filed GitHub issue #67740 after spending three hours debugging a \"DNS lookup failed\" error. They checked their network configuration. They verified their VPS DNS settings. They restarted Docker. They rebuilt the container. Nothing worked.",[15,3910,3911],{},"The error wasn't DNS. It was a Cloudflare rate-limit page being misclassified as a DNS failure by OpenClaw's error handler.",[15,3913,3914],{},"Three hours of debugging. The wrong diagnosis. Because the error message lied.",[15,3916,3917],{},"This is the most common networking failure in Docker-hosted OpenClaw. The error always says \"DNS lookup failed.\" The cause is one of three things, and only one of them is actually DNS.",[52,3919,3921],{"id":3920},"cause-1-dns-lookup-failed-because-docker-bridge-dns-isnt-forwarding-the-real-dns-fix","Cause 1: \"DNS lookup failed\" because Docker bridge DNS isn't forwarding (the real DNS fix)",[15,3923,3924,3927,3928,3931],{},[37,3925,3926],{},"What happens:"," Docker's default bridge network uses an internal DNS resolver (",[22,3929,3930],{},"127.0.0.11","). That resolver forwards to the host's DNS configuration. If the host's DNS resolver is broken, unreachable, or misconfigured, every DNS lookup from inside the container fails.",[15,3933,3934],{},[37,3935,3936],{},"What the error looks like:",[352,3938,3940],{"className":354,"code":3939,"language":356,"meta":357,"style":357},"Error: getaddrinfo EAI_AGAIN api.anthropic.com\n",[22,3941,3942],{"__ignoreMap":357},[361,3943,3944,3947,3950,3953],{"class":363,"line":364},[361,3945,3946],{"class":367},"Error:",[361,3948,3949],{"class":375}," getaddrinfo",[361,3951,3952],{"class":375}," EAI_AGAIN",[361,3954,3955],{"class":375}," api.anthropic.com\n",[15,3957,3958,3961],{},[37,3959,3960],{},"How to diagnose:"," Run a DNS test from inside the container:",[352,3963,3965],{"className":354,"code":3964,"language":356,"meta":357,"style":357},"docker exec openclaw-agent curl -s https://api.anthropic.com\n",[22,3966,3967],{"__ignoreMap":357},[361,3968,3969,3971,3973,3976,3978,3981],{"class":363,"line":364},[361,3970,1833],{"class":367},[361,3972,1836],{"class":375},[361,3974,3975],{"class":375}," openclaw-agent",[361,3977,1854],{"class":375},[361,3979,3980],{"class":371}," -s",[361,3982,3983],{"class":375}," https://api.anthropic.com\n",[15,3985,3986,3987,3990],{},"If that fails with a DNS error but ",[22,3988,3989],{},"curl https://api.anthropic.com"," works on the host machine, the Docker bridge DNS is the problem.",[15,3992,3993,3996,3997,484],{},[37,3994,3995],{},"The fix (under 2 minutes):"," Add explicit DNS servers to Docker's daemon configuration. Edit ",[22,3998,3863],{},[352,4000,4002],{"className":2699,"code":4001,"language":2701,"meta":357,"style":357},"{\n  \"dns\": [\"8.8.8.8\", \"8.8.4.4\"]\n}\n",[22,4003,4004,4008,4022],{"__ignoreMap":357},[361,4005,4006],{"class":363,"line":364},[361,4007,2708],{"class":633},[361,4009,4010,4012,4014,4016,4018,4020],{"class":363,"line":497},[361,4011,3887],{"class":371},[361,4013,3890],{"class":633},[361,4015,3893],{"class":375},[361,4017,1491],{"class":633},[361,4019,3898],{"class":375},[361,4021,3901],{"class":633},[361,4023,4024],{"class":363,"line":503},[361,4025,518],{"class":633},[15,4027,4028],{},"Then restart Docker and your OpenClaw container:",[352,4030,4032],{"className":354,"code":4031,"language":356,"meta":357,"style":357},"sudo systemctl restart docker   # apply the new daemon.json DNS config\ndocker restart openclaw-agent   # restart the OpenClaw container\n",[22,4033,4034,4048],{"__ignoreMap":357},[361,4035,4036,4038,4040,4042,4045],{"class":363,"line":364},[361,4037,1600],{"class":367},[361,4039,1603],{"class":375},[361,4041,1606],{"class":375},[361,4043,4044],{"class":375}," docker",[361,4046,4047],{"class":1425},"   # apply the new daemon.json DNS config\n",[361,4049,4050,4052,4054,4056],{"class":363,"line":497},[361,4051,1833],{"class":367},[361,4053,1606],{"class":375},[361,4055,3975],{"class":375},[361,4057,4058],{"class":1425},"   # restart the OpenClaw container\n",[15,4060,4061,4064,4065,4068,4069,4072],{},[37,4062,4063],{},"Why this works:"," You're telling Docker to use Google's public DNS (",[22,4066,4067],{},"8.8.8.8",") instead of forwarding to the host's resolver. Cloudflare's ",[22,4070,4071],{},"1.1.1.1"," works too. The container now resolves hostnames independently of the host's DNS configuration.",[15,4074,4075,4078,4079,4082],{},[37,4076,4077],{},"The 90% fix:"," Setting explicit DNS in ",[22,4080,4081],{},"daemon.json"," resolves 90% of \"DNS lookup failed\" errors in Docker-hosted OpenClaw. If this doesn't fix it, the problem isn't DNS. Read on.",[15,4084,4085,4086,4090],{},"For the complete Docker troubleshooting guide, ",[67,4087,4089],{"href":4088},"/blog/openclaw-docker-troubleshooting","our OpenClaw Docker troubleshooting post"," covers the other 7 common Docker errors beyond DNS.",[15,4092,4093],{},[47,4094],{"alt":4095,"src":4096},"Flow showing OpenClaw container hitting Docker's 127.0.0.11 internal resolver then a broken host DNS configuration producing EAI_AGAIN, with the three-step daemon.json fix using 8.8.8.8 and 8.8.4.4","/img/blog/openclaw-dns-lookup-failed-bridge.jpg",[52,4098,4100],{"id":4099},"cause-2-its-not-dns-at-all-the-mislabeled-rate-limit","Cause 2: It's not DNS at all (the mislabeled rate limit)",[15,4102,4103],{},"Here's where most people get it wrong.",[15,4105,4106,4110,4111],{},[67,4107,4109],{"href":4108},"/blog/openclaw-common-errors","GitHub issue #67740"," documents this clearly: OpenClaw's error classifier mislabels Cloudflare rate-limit responses as \"DNS lookup failed.\" A user spent 3 hours on ",[4112,4113,4114,4115,4118],"em",{},"\"wrong hypotheses before isolating: DNS/network config, model prefix typos, embedded agent runtime, ",[22,4116,4117],{},"service_tier"," header rejection, DigitalOcean IP reputation vs Cloudflare.\"",[15,4120,4121,4124],{},[37,4122,4123],{},"What actually happens:"," Your request reaches the provider's endpoint. Cloudflare returns an HTML rate-limit page (HTTP 429 or 503 with an HTML body). OpenClaw's error classifier receives an HTML response where it expected JSON. It classifies this as a connection-level failure. The error message says \"DNS lookup failed.\" The DNS was fine. The request reached the server. The server rejected it.",[15,4126,4127,4129],{},[37,4128,3960],{}," Test the provider endpoint directly with curl from inside the container:",[352,4131,4133],{"className":354,"code":4132,"language":356,"meta":357,"style":357},"docker exec openclaw-agent curl -v https://api.anthropic.com/v1/messages\n",[22,4134,4135],{"__ignoreMap":357},[361,4136,4137,4139,4141,4143,4145,4148],{"class":363,"line":364},[361,4138,1833],{"class":367},[361,4140,1836],{"class":375},[361,4142,3975],{"class":375},[361,4144,1854],{"class":375},[361,4146,4147],{"class":371}," -v",[361,4149,4150],{"class":375}," https://api.anthropic.com/v1/messages\n",[15,4152,4153],{},"If you get an HTTP response (even an error response like 401 or 429), DNS is working. The problem is the provider endpoint, not your network.",[15,4155,4156,4159,4160,4163],{},[37,4157,4158],{},"The fix:"," If it's a rate limit — reduce your request frequency, check your API key billing status, or switch providers temporarily. If it's an OpenAI Codex OAuth issue specifically (the exact case in #67740): the Codex endpoint rejects requests with ",[22,4161,4162],{},"store:true",", which OpenClaw sends by default. Switch to a direct API key or wait for the fix.",[15,4165,4166,1544,4169,4172],{},[37,4167,4168],{},"The meta-lesson from #67740:",[4112,4170,4171],{},"\"Direct curl to endpoint directly was the diagnostic step that isolated this in 60 seconds. Suggest adding 'curl test against provider endpoint directly' to OpenClaw's troubleshooting docs.\""," Always test with curl before debugging DNS.",[15,4174,4175],{},[47,4176],{"alt":4177,"src":4178},"Request flow showing OpenClaw reaching Cloudflare which returns an HTML 429/503 rate-limit page that the OpenClaw error classifier mislabels as \"DNS lookup failed,\" with the curl diagnostic that isolates the real cause in 60 seconds","/img/blog/openclaw-dns-lookup-failed-rate-limit.jpg",[52,4180,4182],{"id":4181},"cause-3-net_raw-dropped-in-docker-desktop-the-security-fix-that-breaks-networking","Cause 3: NET_RAW dropped in Docker Desktop (the security fix that breaks networking)",[15,4184,4185,4187,4188,4190],{},[37,4186,3926],{}," OpenClaw's hardened Docker Compose configuration drops the ",[22,4189,3867],{}," capability for security. In some Docker Desktop setups, this prevents the CLI sidecar from performing DNS lookups at all.",[15,4192,4193],{},"From the official OpenClaw docs:",[4195,4196,4197],"blockquote",{},[15,4198,4199,4200,4203,4204,4206,4207,4209,4210,4213],{},"\"Some Docker Desktop setups fail DNS lookups from the shared-network ",[22,4201,4202],{},"openclaw-cli"," sidecar after ",[22,4205,3867],{}," is dropped, which shows up as ",[22,4208,3859],{}," during npm-backed commands such as ",[22,4211,4212],{},"openclaw plugins install",".\"",[15,4215,4216,4219,4220,4222,4223,4225],{},[37,4217,4218],{},"What this looks like:"," The gateway itself works fine (API calls succeed). But ",[22,4221,4212],{}," and other CLI commands fail with ",[22,4224,3859],{},". The CLI sidecar can't resolve hostnames. The gateway can.",[15,4227,4228,4230,4231,4233,4234,4236],{},[37,4229,4158],{}," The official docs recommend keeping the hardened compose file for gateway operation (",[22,4232,3867],{}," dropped) and running CLI commands that need DNS through a separate network context. Or temporarily add ",[22,4235,3867],{}," back for plugin installation:",[352,4238,4240],{"className":2111,"code":4239,"language":2113,"meta":357,"style":357},"cap_add:\n  - NET_RAW\n",[22,4241,4242,4249],{"__ignoreMap":357},[361,4243,4244,4247],{"class":363,"line":364},[361,4245,4246],{"class":2125},"cap_add",[361,4248,2129],{"class":633},[361,4250,4251,4253],{"class":363,"line":497},[361,4252,2134],{"class":633},[361,4254,4255],{"class":375},"NET_RAW\n",[15,4257,4258],{},"Run the install, then remove it.",[15,4260,4261,4262,4264,4265,4269,4270,4272,4273,4275],{},"If debugging Docker bridge DNS, differentiating real DNS failures from mislabeled rate limits, and managing ",[22,4263,3867],{}," capabilities in compose files sounds like more networking work than agent building, ",[67,4266,4268],{"href":4267},"/openclaw-alternative","BetterClaw eliminates the Docker networking layer entirely",". No containers. No bridge DNS. No ",[22,4271,4081],{},". No ",[22,4274,3867],{},". The agent connects to 28+ providers through managed infrastructure. DNS is our problem. Free tier with 1 agent and BYOK. $49/month for Pro.",[15,4277,4278],{},[47,4279],{"alt":4280,"src":4281},"Hardened OpenClaw compose with NET_RAW dropped: gateway resolves hostnames fine but openclaw-cli sidecar fails plugins install with EAI_AGAIN, plus the two fix options — temporary cap_add restore vs separate network context","/img/blog/openclaw-dns-lookup-failed-netraw.jpg",[52,4283,4285],{"id":4284},"the-diagnostic-checklist-run-this-before-debugging-anything","The diagnostic checklist (run this before debugging anything)",[15,4287,4288],{},"Here's the 60-second diagnostic that saves hours:",[15,4290,4291],{},[37,4292,4293],{},"Step 1:",[352,4295,4297],{"className":354,"code":4296,"language":356,"meta":357,"style":357},"docker exec openclaw-agent curl -s https://google.com\n",[22,4298,4299],{"__ignoreMap":357},[361,4300,4301,4303,4305,4307,4309,4311],{"class":363,"line":364},[361,4302,1833],{"class":367},[361,4304,1836],{"class":375},[361,4306,3975],{"class":375},[361,4308,1854],{"class":375},[361,4310,3980],{"class":371},[361,4312,4313],{"class":375}," https://google.com\n",[15,4315,4316,4317,4319],{},"If this fails: real DNS issue. Fix ",[22,4318,4081],{}," (Cause 1).",[15,4321,4322],{},[37,4323,4324],{},"Step 2:",[352,4326,4327],{"className":354,"code":4132,"language":356,"meta":357,"style":357},[22,4328,4329],{"__ignoreMap":357},[361,4330,4331,4333,4335,4337,4339,4341],{"class":363,"line":364},[361,4332,1833],{"class":367},[361,4334,1836],{"class":375},[361,4336,3975],{"class":375},[361,4338,1854],{"class":375},[361,4340,4147],{"class":371},[361,4342,4150],{"class":375},[15,4344,4345],{},"If this returns HTML (not JSON): rate limit or provider issue, not DNS (Cause 2).",[15,4347,4348,4351,4352,4354],{},[37,4349,4350],{},"Step 3:"," Check if the error only appears on CLI commands (not gateway API calls). If so: ",[22,4353,3867],{}," capability issue (Cause 3).",[15,4356,4357,4360,4361,4364],{},[37,4358,4359],{},"Step 4:"," Check your host's DNS independently: ",[22,4362,4363],{},"nslookup api.anthropic.com"," on the host machine. If this fails, the problem is your VPS's DNS configuration, not Docker.",[15,4366,4367,4368,4372],{},"For the best practices for stable VPS deployment, ",[67,4369,4371],{"href":4370},"/blog/secure-openclaw-vps-guide","our secure OpenClaw VPS guide"," covers the network configuration patterns that prevent DNS issues.",[15,4374,4375,4376,4378,4379,4381],{},"The \"DNS lookup failed\" error is the most misleading error in OpenClaw. It's sometimes DNS (fix the ",[22,4377,4081],{},"). It's sometimes a rate limit wearing a DNS costume (test with curl). It's sometimes a security capability restriction (check ",[22,4380,3867],{},"). The error message doesn't distinguish between these three causes. You have to.",[15,4383,4384,4385,4389,4390,4392],{},"If you want an agent without Docker networking, DNS configuration, and error messages that lie about what's actually wrong, ",[67,4386,4388],{"href":1057,"rel":4387},[1059],"give BetterClaw a try",". Free plan. $49/month Pro. No Docker. No DNS. No ",[22,4391,4081],{},". The agent connects. The networking is managed. The error messages are honest.",[15,4394,4395],{},[47,4396],{"alt":4397,"src":4398},"60-second diagnostic decision tree: docker exec curl google.com identifies real DNS, curl anthropic.com returning HTML flags a mislabeled rate limit, CLI-only failures point to NET_RAW, host nslookup failure points to VPS config — four branches mapping to the three causes","/img/blog/openclaw-dns-lookup-failed-diagnostic.jpg",[52,4400,3589],{"id":3588},[15,4402,4403],{},[37,4404,4405],{},"Why does OpenClaw show \"DNS lookup failed\"?",[15,4407,4408,4409,3718,4412,4414,4415,4417,4418,4420],{},"Three causes: Docker's bridge DNS isn't forwarding to a working resolver (fix: add ",[22,4410,4411],{},"{\"dns\": [\"8.8.8.8\"]}",[22,4413,3863],{},"), a provider rate limit is being mislabeled as DNS failure (fix: test with curl directly), or ",[22,4416,3867],{}," capability is dropped in Docker Desktop (fix: add ",[22,4419,3867],{}," temporarily for CLI commands). The error message doesn't distinguish between these causes.",[15,4422,4423],{},[37,4424,4425],{},"How do I fix EAI_AGAIN in OpenClaw Docker?",[15,4427,4428,4430,4431,3718,4434,4436],{},[22,4429,3859],{}," means DNS resolution failed. The fastest fix: add ",[22,4432,4433],{},"{\"dns\": [\"8.8.8.8\", \"8.8.4.4\"]}",[22,4435,3863],{}," and restart Docker. This tells the container to use Google's public DNS instead of forwarding to the host's resolver. Takes under 2 minutes. Fixes 90% of cases.",[15,4438,4439],{},[37,4440,4441],{},"Why does my OpenClaw agent work on the host but not in Docker?",[15,4443,4444,4445,4447,4448,4450],{},"Docker containers use an internal DNS resolver (",[22,4446,3930],{},") that forwards to the host's configuration. If the host's DNS works but the Docker bridge forwarding doesn't, the container can't resolve hostnames even though the host can. Setting explicit DNS servers in ",[22,4449,4081],{}," bypasses the forwarding and resolves the mismatch.",[15,4452,4453],{},[37,4454,4455],{},"Is the \"DNS lookup failed\" error always a real DNS problem?",[15,4457,4458],{},"No. GitHub issue #67740 documents a case where OpenClaw classified a Cloudflare rate-limit page as \"DNS lookup failed.\" The DNS was fine. The request reached the server. The server returned an HTML error page that OpenClaw's error classifier mislabeled. Always test with curl from inside the container before debugging DNS.",[15,4460,4461],{},[37,4462,4463],{},"Does BetterClaw have DNS lookup errors?",[15,4465,4466,4467,4469,4470,4472],{},"No. BetterClaw doesn't use Docker for agent deployment. The agent runs on managed infrastructure with professional DNS configuration. There's no bridge DNS, no ",[22,4468,4081],{},", and no ",[22,4471,3867],{}," capability to manage. DNS resolution is handled at the platform level. Free tier with 1 agent and BYOK. $49/month for Pro.",[52,4474,4476],{"id":4475},"related-reading","Related Reading",[434,4478,4479,4485,4491,4497,4504,4511],{},[104,4480,4481,4484],{},[67,4482,4483],{"href":4088},"OpenClaw Docker Troubleshooting Guide"," — The other 7 common Docker errors beyond DNS",[104,4486,4487,4490],{},[67,4488,4489],{"href":4108},"10 Most Common OpenClaw Errors"," — Quick-reference index of failure modes including the rate-limit/DNS mislabel",[104,4492,4493,4496],{},[67,4494,4495],{"href":4370},"Secure OpenClaw VPS Guide"," — VPS networking and DNS configuration patterns that prevent these errors",[104,4498,4499,4503],{},[67,4500,4502],{"href":4501},"/blog/openclaw-rate-limit","OpenClaw Rate Limit"," — When the \"DNS\" error is actually a rate limit in disguise",[104,4505,4506,4510],{},[67,4507,4509],{"href":4508},"/blog/openclaw-vps-setup","OpenClaw VPS Setup"," — Bootstrap a VPS with working DNS from the start",[104,4512,4513,4517],{},[67,4514,4516],{"href":4515},"/blog/deploy-ai-agent-no-docker","Deploy AI Agent Without Docker"," — Skip the Docker networking layer entirely",[979,4519,4520],{},"html pre.shiki code .sAwPA, html code.shiki .sAwPA{--shiki-default:#6A737D}html pre.shiki code .sgsFI, html code.shiki .sgsFI{--shiki-default:#24292E}html pre.shiki code .sYu0t, html code.shiki .sYu0t{--shiki-default:#005CC5}html pre.shiki code .sYBdl, html code.shiki .sYBdl{--shiki-default:#032F62}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .s7eDp, html code.shiki .s7eDp{--shiki-default:#6F42C1}html pre.shiki code .shJU0, html code.shiki .shJU0{--shiki-default:#22863A}",{"title":357,"searchDepth":497,"depth":497,"links":4522},[4523,4524,4525,4526,4527,4528],{"id":3920,"depth":497,"text":3921},{"id":4099,"depth":497,"text":4100},{"id":4181,"depth":497,"text":4182},{"id":4284,"depth":497,"text":4285},{"id":3588,"depth":497,"text":3589},{"id":4475,"depth":497,"text":4476},"2026-05-13","OpenClaw \"DNS lookup failed\" is sometimes DNS, sometimes a mislabeled rate limit, sometimes a Docker capability issue. Here are all three causes and fixes.","/img/blog/openclaw-dns-lookup-failed.jpg",{},"/blog/openclaw-dns-lookup-failed","8 min read",{"title":3842,"description":4530},"OpenClaw DNS Lookup Failed: 3 Causes Fixed Fast","blog/openclaw-dns-lookup-failed",[4539,4540,4541,4542,4543,4544,4545,4546,4547,4548],"OpenClaw DNS lookup failed","OpenClaw EAI_AGAIN","OpenClaw Docker DNS fix","OpenClaw networking error","Docker DNS daemon.json","OpenClaw connection refused","OpenClaw Docker troubleshooting","OpenClaw NET_RAW capability","Cloudflare rate limit OpenClaw","OpenClaw VPS networking","03XSOaYjBbqDW7-41R8EuRrwgyjd9xVqFPRoRaqjjIU",{"id":4551,"title":4552,"author":4553,"body":4554,"category":1000,"date":5546,"description":5547,"extension":1003,"featured":1004,"hideToc":1004,"image":5548,"imageAlt":1029,"imageHeight":1029,"imageWidth":1029,"lang":1029,"meta":5549,"navigation":645,"path":880,"readingTime":5550,"redirected":1004,"relatedSlugs":1029,"seo":5551,"seoTitle":5552,"stem":5553,"tags":5554,"updatedDate":5560,"__hash__":5561},"blog/blog/openclaw-ollama-fetch-failed.md","OpenClaw Ollama \"Fetch Failed\": Every Error Variant Fixed",{"name":7,"role":8,"avatar":9},{"type":12,"value":4555,"toc":5525},[4556,4624,4629,4632,4635,4639,4642,4687,4697,4702,4739,4742,4745,4751,4757,4762,4767,4787,4790,4808,4836,4845,4872,4881,4901,4907,4920,4926,4932,4935,4940,4945,4950,4953,4983,4986,5036,5039,5044,5056,5062,5065,5070,5075,5080,5083,5088,5094,5097,5102,5107,5112,5138,5157,5164,5167,5173,5176,5181,5186,5191,5248,5254,5272,5284,5290,5302,5308,5311,5316,5321,5326,5329,5332,5338,5344,5351,5370,5376,5380,5383,5389,5392,5406,5410,5417,5425,5428,5432,5437,5441,5444,5448,5462,5466,5476,5480,5486,5488,5522],[30,4557,4558,4569,4612],{"type":33},[15,4559,4560,1544,4562,4565,4566,4568],{},[37,4561,3852],{},[22,4563,4564],{},"Failed to discover Ollama models: TypeError: fetch failed"," (and bare ",[22,4567,209],{},") means OpenClaw can't reach Ollama's HTTP API — almost always a networking issue, not an Ollama or OpenClaw bug. Confirm Ollama is up, your model is pulled, and the provider is wired correctly:",[352,4570,4572],{"className":354,"code":4571,"language":356,"meta":357,"style":357},"# 1. Confirm Ollama is running and reachable\ncurl http://127.0.0.1:11434/api/tags\n# 2. Confirm your target model is pulled and ready\nollama list\n# 3. Have OpenClaw self-diagnose the provider configuration\nopenclaw doctor --deep\n",[22,4573,4574,4579,4586,4591,4597,4602],{"__ignoreMap":357},[361,4575,4576],{"class":363,"line":364},[361,4577,4578],{"class":1425},"# 1. Confirm Ollama is running and reachable\n",[361,4580,4581,4583],{"class":363,"line":497},[361,4582,368],{"class":367},[361,4584,4585],{"class":375}," http://127.0.0.1:11434/api/tags\n",[361,4587,4588],{"class":363,"line":503},[361,4589,4590],{"class":1425},"# 2. Confirm your target model is pulled and ready\n",[361,4592,4593,4595],{"class":363,"line":509},[361,4594,1447],{"class":367},[361,4596,1450],{"class":375},[361,4598,4599],{"class":363,"line":515},[361,4600,4601],{"class":1425},"# 3. Have OpenClaw self-diagnose the provider configuration\n",[361,4603,4604,4606,4609],{"class":363,"line":677},[361,4605,873],{"class":367},[361,4607,4608],{"class":375}," doctor",[361,4610,4611],{"class":371}," --deep\n",[15,4613,4614,4615,4617,4618,4620,4621,4623],{},"Make sure your ",[22,4616,3717],{}," is ",[22,4619,2162],{}," with no ",[22,4622,2578],{}," suffix. If any check fails, jump to that error below.",[15,4625,4626],{},[37,4627,4628],{},"You pasted your error into Google. Here's the fix. Jump to your specific error below.",[15,4630,4631],{},"You ran OpenClaw. You configured Ollama. You got \"fetch failed.\" Now you're here.",[15,4633,4634],{},"Good. This page covers every variant of the OpenClaw Ollama fetch failed error, what each one actually means, and the specific fix. No backstory. No theory. Just the answer you need right now.",[52,4636,4638],{"id":4637},"run-these-first-resolves-most-fetch-failed-errors","Run these first (resolves most fetch-failed errors)",[15,4640,4641],{},"Three commands that diagnose the majority of cases in under a minute:",[352,4643,4645],{"className":354,"code":4644,"language":356,"meta":357,"style":357},"# 1. Confirm Ollama is running and reachable\ncurl http://127.0.0.1:11434/api/tags\n\n# 2. Confirm your target model is pulled and ready\nollama list\n\n# 3. Have OpenClaw self-diagnose the provider configuration\nopenclaw doctor --deep\n",[22,4646,4647,4651,4657,4661,4665,4671,4675,4679],{"__ignoreMap":357},[361,4648,4649],{"class":363,"line":364},[361,4650,4578],{"class":1425},[361,4652,4653,4655],{"class":363,"line":497},[361,4654,368],{"class":367},[361,4656,4585],{"class":375},[361,4658,4659],{"class":363,"line":503},[361,4660,646],{"emptyLinePlaceholder":645},[361,4662,4663],{"class":363,"line":509},[361,4664,4590],{"class":1425},[361,4666,4667,4669],{"class":363,"line":515},[361,4668,1447],{"class":367},[361,4670,1450],{"class":375},[361,4672,4673],{"class":363,"line":677},[361,4674,646],{"emptyLinePlaceholder":645},[361,4676,4677],{"class":363,"line":692},[361,4678,4601],{"class":1425},[361,4680,4681,4683,4685],{"class":363,"line":706},[361,4682,873],{"class":367},[361,4684,4608],{"class":375},[361,4686,4611],{"class":371},[15,4688,4689,4690,4692,4693,4696],{},"If curl prints a JSON model list, Ollama is fine. If ",[22,4691,2448],{}," shows the model you configured in OpenClaw, the name matches. If ",[22,4694,4695],{},"openclaw doctor --deep"," reports the Ollama provider as healthy, your config is wired correctly. If any one of these fails, jump to that error below.",[15,4698,4699],{},[37,4700,4701],{},"Jump to your error:",[434,4703,4704,4709,4715,4721,4727,4733],{},[104,4705,4706],{},[67,4707,209],{"href":4708},"#typeerror-fetch-failed",[104,4710,4711],{},[67,4712,4714],{"href":4713},"#failed-to-discover-ollama-models","Failed to discover Ollama models",[104,4716,4717],{},[67,4718,4720],{"href":4719},"#timeouterror-fetch-failed-model-discovery","TimeoutError: fetch failed (model discovery)",[104,4722,4723],{},[67,4724,4726],{"href":4725},"#ollama-model-not-found","Ollama model not found",[104,4728,4729],{},[67,4730,4732],{"href":4731},"#ollama-not-responding-econnrefused","Ollama not responding (ECONNREFUSED)",[104,4734,4735],{},[67,4736,4738],{"href":4737},"#tui-fetch-failed-ollama","TUI fetch failed Ollama",[15,4740,4741],{},"If your error doesn't match any of these exactly, start with the first one. Most Ollama connection failures are variations of the same root cause.",[52,4743,209],{"id":4744},"typeerror-fetch-failed",[15,4746,4747,4750],{},[37,4748,4749],{},"What you see:"," OpenClaw throws \"TypeError: fetch failed\" when trying to connect to Ollama. No additional context. No helpful message. Just \"fetch failed.\"",[15,4752,4753,4756],{},[37,4754,4755],{},"What it means:"," OpenClaw can't reach the Ollama HTTP API endpoint. The request to Ollama's server never completes. This is almost always a networking issue, not an Ollama issue and not an OpenClaw issue.",[15,4758,4759,4761],{},[37,4760,4158],{}," Check four things in this order.",[15,4763,4764],{},[37,4765,4766],{},"First, verify Ollama is actually running.",[352,4768,4770],{"className":354,"code":4769,"language":356,"meta":357,"style":357},"curl http://127.0.0.1:11434/api/tags\nollama serve   # start Ollama if curl above fails\n",[22,4771,4772,4778],{"__ignoreMap":357},[361,4773,4774,4776],{"class":363,"line":364},[361,4775,368],{"class":367},[361,4777,4585],{"class":375},[361,4779,4780,4782,4784],{"class":363,"line":497},[361,4781,1447],{"class":367},[361,4783,1583],{"class":375},[361,4785,4786],{"class":1425},"   # start Ollama if curl above fails\n",[15,4788,4789],{},"If the curl call doesn't return JSON, Ollama isn't running. Start it.",[15,4791,4792,4795,4796,4798,4799,4804,4805,4807],{},[37,4793,4794],{},"Second, check the URL in your OpenClaw config."," The ",[22,4797,3717],{}," for your Ollama provider must match where Ollama is listening and ",[37,4800,4801,4802],{},"must not end in ",[22,4803,2578],{},". The ",[22,4806,2578],{}," OpenAI-compatible path technically responds but breaks tool calling downstream — use the native API:",[352,4809,4811],{"className":2111,"code":4810,"language":2113,"meta":357,"style":357},"ollama:\n  baseUrl: \"http://127.0.0.1:11434\"      # native /api/chat — correct\n  # NOT \"http://127.0.0.1:11434/v1\"      — breaks tool calling\n",[22,4812,4813,4819,4831],{"__ignoreMap":357},[361,4814,4815,4817],{"class":363,"line":364},[361,4816,1447],{"class":2125},[361,4818,2129],{"class":633},[361,4820,4821,4824,4826,4828],{"class":363,"line":497},[361,4822,4823],{"class":2125},"  baseUrl",[361,4825,2614],{"class":633},[361,4827,2740],{"class":375},[361,4829,4830],{"class":1425},"      # native /api/chat — correct\n",[361,4832,4833],{"class":363,"line":503},[361,4834,4835],{"class":1425},"  # NOT \"http://127.0.0.1:11434/v1\"      — breaks tool calling\n",[15,4837,4838,4841,4842,4844],{},[37,4839,4840],{},"Third, if you're on WSL2"," and OpenClaw and Ollama are on opposite sides of the WSL/Windows boundary, ",[22,4843,592],{}," doesn't cross. Two fixes:",[352,4846,4850],{"className":4847,"code":4848,"language":4849,"meta":357,"style":357},"language-ini shiki shiki-themes github-light","# Modern path (Windows 11 22H2+): C:\\Users\\\u003Cyou>\\.wslconfig\n[wsl2]\nnetworkingMode=mirrored\ndnsTunneling=true\n","ini",[22,4851,4852,4857,4862,4867],{"__ignoreMap":357},[361,4853,4854],{"class":363,"line":364},[361,4855,4856],{},"# Modern path (Windows 11 22H2+): C:\\Users\\\u003Cyou>\\.wslconfig\n",[361,4858,4859],{"class":363,"line":497},[361,4860,4861],{},"[wsl2]\n",[361,4863,4864],{"class":363,"line":503},[361,4865,4866],{},"networkingMode=mirrored\n",[361,4868,4869],{"class":363,"line":509},[361,4870,4871],{},"dnsTunneling=true\n",[15,4873,4874,4875,4877,4878,4880],{},"Then run ",[22,4876,3321],{}," and restart your WSL session — ",[22,4879,584],{}," now resolves transparently in both directions.",[352,4882,4884],{"className":354,"code":4883,"language":356,"meta":357,"style":357},"# Legacy fallback: use the WSL IP in OpenClaw's baseUrl\nhostname -I    # prints something like 172.29.144.1\n",[22,4885,4886,4891],{"__ignoreMap":357},[361,4887,4888],{"class":363,"line":364},[361,4889,4890],{"class":1425},"# Legacy fallback: use the WSL IP in OpenClaw's baseUrl\n",[361,4892,4893,4896,4898],{"class":363,"line":497},[361,4894,4895],{"class":367},"hostname",[361,4897,372],{"class":371},[361,4899,4900],{"class":1425},"    # prints something like 172.29.144.1\n",[15,4902,4903,4906],{},[37,4904,4905],{},"Fourth, run the OpenClaw doctor"," to confirm the provider config end-to-end:",[352,4908,4910],{"className":354,"code":4909,"language":356,"meta":357,"style":357},"openclaw doctor --deep\n",[22,4911,4912],{"__ignoreMap":357},[361,4913,4914,4916,4918],{"class":363,"line":364},[361,4915,873],{"class":367},[361,4917,4608],{"class":375},[361,4919,4611],{"class":371},[15,4921,4922,4925],{},[37,4923,4924],{},"GitHub reference:"," Issue #14053 documents this specific TypeError for Ollama discovery.",[15,4927,4928],{},[47,4929],{"alt":4930,"src":4931},"OpenClaw Ollama TypeError fetch failed terminal output","/img/blog/openclaw-ollama-typeerror-fetch-failed.jpg",[52,4933,4714],{"id":4934},"failed-to-discover-ollama-models",[15,4936,4937,4939],{},[37,4938,4749],{}," \"Failed to discover Ollama models\" appears during OpenClaw startup or when switching to an Ollama provider.",[15,4941,4942,4944],{},[37,4943,4755],{}," OpenClaw's auto-discovery tried to query Ollama for available models and the request failed. This is different from \"fetch failed\" because the connection might partially work but the model list request specifically fails.",[15,4946,4947,4949],{},[37,4948,4158],{}," The most common cause is that Ollama hasn't finished loading a model when OpenClaw tries to discover it. Ollama needs time to load model weights into memory, especially for larger models. If OpenClaw starts before the model is ready, discovery fails.",[15,4951,4952],{},"Pre-load your model before starting OpenClaw:",[352,4954,4956],{"className":354,"code":4955,"language":356,"meta":357,"style":357},"ollama run qwen3-coder:30b \"ready\"   # waits for the model to load, then exits\nopenclaw gateway start\n",[22,4957,4958,4973],{"__ignoreMap":357},[361,4959,4960,4962,4964,4967,4970],{"class":363,"line":364},[361,4961,1447],{"class":367},[361,4963,2102],{"class":375},[361,4965,4966],{"class":375}," qwen3-coder:30b",[361,4968,4969],{"class":375}," \"ready\"",[361,4971,4972],{"class":1425},"   # waits for the model to load, then exits\n",[361,4974,4975,4977,4980],{"class":363,"line":497},[361,4976,873],{"class":367},[361,4978,4979],{"class":375}," gateway",[361,4981,4982],{"class":375}," start\n",[15,4984,4985],{},"Alternatively, skip auto-discovery entirely by defining your models explicitly in the OpenClaw config:",[352,4987,4989],{"className":2111,"code":4988,"language":2113,"meta":357,"style":357},"ollama:\n  baseUrl: \"http://127.0.0.1:11434\"\n  models:\n    - id: \"qwen3-coder:30b\"\n      contextWindow: 65536\n",[22,4990,4991,4997,5006,5013,5026],{"__ignoreMap":357},[361,4992,4993,4995],{"class":363,"line":364},[361,4994,1447],{"class":2125},[361,4996,2129],{"class":633},[361,4998,4999,5001,5003],{"class":363,"line":497},[361,5000,4823],{"class":2125},[361,5002,2614],{"class":633},[361,5004,5005],{"class":375},"\"http://127.0.0.1:11434\"\n",[361,5007,5008,5011],{"class":363,"line":503},[361,5009,5010],{"class":2125},"  models",[361,5012,2129],{"class":633},[361,5014,5015,5018,5021,5023],{"class":363,"line":509},[361,5016,5017],{"class":633},"    - ",[361,5019,5020],{"class":2125},"id",[361,5022,2614],{"class":633},[361,5024,5025],{"class":375},"\"qwen3-coder:30b\"\n",[361,5027,5028,5031,5033],{"class":363,"line":515},[361,5029,5030],{"class":2125},"      contextWindow",[361,5032,2614],{"class":633},[361,5034,5035],{"class":371},"65536\n",[15,5037,5038],{},"When models are defined explicitly, OpenClaw doesn't need to discover them.",[15,5040,5041,5043],{},[37,5042,4924],{}," Issue #22913 documents Ollama models not being detected during discovery.",[15,5045,5046,5047,5050,5051,5055],{},"For the ",[67,5048,5049],{"href":2798},"complete Ollama troubleshooting guide"," covering all five local model failure modes (not just fetch errors), our ",[67,5052,5054],{"href":5053},"/blog/openclaw-ollama-guide","Ollama guide"," covers the full picture.",[15,5057,5058],{},[47,5059],{"alt":5060,"src":5061},"OpenClaw failed to discover Ollama models error","/img/blog/openclaw-ollama-discovery-failed.jpg",[52,5063,4720],{"id":5064},"timeouterror-fetch-failed-model-discovery",[15,5066,5067,5069],{},[37,5068,4749],{}," \"TimeoutError\" combined with \"fetch failed\" during model discovery. Sometimes logged as \"failed to discover ollama models timeouterror.\"",[15,5071,5072,5074],{},[37,5073,4755],{}," OpenClaw reached Ollama's API but the response took too long. The discovery request timed out. This typically happens when Ollama is in the process of loading a large model (7B+ parameters) and can't respond to API queries until the load completes.",[15,5076,5077,5079],{},[37,5078,4158],{}," Same as above: pre-load the model before starting OpenClaw. Large models (especially 14B+ or quantized 30B models) can take 30–60 seconds to load on machines with limited RAM. OpenClaw's discovery timeout is shorter than that.",[15,5081,5082],{},"If the timeout persists even after the model is loaded, the issue might be system resource pressure. If your machine is running low on RAM (Ollama plus the model plus OpenClaw plus the OS), everything slows down. Check your available memory. For comfortable Ollama operation with OpenClaw, you need at least 16GB total RAM for a 7B model, 32GB for larger models.",[15,5084,5085,5087],{},[37,5086,4924],{}," Issue #29120 documents this timeout variant specifically for Qwen models on WSL.",[15,5089,5090],{},[47,5091],{"alt":5092,"src":5093},"OpenClaw Ollama timeout error during model discovery","/img/blog/openclaw-ollama-timeout-discovery.jpg",[52,5095,4726],{"id":5096},"ollama-model-not-found",[15,5098,5099,5101],{},[37,5100,4749],{}," OpenClaw connects to Ollama but reports the specified model as \"not found.\"",[15,5103,5104,5106],{},[37,5105,4755],{}," Ollama is running and responding, but the model name in your OpenClaw config doesn't match any model Ollama has pulled. This is usually a typo or a naming format mismatch.",[15,5108,5109,5111],{},[37,5110,4158],{}," Ollama model names include a tag. The model \"qwen3\" isn't the same as \"qwen3:8b\" or \"qwen3:latest.\" Check exactly which models Ollama has, then match the exact name (including tag) in your config:",[352,5113,5115],{"className":354,"code":5114,"language":356,"meta":357,"style":357},"ollama list\n# NAME                ID            SIZE      MODIFIED\n# qwen3-coder:30b     abc123        18 GB     2 days ago\n# glm-4.7-flash       def456        19 GB     1 week ago\n",[22,5116,5117,5123,5128,5133],{"__ignoreMap":357},[361,5118,5119,5121],{"class":363,"line":364},[361,5120,1447],{"class":367},[361,5122,1450],{"class":375},[361,5124,5125],{"class":363,"line":497},[361,5126,5127],{"class":1425},"# NAME                ID            SIZE      MODIFIED\n",[361,5129,5130],{"class":363,"line":503},[361,5131,5132],{"class":1425},"# qwen3-coder:30b     abc123        18 GB     2 days ago\n",[361,5134,5135],{"class":363,"line":509},[361,5136,5137],{"class":1425},"# glm-4.7-flash       def456        19 GB     1 week ago\n",[15,5139,5140,5141,5144,5145,5148,5149,5152,5153,5156],{},"Use ",[22,5142,5143],{},"qwen3-coder:30b"," (with colon) in your OpenClaw ",[22,5146,5147],{},"models"," array — not ",[22,5150,5151],{},"qwen3-coder-30b"," (hyphen) and not ",[22,5154,5155],{},"ollama/qwen3-coder:30b"," (the provider prefix is already implied).",[15,5158,5159,5160,5163],{},"Common mistakes: using \"llama3\" when the pulled model is \"llama3:8b-instruct,\" using \"mistral\" when Ollama has \"mistral:7b,\" or adding the ",[22,5161,5162],{},"ollama/"," prefix when the provider is already declared.",[15,5165,5166],{},"If you recently pulled a new model while OpenClaw was running, restart the gateway so it sees the new model list.",[15,5168,5169],{},[47,5170],{"alt":5171,"src":5172},"OpenClaw Ollama model not found error","/img/blog/openclaw-ollama-model-not-found.jpg",[52,5174,4732],{"id":5175},"ollama-not-responding-econnrefused",[15,5177,5178,5180],{},[37,5179,4749],{}," \"ECONNREFUSED\" when OpenClaw tries to reach Ollama, or the connection simply hangs.",[15,5182,5183,5185],{},[37,5184,4755],{}," Nothing is listening on the port OpenClaw is trying to connect to. Either Ollama isn't running, it's running on a different port, or a firewall is blocking the connection.",[15,5187,5188,5190],{},[37,5189,4158],{}," Verify Ollama is running and listening on the expected port. By default, Ollama serves on port 11434:",[352,5192,5194],{"className":354,"code":5193,"language":356,"meta":357,"style":357},"# Linux/macOS: confirm something is listening on 11434\nss -tlnp | grep 11434\n# or\nlsof -iTCP:11434 -sTCP:LISTEN\n\n# Windows PowerShell equivalent\nGet-NetTCPConnection -LocalPort 11434\n",[22,5195,5196,5201,5214,5219,5229,5233,5238],{"__ignoreMap":357},[361,5197,5198],{"class":363,"line":364},[361,5199,5200],{"class":1425},"# Linux/macOS: confirm something is listening on 11434\n",[361,5202,5203,5205,5207,5209,5211],{"class":363,"line":497},[361,5204,1947],{"class":367},[361,5206,1950],{"class":371},[361,5208,1953],{"class":629},[361,5210,1956],{"class":367},[361,5212,5213],{"class":371}," 11434\n",[361,5215,5216],{"class":363,"line":503},[361,5217,5218],{"class":1425},"# or\n",[361,5220,5221,5223,5226],{"class":363,"line":509},[361,5222,1933],{"class":367},[361,5224,5225],{"class":371}," -iTCP:11434",[361,5227,5228],{"class":371}," -sTCP:LISTEN\n",[361,5230,5231],{"class":363,"line":515},[361,5232,646],{"emptyLinePlaceholder":645},[361,5234,5235],{"class":363,"line":677},[361,5236,5237],{"class":1425},"# Windows PowerShell equivalent\n",[361,5239,5240,5243,5246],{"class":363,"line":692},[361,5241,5242],{"class":367},"Get-NetTCPConnection",[361,5244,5245],{"class":371}," -LocalPort",[361,5247,5213],{"class":371},[15,5249,5250,5251,5253],{},"If Ollama is running on a remote machine or a different host, bind Ollama to an accessible address. By default, Ollama only listens on ",[22,5252,592],{},", so only the local machine can reach it. To accept connections from other machines or WSL2:",[352,5255,5257],{"className":354,"code":5256,"language":356,"meta":357,"style":357},"OLLAMA_HOST=0.0.0.0:11434 ollama serve\n",[22,5258,5259],{"__ignoreMap":357},[361,5260,5261,5263,5265,5268,5270],{"class":363,"line":364},[361,5262,1976],{"class":633},[361,5264,665],{"class":629},[361,5266,5267],{"class":375},"0.0.0.0:11434",[361,5269,1984],{"class":367},[361,5271,1987],{"class":375},[15,5273,5274,5277,5278,5280,5281,5283],{},[37,5275,5276],{},"Firewall and antivirus interference."," Windows Defender, corporate firewalls, and some endpoint protection tools (CrowdStrike, SentinelOne) commonly block Ollama's port. If ",[22,5279,368],{}," works from the same machine but a different machine can't reach Ollama even with ",[22,5282,1812],{}," binding, the firewall is dropping the connection — add an inbound rule for TCP 11434.",[15,5285,5286,5287,5289],{},"If you're running both OpenClaw and Ollama in Docker containers, they need to share a Docker network or use the host's network. Containers can't reach each other via ",[22,5288,584],{}," unless they're on the same network or using host networking mode.",[15,5291,5292,5293,5297,5298,5301],{},"For the broader ",[67,5294,5296],{"href":5295},"/blog/openclaw-setup-guide-complete","OpenClaw setup sequence"," and where Ollama configuration fits in the process, our ",[67,5299,5300],{"href":5295},"setup guide"," walks through each step in the correct order.",[15,5303,5304],{},[47,5305],{"alt":5306,"src":5307},"OpenClaw Ollama ECONNREFUSED error","/img/blog/openclaw-ollama-econnrefused.jpg",[52,5309,4738],{"id":5310},"tui-fetch-failed-ollama",[15,5312,5313,5315],{},[37,5314,4749],{}," The OpenClaw TUI (terminal user interface) shows \"fetch failed\" when you try to select or switch to an Ollama model.",[15,5317,5318,5320],{},[37,5319,4755],{}," This is the same underlying connection issue as the other fetch failed errors, but triggered from the TUI model selection interface instead of during startup. The TUI tries to query Ollama when you interact with the model picker, and the request fails.",[15,5322,5323,5325],{},[37,5324,4158],{}," All the same fixes apply: verify Ollama is running, check the port and URL, handle WSL2 networking, and pre-load models. The TUI doesn't have a different connection path. It uses the same provider configuration as the gateway.",[15,5327,5328],{},"One additional cause specific to the TUI: if you started OpenClaw without Ollama running, then started Ollama later, the TUI might have cached the failed connection state. Restart the OpenClaw gateway after starting Ollama to clear the cache.",[15,5330,5331],{},"Every Ollama fetch failed error comes back to the same question: can OpenClaw actually reach Ollama's HTTP API? Verify the URL, verify the port, verify the network path. The specific error variant tells you where in the process it failed, but the fix is always about making the connection work.",[15,5333,5334],{},[47,5335],{"alt":5336,"src":5337},"OpenClaw TUI fetch failed Ollama model selection","/img/blog/openclaw-ollama-tui-fetch-failed.jpg",[52,5339,5341,5342],{"id":5340},"prevention-ollama-launch-openclaw","Prevention: ",[22,5343,3730],{},[15,5345,5346,5347,5350],{},"If you're setting up fresh, skip the manual provider config entirely. Ollama 0.17+ ships a ",[22,5348,5349],{},"launch"," subcommand that auto-installs and configures OpenClaw to use the local Ollama daemon:",[352,5352,5354],{"className":354,"code":5353,"language":356,"meta":357,"style":357},"ollama launch openclaw --model qwen3-coder:30b\n",[22,5355,5356],{"__ignoreMap":357},[361,5357,5358,5360,5362,5365,5367],{"class":363,"line":364},[361,5359,1447],{"class":367},[361,5361,3176],{"class":375},[361,5363,5364],{"class":375}," openclaw",[361,5366,3182],{"class":371},[361,5368,5369],{"class":375}," qwen3-coder:30b\n",[15,5371,5372,5373,5375],{},"It picks the right native ",[22,5374,3717],{},", pulls the model if needed, and writes the provider config for you. Most of the errors above don't happen when you start this way.",[52,5377,5379],{"id":5378},"the-root-cause-behind-all-of-these-errors","The root cause behind all of these errors",[15,5381,5382],{},"Every error on this page is a variation of \"OpenClaw tried to make an HTTP request to Ollama and it didn't work.\" The reasons vary (Ollama not running, wrong port, WSL2 boundary, model not loaded, firewall blocking), but the diagnostic approach is the same.",[15,5384,5385,5388],{},[37,5386,5387],{},"Can you reach Ollama's API from the same machine where OpenClaw is running?"," If yes, make sure your OpenClaw config points to the same URL. If no, fix the network path first.",[15,5390,5391],{},"OpenClaw's error messages for Ollama failures are frustratingly generic — \"fetch failed\" can mean any of six different things, and better Ollama-specific messages have been requested in multiple GitHub issues. Until they improve, this page exists so you don't have to guess which \"fetch failed\" you're dealing with.",[15,5393,5394,5395,5398,5399,5401,5402,25],{},"For the broader context, our ",[67,5396,5397],{"href":2798},"Ollama troubleshooting guide"," covers the native vs ",[22,5400,2578],{}," distinction, recommended models, and whether local inference is worth the effort versus ",[67,5403,5405],{"href":5404},"/blog/cheapest-openclaw-ai-providers","cloud APIs",[52,5407,5409],{"id":5408},"when-local-stops-being-worth-it","When local stops being worth it",[15,5411,5412,5413,5416],{},"Once the connection is fixed and you're on the native Ollama provider, tool calling works locally. The remaining trade-off is model capability: local models under ~30B parameters still struggle with multi-step agent reasoning, and cloud inference is faster per-token. If your use case is privacy or offline operation, fix the fetch errors and stay local. If it's \"I want an agent that can actually do things and I don't want to manage hardware,\" cloud providers (DeepSeek, Gemini, Claude Haiku) run a moderate agent for a few dollars a month — our ",[67,5414,5415],{"href":5404},"provider cost guide"," covers current pricing.",[15,5418,5419,5420,5424],{},"If you'd rather skip Ollama entirely and get an agent running on cloud providers in 60 seconds, ",[67,5421,5423],{"href":5422},"/","BetterClaw"," supports 28+ providers with zero local model configuration. $49/month for Pro, BYOK. Pick your model from a dropdown — no Ollama, no fetch errors, no port conflicts.",[52,5426,5427],{"id":3588},"Frequently asked questions",[344,5429,5431],{"id":5430},"what-causes-the-openclaw-ollama-fetch-failed-error","What causes the OpenClaw Ollama \"fetch failed\" error?",[15,5433,5434,5435,1498],{},"The \"fetch failed\" error means OpenClaw can't reach Ollama's HTTP API. The most common causes are: Ollama not running, wrong port or URL in the OpenClaw config, WSL2 networking boundary (localhost doesn't cross WSL2/Windows), Ollama not finished loading the model (timeout), or a firewall blocking the connection. The fix is always about verifying the network path between OpenClaw and Ollama's API endpoint (default: ",[22,5436,2162],{},[344,5438,5440],{"id":5439},"how-does-failed-to-discover-ollama-models-differ-from-fetch-failed","How does \"failed to discover Ollama models\" differ from \"fetch failed\"?",[15,5442,5443],{},"\"Fetch failed\" means the HTTP connection itself failed. \"Failed to discover Ollama models\" means the connection might partially work but the model list query specifically fails, usually because Ollama hasn't finished loading a model. The fix for discovery failures: pre-load your model before starting OpenClaw, or define models explicitly in the config to bypass auto-discovery entirely.",[344,5445,5447],{"id":5446},"how-do-i-fix-openclaw-ollama-connection-issues-on-wsl2","How do I fix OpenClaw Ollama connection issues on WSL2?",[15,5449,5450,5451,5453,5454,5456,5457,3718,5459,5461],{},"WSL2 creates a network boundary between the Linux environment and the Windows host. ",[22,5452,592],{}," doesn't resolve across this boundary. If OpenClaw runs in WSL2 and Ollama runs on Windows (or vice versa), use the actual WSL2 IP address (from the ",[22,5455,4895],{}," command) in your OpenClaw config instead of localhost. Also set ",[22,5458,1976],{},[22,5460,5267],{}," so Ollama accepts connections from outside localhost.",[344,5463,5465],{"id":5464},"is-fixing-ollama-fetch-errors-worth-the-effort-versus-using-cloud-apis","Is fixing Ollama fetch errors worth the effort versus using cloud APIs?",[15,5467,5468,5469,5472,5473,5475],{},"It depends on your use case. If you need data privacy, offline operation, or want local heartbeats, fixing Ollama is worth it — tool calling works once you're on OpenClaw's native Ollama provider (",[22,5470,5471],{},"/api/chat",", no ",[22,5474,2578],{},"). If you need top-end reasoning and you'd rather not manage hardware, cloud providers like DeepSeek or Gemini's free tier are cheaper than most people expect.",[344,5477,5479],{"id":5478},"will-openclaw-fix-the-ollama-error-messages","Will OpenClaw fix the Ollama error messages?",[15,5481,5482,5483,5485],{},"The \"fetch failed\" wording is a known complaint and better Ollama-specific messages have been requested in multiple GitHub issues. Improvements are landing in the open-source repo on a rolling basis. Until error messages get more specific, this guide maps each generic error to its actual cause — pair it with ",[22,5484,4695],{}," for the fastest diagnosis.",[52,5487,4476],{"id":4475},[434,5489,5490,5496,5502,5509,5515],{},[104,5491,5492,5495],{},[67,5493,5494],{"href":885},"Ollama Connection Refused or Fetch Failed: Every Fix",": Non-OpenClaw Ollama errors, including n8n, VS Code, Claude Code, Windows and Python",[104,5497,5498,5501],{},[67,5499,5500],{"href":2798},"OpenClaw Local Model Not Working: Complete Fix Guide"," — Broader local model troubleshooting beyond Ollama fetch errors",[104,5503,5504,5508],{},[67,5505,5507],{"href":5506},"/blog/openclaw-model-does-not-support-tools","\"Model Does Not Support Tools\" Fix"," — Tool calling failures with Ollama models",[104,5510,5511,5514],{},[67,5512,5513],{"href":5053},"OpenClaw Ollama Guide: Complete Setup"," — Full Ollama integration setup from scratch",[104,5516,5517,5521],{},[67,5518,5520],{"href":5519},"/blog/openclaw-local-model-hardware","OpenClaw Local Model Hardware Requirements"," — RAM, GPU, and storage specs for local inference",[979,5523,5524],{},"html pre.shiki code .sAwPA, html code.shiki .sAwPA{--shiki-default:#6A737D}html pre.shiki code .s7eDp, html code.shiki .s7eDp{--shiki-default:#6F42C1}html pre.shiki code .sYBdl, html code.shiki .sYBdl{--shiki-default:#032F62}html pre.shiki code .sYu0t, html code.shiki .sYu0t{--shiki-default:#005CC5}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .shJU0, html code.shiki .shJU0{--shiki-default:#22863A}html pre.shiki code .sgsFI, html code.shiki .sgsFI{--shiki-default:#24292E}html pre.shiki code .sD7c4, html code.shiki .sD7c4{--shiki-default:#D73A49}",{"title":357,"searchDepth":497,"depth":497,"links":5526},[5527,5528,5529,5530,5531,5532,5533,5534,5536,5537,5538,5545],{"id":4637,"depth":497,"text":4638},{"id":4744,"depth":497,"text":209},{"id":4934,"depth":497,"text":4714},{"id":5064,"depth":497,"text":4720},{"id":5096,"depth":497,"text":4726},{"id":5175,"depth":497,"text":4732},{"id":5310,"depth":497,"text":4738},{"id":5340,"depth":497,"text":5535},"Prevention: ollama launch openclaw",{"id":5378,"depth":497,"text":5379},{"id":5408,"depth":497,"text":5409},{"id":3588,"depth":497,"text":5427,"children":5539},[5540,5541,5542,5543,5544],{"id":5430,"depth":503,"text":5431},{"id":5439,"depth":503,"text":5440},{"id":5446,"depth":503,"text":5447},{"id":5464,"depth":503,"text":5465},{"id":5478,"depth":503,"text":5479},{"id":4475,"depth":497,"text":4476},"2026-04-01","Seeing \"Failed to discover Ollama models: TypeError: fetch failed\" in OpenClaw? Covers ECONNREFUSED, TUI fetch failed, timeout errors, and model-not-found — with a fix for each.","/img/blog/openclaw-ollama-fetch-failed.jpg",{},"10 min read",{"title":4552,"description":5547},"Fix: \"TypeError: Fetch Failed\" in OpenClaw — All 6 Ollama Error Variants","blog/openclaw-ollama-fetch-failed",[881,5555,5556,5557,5558,5559],"failed to discover Ollama models","OpenClaw Ollama TypeError","OpenClaw Ollama not responding","OpenClaw Ollama timeout","OpenClaw Ollama connection","2026-05-19","saNUtROaSM66zhdx_7wH3cPjX0c0hOYH67NKeQHicCM",1790085094947]