[GH-ISSUE #585] anythingllm container not able to communicate with local ollama/lacalai models running on local host on Ubuntu #338

Closed
opened 2026-02-22 18:19:01 -05:00 by yindo · 11 comments
Owner

Originally created by @bokey007 on GitHub (Jan 13, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/585

          its the same issue with me

Primary server in HTTP mode listening on port 3001
TypeError: fetch failed
at Object.fetch (node:internal/deps/undici/undici:11730:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async ollamaAIModels (/app/server/utils/helpers/customModels.js:84:18)
at async getCustomModels (/app/server/utils/helpers/customModels.js:20:14)
at async /app/server/endpoints/system.js:769:35 {
cause: Error: getaddrinfo ENOTFOUND host.docker.internal
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26) {
errno: -3008,
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'host.docker.internal'
}
}

@timothycarambat I am facing this issue with both ollama and localAi

I think, this problem is specifically for linux machines.

Originally posted by @bokey007 in https://github.com/Mintplex-Labs/anything-llm/issues/495#issuecomment-1890304226

Originally created by @bokey007 on GitHub (Jan 13, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/585 its the same issue with me Primary server in HTTP mode listening on port 3001 TypeError: fetch failed at Object.fetch (node:internal/deps/undici/undici:11730:11) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async ollamaAIModels (/app/server/utils/helpers/customModels.js:84:18) at async getCustomModels (/app/server/utils/helpers/customModels.js:20:14) at async /app/server/endpoints/system.js:769:35 { cause: Error: getaddrinfo ENOTFOUND host.docker.internal at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26) { errno: -3008, code: 'ENOTFOUND', syscall: 'getaddrinfo', hostname: 'host.docker.internal' } } @timothycarambat I am facing this issue with both ollama and localAi I think, this problem is specifically for linux machines. _Originally posted by @bokey007 in https://github.com/Mintplex-Labs/anything-llm/issues/495#issuecomment-1890304226_
yindo added the questionwontfix labels 2026-02-22 18:19:01 -05:00
yindo closed this issue 2026-02-22 18:19:01 -05:00
Author
Owner

@sumitsodhi88 commented on GitHub (Jan 13, 2024):

Screenshot 2024-01-13 235745

Did you try this? It solved the issue for me.

@sumitsodhi88 commented on GitHub (Jan 13, 2024): ![Screenshot 2024-01-13 235745](https://github.com/Mintplex-Labs/anything-llm/assets/149290101/c2edcdfb-37d5-4030-bb5c-edcfd72f1196) Did you try this? It solved the issue for me.
Author
Owner

@bokey007 commented on GitHub (Jan 13, 2024):

Hi @sumitsodhi88 appreciate the response, yes I did. It did not work.

What was the operating system, u were working on?

@bokey007 commented on GitHub (Jan 13, 2024): Hi @sumitsodhi88 appreciate the response, yes I did. It did not work. What was the operating system, u were working on?
Author
Owner

@sumitsodhi88 commented on GitHub (Jan 13, 2024):

Hi @sumitsodhi88 appreciate the response, yes I did. It did not work.

What was the operating system, u were working on?

I am using windows 11. I am a very newbie so all I did was format my pc. Installed wsl. Ran one command for Nvidia support. Installed Ollama in docker only. Can't tell what I did right 🤣

Maybe if you install ollama in docker it might work.

@sumitsodhi88 commented on GitHub (Jan 13, 2024): > Hi @sumitsodhi88 appreciate the response, yes I did. It did not work. > > What was the operating system, u were working on? I am using windows 11. I am a very newbie so all I did was format my pc. Installed wsl. Ran one command for Nvidia support. Installed Ollama in docker only. Can't tell what I did right 🤣 Maybe if you install ollama in docker it might work.
Author
Owner

@timothycarambat commented on GitHub (Jan 13, 2024):

This issue is certainly on your side and has to do with networking. So host.docker.internal is a special name when used within a docker container that allows it to access the host system localhost. However, both applications need to be running on the same machine. Alternatively, you can put the host machine's local IP as the address and it should still resolve. I do not think host.docker.internal works on ubuntu machines, as its part of docker engine.

@timothycarambat commented on GitHub (Jan 13, 2024): This issue is certainly on your side and has to do with networking. So `host.docker.internal` is a special name when used within a docker container that allows it to access the host system `localhost`. However, both applications need to be running on the same machine. Alternatively, you can put the host machine's local IP as the address and it should still resolve. ~I do not think `host.docker.internal` works on ubuntu machines, as its part of docker engine.~
Author
Owner

@Botoni commented on GitHub (Jan 17, 2024):

If it helps with anything, the host.docker.internal addres works for me in my linux machine, in my case Fedora 39 and Lm studio.

@Botoni commented on GitHub (Jan 17, 2024): If it helps with anything, the host.docker.internal addres works for me in my linux machine, in my case Fedora 39 and Lm studio.
Author
Owner

@befama commented on GitHub (Jan 23, 2025):

I'm having similar problems. On Ubuntu 24.04. the error is the following: error: TypeError: fetch failed
at node:internal/deps/undici/undici:12618:11
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async bocamaAIModels (/app/server/utils/helpers/customModels.js:310:18)
at async getCustomModels (/app/server/utils/helpers/customModels.js:45:14)
at async /app/server/endpoints/system.js:953:35

Indeed host.docker.internal did not work for me on Ubuntu 24.04. Leaving the IP did not work either. I appreciate the help.

@befama commented on GitHub (Jan 23, 2025): I'm having similar problems. On Ubuntu 24.04. the error is the following: error: TypeError: fetch failed at node:internal/deps/undici/undici:12618:11 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async bocamaAIModels (/app/server/utils/helpers/customModels.js:310:18) at async getCustomModels (/app/server/utils/helpers/customModels.js:45:14) at async /app/server/endpoints/system.js:953:35 Indeed host.docker.internal did not work for me on Ubuntu 24.04. Leaving the IP did not work either. I appreciate the help.
Author
Owner

@timothycarambat commented on GitHub (Jan 23, 2025):

Ubuntu 24.04.

We need to add this to the docs page, but on ubuntu that docker workaround does not work. Instead it is this IP 172.17.0.1 unless you run the container with --add-host=host.docker.internal:host-gateway.

Just a Docker linux quirk

@timothycarambat commented on GitHub (Jan 23, 2025): > Ubuntu 24.04. We need to add this to the docs page, but on ubuntu that docker workaround does not work. Instead it is this IP `172.17.0.1` _unless_ you run the container with `--add-host=host.docker.internal:host-gateway`. Just a Docker linux quirk
Author
Owner

@befama commented on GitHub (Jan 25, 2025):

Ubuntu 24.04.

We need to add this to the docs page, but on ubuntu that docker workaround does not work. Instead it is this IP 172.17.0.1 unless you run the container with --add-host=host.docker.internal:host-gateway.

Just a Docker linux quirk

Thanks for your reply.
The address you provided works just like the IP address assignment of the computer running Ollama. Thanks for that. However, the problem persists.

Despite configuring AnythingLLM with 172.17.0.1:11434 or the computer's IP address followed by :11434, and correctly selecting the installed models in Ollama, the problem occurs when I try to send a request in the chat. AnythingLLM doesn't seem to receive any response from Ollama and continues to display the following error, leaving the chat screen blank every time a message is sent. This never happened to me on ubuntu 22.04 the problem appears on ubuntu 24.04.01 version.

consulted docker logs appears: error: TypeError: fetch failed
at node:internal/deps/undici/undici:12618:11
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async bocamaAIModels (/app/server/utils/helpers/customModels.js:310:18)
at async getCustomModels (/app/server/utils/helpers/customModels.js:45:14)
at async /app/server/endpoints/system.js:953:35

@befama commented on GitHub (Jan 25, 2025): > > Ubuntu 24.04. > > We need to add this to the docs page, but on ubuntu that docker workaround does not work. Instead it is this IP `172.17.0.1` _unless_ you run the container with `--add-host=host.docker.internal:host-gateway`. > > Just a Docker linux quirk Thanks for your reply. The address you provided works just like the IP address assignment of the computer running Ollama. Thanks for that. However, the problem persists. Despite configuring AnythingLLM with 172.17.0.1:11434 or the computer's IP address followed by :11434, and correctly selecting the installed models in Ollama, the problem occurs when I try to send a request in the chat. AnythingLLM doesn't seem to receive any response from Ollama and continues to display the following error, leaving the chat screen blank every time a message is sent. This never happened to me on ubuntu 22.04 the problem appears on ubuntu 24.04.01 version. consulted docker logs appears: error: TypeError: fetch failed at node:internal/deps/undici/undici:12618:11 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async bocamaAIModels (/app/server/utils/helpers/customModels.js:310:18) at async getCustomModels (/app/server/utils/helpers/customModels.js:45:14) at async /app/server/endpoints/system.js:953:35
Author
Owner

@timothycarambat commented on GitHub (Jan 27, 2025):

getCustomModels is only ever called on the model selection page, so is not possible for that error to come from the chat page.

If the model dropdown populates, the connection works and so will chats. There is no way for us to only reach the models endpoint but on that same URL not be able to reach the chat completions

@timothycarambat commented on GitHub (Jan 27, 2025): `getCustomModels` is only ever called on the model selection page, so is not possible for that error to come from the chat page. If the model dropdown populates, the connection works and so will chats. There is no way for us to only reach the `models` endpoint but on that same URL not be able to reach the `chat` completions
Author
Owner

@ingvardm commented on GitHub (Feb 1, 2025):

Same issue over here. Everything can connect to my local ollama except Anything-llm that runs on same machene.

@ingvardm commented on GitHub (Feb 1, 2025): Same issue over here. Everything can connect to my local ollama except Anything-llm that runs on same machene.
Author
Owner

@timothycarambat commented on GitHub (Feb 1, 2025):

@ingvardm Like others, are you trying to use localhost in a docker container?

On non-linux: localhost => host.docker.internal
On linux/Ubunut: localhost => 172.17.0.1

https://github.com/Mintplex-Labs/anything-llm/issues/585#issuecomment-2610832931

@timothycarambat commented on GitHub (Feb 1, 2025): @ingvardm Like others, are you trying to use `localhost` in a docker container? On non-linux: localhost => `host.docker.internal` On linux/Ubunut: localhost => `172.17.0.1` https://github.com/Mintplex-Labs/anything-llm/issues/585#issuecomment-2610832931
yindo changed title from anythingllm container not able to communicate with local ollama/lacalai models running on local host on Ubuntu to [GH-ISSUE #585] anythingllm container not able to communicate with local ollama/lacalai models running on local host on Ubuntu 2026-06-05 14:34:47 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#338