[GH-ISSUE #28] The /api/tags route doesn't load #115216

Closed
opened 2026-05-20 16:51:06 -05:00 by GiteaMirror · 13 comments
Owner

Originally created by @horiacristescu on GitHub (Oct 23, 2023).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/28

Originally assigned to: @tjbck on GitHub.

Describe the bug

The model list remains empty. When I look into the network tab, I see the /api/tags route fails

http://myhost:11434/api/tags
Failed to load resource: net::ERR_CONNECTION_REFUSED

However, the error doesn't always appear:

  • When loading the page from localhost on Ubuntu with Chrome, it works
  • When loading by IP address on macbook, it fails in all 3 browsers (Chrome, FF, Edge). It even fails with VS Code port forwarding, loading as http://0.0.0.0:3000/ on Mac.

To Reproduce
Steps to reproduce the behavior:

  1. Load thee root page
  2. The model list is empty

Expected behavior
Model list should load from all browsers and loaded on 0.0.0.0 or IP

I tried

docker build --build-arg PUBLIC_API_BASE_URL='http://192.168.0.185:11434/api' --build-arg OLLAMA_API_BASE_URL='http://192.168.0.185:11434/api' -t ollama-webui .

and

docker build --build-arg OLLAMA_API_BASE_URL='http://192.168.0.185:11434/api' -t ollama-webui .
Originally created by @horiacristescu on GitHub (Oct 23, 2023). Original GitHub issue: https://github.com/open-webui/open-webui/issues/28 Originally assigned to: @tjbck on GitHub. **Describe the bug** The model list remains empty. When I look into the network tab, I see the /api/tags route fails http://myhost:11434/api/tags Failed to load resource: net::ERR_CONNECTION_REFUSED However, the error doesn't always appear: - When loading the page from localhost on Ubuntu with Chrome, it works - When loading by IP address on macbook, it fails in all 3 browsers (Chrome, FF, Edge). It even fails with VS Code port forwarding, loading as http://0.0.0.0:3000/ on Mac. **To Reproduce** Steps to reproduce the behavior: 1. Load thee root page 2. The model list is empty **Expected behavior** Model list should load from all browsers and loaded on 0.0.0.0 or IP I tried ``` docker build --build-arg PUBLIC_API_BASE_URL='http://192.168.0.185:11434/api' --build-arg OLLAMA_API_BASE_URL='http://192.168.0.185:11434/api' -t ollama-webui . ``` and ``` docker build --build-arg OLLAMA_API_BASE_URL='http://192.168.0.185:11434/api' -t ollama-webui . ```
Author
Owner

@tjbck commented on GitHub (Oct 23, 2023):

Hi, It's most likely caused by a CORS error, make sure to run the following command to serve Ollama, as mentioned here, which should solve your issue:

OLLAMA_HOST=0.0.0.0 OLLAMA_ORIGINS=* ollama serve

Keep me updated, Thanks.

<!-- gh-comment-id:1775861984 --> @tjbck commented on GitHub (Oct 23, 2023): Hi, It's most likely caused by a CORS error, make sure to run the following command to serve Ollama, as mentioned [here](https://github.com/ollama-webui/ollama-webui#accessing-ollama-web-interface-over-lan), which should solve your issue: ```sh OLLAMA_HOST=0.0.0.0 OLLAMA_ORIGINS=* ollama serve ``` Keep me updated, Thanks.
Author
Owner

@awptechnologies commented on GitHub (Oct 25, 2023):

same thing for me. Also to even get web page to load i had to map port to 3000 inside to container instead of the 8080 in the read me.

to build image i coppied the latest release to my host. ran docker build inside the ollama folder.

image build was successful but when the page loaded the model list was empty.

I am able to interact with the model fine through the cli.

Also im using docker and i passed the environment vairiable OLLAMA_ORIGINS="*" and under docker ps i see the command as ollama serve.

<!-- gh-comment-id:1778654324 --> @awptechnologies commented on GitHub (Oct 25, 2023): same thing for me. Also to even get web page to load i had to map port to 3000 inside to container instead of the 8080 in the read me. to build image i coppied the latest release to my host. ran docker build inside the ollama folder. image build was successful but when the page loaded the model list was empty. I am able to interact with the model fine through the cli. Also im using docker and i passed the environment vairiable OLLAMA_ORIGINS="*" and under docker ps i see the command as ollama serve.
Author
Owner

@tjbck commented on GitHub (Oct 25, 2023):

@awptechnologies Hi, the latest release isn't up to date yet, please clone the repo and build from there instead. Regarding the connection error, the environment variable must be passed to Ollama itself, not the WebUI. Thanks.

<!-- gh-comment-id:1778707947 --> @tjbck commented on GitHub (Oct 25, 2023): @awptechnologies Hi, the latest release isn't up to date yet, please clone the repo and build from there instead. Regarding the connection error, the environment variable must be passed to Ollama itself, not the WebUI. Thanks.
Author
Owner
<!-- gh-comment-id:1778710046 --> @tjbck commented on GitHub (Oct 25, 2023): https://github.com/ollama-webui/ollama-webui#accessing-ollama-web-interface-over-lan
Author
Owner

@awptechnologies commented on GitHub (Oct 25, 2023):

That's what I did I passed environment variable to ollama/ollama container image. Web ui has no environment variables passed through. Only the original build aurg.

I didn't understand first part where do I need to cone release from?

<!-- gh-comment-id:1779546213 --> @awptechnologies commented on GitHub (Oct 25, 2023): That's what I did I passed environment variable to ollama/ollama container image. Web ui has no environment variables passed through. Only the original build aurg. I didn't understand first part where do I need to cone release from?
Author
Owner

@awptechnologies commented on GitHub (Oct 25, 2023):

Kinda new to github. I know how to use git but what is the link for the repository. Where do I clone into.

Can you provide a link for me

<!-- gh-comment-id:1779548513 --> @awptechnologies commented on GitHub (Oct 25, 2023): Kinda new to github. I know how to use git but what is the link for the repository. Where do I clone into. Can you provide a link for me
Author
Owner

@awptechnologies commented on GitHub (Oct 25, 2023):

figured it out. Github is the bomb. This worked perfectly. It also fixed the webpage being hosted at 8080. Love the project. Any idea when it will be able to use the internet. Awesome feeling having these resources locally. Im at the point where im done with all this big businesses.

<!-- gh-comment-id:1779631082 --> @awptechnologies commented on GitHub (Oct 25, 2023): figured it out. Github is the bomb. This worked perfectly. It also fixed the webpage being hosted at 8080. Love the project. Any idea when it will be able to use the internet. Awesome feeling having these resources locally. Im at the point where im done with all this big businesses.
Author
Owner

@awptechnologies commented on GitHub (Oct 25, 2023):

now my question. I have it all working perfect. I use haproxy as reverse proxy and when i try and set up the web ui to use my domain and ssl certs server connection fails. Any ideas? is there a setting i need to have for this to work??

<!-- gh-comment-id:1779642894 --> @awptechnologies commented on GitHub (Oct 25, 2023): now my question. I have it all working perfect. I use haproxy as reverse proxy and when i try and set up the web ui to use my domain and ssl certs server connection fails. Any ideas? is there a setting i need to have for this to work??
Author
Owner

@tjbck commented on GitHub (Oct 26, 2023):

@awptechnologies Hmm, I'm not so sure. In theory, there shouldn't be any issues caused by the Web UI. Keep us updated if you find a solution. Thanks.

<!-- gh-comment-id:1780374966 --> @tjbck commented on GitHub (Oct 26, 2023): @awptechnologies Hmm, I'm not so sure. In theory, there shouldn't be any issues caused by the Web UI. Keep us updated if you find a solution. Thanks.
Author
Owner

@awptechnologies commented on GitHub (Oct 26, 2023):

@tjbck So... I have gotten it to work.. I technically don't like the way i did it though. So the way i did it. I set up the webUI with reverse proxy set server and port and used ollama.mydomain.com to access it. This like mentioned before left the error of not being able to connect to server. i had to then set up a reverse proxy for the API as well. So again set server and port 11434 for API, and used ollamaapi.mydomain.com. Once i did this and set the ollamaapi.mydomain.com as server for webgui it works. The reason i don't like this is because i wanted to set this up with cloudflare so i can access it publicly. with having to do it this way i had to also expose the API. Best way i can describe it is it is using the front end of the web page to contact the server instead of going through the backend. The ideal setup would be to leave the API accessible only on private network and expose only the web GUI. When setting up cloud-flare i tried to only expose the web GUI and doing this led to the error. The only way i could get it to work is expose the API publicly as well.... Any ideas?

<!-- gh-comment-id:1780407008 --> @awptechnologies commented on GitHub (Oct 26, 2023): @tjbck So... I have gotten it to work.. I technically don't like the way i did it though. So the way i did it. I set up the webUI with reverse proxy set server and port and used ollama.mydomain.com to access it. This like mentioned before left the error of not being able to connect to server. i had to then set up a reverse proxy for the API as well. So again set server and port 11434 for API, and used ollamaapi.mydomain.com. Once i did this and set the ollamaapi.mydomain.com as server for webgui it works. The reason i don't like this is because i wanted to set this up with cloudflare so i can access it publicly. with having to do it this way i had to also expose the API. Best way i can describe it is it is using the front end of the web page to contact the server instead of going through the backend. The ideal setup would be to leave the API accessible only on private network and expose only the web GUI. When setting up cloud-flare i tried to only expose the web GUI and doing this led to the error. The only way i could get it to work is expose the API publicly as well.... Any ideas?
Author
Owner

@awptechnologies commented on GitHub (Oct 26, 2023):

i am running this in docker swarm and they are together in a stack so technically they are directly connected to each other. I figured they would be able to communicate regardless of how i access it on the front end...

<!-- gh-comment-id:1780408657 --> @awptechnologies commented on GitHub (Oct 26, 2023): i am running this in docker swarm and they are together in a stack so technically they are directly connected to each other. I figured they would be able to communicate regardless of how i access it on the front end...
Author
Owner

@awptechnologies commented on GitHub (Oct 26, 2023):

when you go to ollama.mydomain.com it only shows ollama is running. so i don't think there is any way for bad actors to mess with it just don't like the idea of the backend being accessible from anyone that knows domain.

<!-- gh-comment-id:1780409916 --> @awptechnologies commented on GitHub (Oct 26, 2023): when you go to ollama.mydomain.com it only shows ollama is running. so i don't think there is any way for bad actors to mess with it just don't like the idea of the backend being accessible from anyone that knows domain.
Author
Owner

@tjbck commented on GitHub (Oct 27, 2023):

Maybe you could try @coolaj86's method of running the Web UI. I'm not so sure about how to fix your problem.

<!-- gh-comment-id:1782201465 --> @tjbck commented on GitHub (Oct 27, 2023): Maybe you could try @coolaj86's method of running the Web UI. I'm not so sure about how to fix your problem.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#115216