Server Connection Failed #66

Closed
opened 2025-11-11 14:03:41 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @RasPintz on GitHub (Nov 29, 2023).

Describe the bug
Seems Ollama-webui can't contact ollama server

To Reproduce
I installed ollama server on LTS 22.04 Ubuntu and tryed ollama-webui while cloning the repo and with docker instance.
Both can't connect to ollama server.

I launched ollama server with systemctl and bash

OLLAMA_HOST=0.0.0.0 OLLAMA_ORIGINS=* ollama serve

ollama standard client works fine

OLLAMA_HOST=127.0.0.1:11434 ollama run codellama
>>> Send a message (/? for help)

curl working too (tested with url http://localhost:11434/api/generate -d )

when launching it with npm run dev, I got this error (like api/v1 not working anymore with ollama server) :

Error: Not found: /api/v1/
    at resolve (/home/XXX/ollama-webui/node_modules/@sveltejs/kit/src/runtime/server/respond.js:483:13)
    at resolve (/home/XXX/ollama-webui/node_modules/@sveltejs/kit/src/runtime/server/respond.js:277:5)
    at #options.hooks.handle (/home/XXX/ollama-webui/node_modules/@sveltejs/kit/src/runtime/server/index.js:49:56)
    at Module.respond (/home/XXX/ollama-webui/node_modules/@sveltejs/kit/src/runtime/server/respond.js:274:40)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Expected behavior
Webui connected to the ollama server

Screenshots
None

Desktop (please complete the following information):

  • OS: Ubuntu 22.04.3 LTS
  • Ollama version 0.1.12
  • Browser webui accessible
  • Version master branch

Additional context
Computer is on GCP, port (8080) of the webui is opened and accessible over my webbrowser no other port accessible
Launch seemed fine :

  VITE v4.4.11  ready in 1437 ms

  ➜  Local:   http://localhost:8080/

Thanks for help

Originally created by @RasPintz on GitHub (Nov 29, 2023). **Describe the bug** Seems Ollama-webui can't contact ollama server **To Reproduce** I installed ollama server on LTS 22.04 Ubuntu and tryed ollama-webui while cloning the repo and with docker instance. Both can't connect to ollama server. I launched ollama server with systemctl and bash ```bash OLLAMA_HOST=0.0.0.0 OLLAMA_ORIGINS=* ollama serve ``` ollama standard client works fine ```bash OLLAMA_HOST=127.0.0.1:11434 ollama run codellama >>> Send a message (/? for help) ``` curl working too (tested with url http://localhost:11434/api/generate -d ) when launching it with npm run dev, I got this error (like api/v1 not working anymore with ollama server) : ```bash Error: Not found: /api/v1/ at resolve (/home/XXX/ollama-webui/node_modules/@sveltejs/kit/src/runtime/server/respond.js:483:13) at resolve (/home/XXX/ollama-webui/node_modules/@sveltejs/kit/src/runtime/server/respond.js:277:5) at #options.hooks.handle (/home/XXX/ollama-webui/node_modules/@sveltejs/kit/src/runtime/server/index.js:49:56) at Module.respond (/home/XXX/ollama-webui/node_modules/@sveltejs/kit/src/runtime/server/respond.js:274:40) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) ``` **Expected behavior** Webui connected to the ollama server **Screenshots** None **Desktop (please complete the following information):** - OS: Ubuntu 22.04.3 LTS - Ollama version 0.1.12 - Browser webui accessible - Version master branch **Additional context** Computer is on GCP, port (8080) of the webui is opened and accessible over my webbrowser no other port accessible Launch seemed fine : ```bash VITE v4.4.11 ready in 1437 ms ➜ Local: http://localhost:8080/ ``` Thanks for help
Author
Owner

@tjbck commented on GitHub (Nov 29, 2023):

Hi, Just to make sure, is the Ollama instance also running on the same server as the WebUI? Please provide us with the exact commands you ran for faster help. I'll close this issue for now as if you have everything setup correctly, we've verified that it works perfectly on macos, ubuntu and windows.

Also, /api/v1 route is for the webui backend api, not Ollama. Keep us updated, Thanks!

@tjbck commented on GitHub (Nov 29, 2023): Hi, Just to make sure, is the Ollama instance also running on the same server as the WebUI? Please provide us with the exact commands you ran for faster help. I'll close this issue for now as if you have everything setup correctly, we've verified that it works perfectly on macos, ubuntu and windows. Also, `/api/v1` route is for the webui backend api, not Ollama. Keep us updated, Thanks!
Author
Owner

@RasPintz commented on GitHub (Nov 29, 2023):

@tjbck :

Yes the ollama server is running on same instance (using loopback).

Here is the way to reproduce

Launching ollama server with (adding the & cause I m a lazzy guy :p ) :

OLLAMA_HOST=0.0.0.0 OLLAMA_ORIGINS=* ollama serve&
2023/11/29 19:02:44 images.go:791: total unused blobs removed: 0
2023/11/29 19:02:44 routes.go:777: Listening on [::]:11434 (version 0.1.12)
.../...

I cloned the repo locally

~/ollama-webui$ git status
On branch main
Your branch is up to date with 'origin/main'.

grep url .git/config 
        url = https://github.com/ollama-webui/ollama-webui.git

I modified the dev port listen (line 122)

node_modules/vite/dist/node/constants.js:122:const DEFAULT_DEV_PORT = 8080;

Launching webui with :

~/ollama-webui$ npm run dev
.../...
  ➜  Local:   http://localhost:8080/
  ➜  Network: http://XXXIPV4XXX:8080/  # <-- Yes IP is shadowed by me 
  ➜  press h to show help
        

When I access to the webui with : http://XXXIPV4XXX:8080/

I can see the webpage, I got the message :

"Server connection failed"

In the terminal I got the following message :

Error: Not found: /api/v1/
    at resolve (/home/XXX/ollama-webui/node_modules/@sveltejs/kit/src/runtime/server/respond.js:483:13)
    at resolve (/home/XXX/ollama-webui/node_modules/@sveltejs/kit/src/runtime/server/respond.js:277:5)
    at #options.hooks.handle (/home/XXX/ollama-webui/node_modules/@sveltejs/kit/src/runtime/server/index.js:49:56)
    at Module.respond (/home/XXX/ollama-webui/node_modules/@sveltejs/kit/src/runtime/server/respond.js:274:40)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
@RasPintz commented on GitHub (Nov 29, 2023): @tjbck : Yes the ollama server is running on same instance (using loopback). Here is the way to reproduce Launching ollama server with (adding the & cause I m a lazzy guy :p ) : ```bash OLLAMA_HOST=0.0.0.0 OLLAMA_ORIGINS=* ollama serve& 2023/11/29 19:02:44 images.go:791: total unused blobs removed: 0 2023/11/29 19:02:44 routes.go:777: Listening on [::]:11434 (version 0.1.12) .../... ``` I cloned the repo locally ```bash ~/ollama-webui$ git status On branch main Your branch is up to date with 'origin/main'. grep url .git/config url = https://github.com/ollama-webui/ollama-webui.git ``` I modified the dev port listen (line 122) ```bash node_modules/vite/dist/node/constants.js:122:const DEFAULT_DEV_PORT = 8080; ``` Launching webui with : ```bash ~/ollama-webui$ npm run dev .../... ➜ Local: http://localhost:8080/ ➜ Network: http://XXXIPV4XXX:8080/ # <-- Yes IP is shadowed by me ➜ press h to show help ``` When I access to the webui with : http://XXXIPV4XXX:8080/ I can see the webpage, I got the message : "Server connection failed" In the terminal I got the following message : ```bash Error: Not found: /api/v1/ at resolve (/home/XXX/ollama-webui/node_modules/@sveltejs/kit/src/runtime/server/respond.js:483:13) at resolve (/home/XXX/ollama-webui/node_modules/@sveltejs/kit/src/runtime/server/respond.js:277:5) at #options.hooks.handle (/home/XXX/ollama-webui/node_modules/@sveltejs/kit/src/runtime/server/index.js:49:56) at Module.respond (/home/XXX/ollama-webui/node_modules/@sveltejs/kit/src/runtime/server/respond.js:274:40) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) ```
Author
Owner

@tjbck commented on GitHub (Nov 29, 2023):

Hi, If you're hosting the webui with the npm run dev command, you should also run the python backend for webui backend /api/v1 routes. Alternatively, you can also set the OLLAMA_API_BASE_URL directly from the webui settings to http://localhost:11434/api and should connect to your ollama instance directly, bypassing the backend reverse proxy. Thanks.

@tjbck commented on GitHub (Nov 29, 2023): Hi, If you're hosting the webui with the `npm run dev` command, you should also run the python backend for webui backend `/api/v1` routes. Alternatively, you can also set the `OLLAMA_API_BASE_URL` directly from the webui settings to `http://localhost:11434/api` and should connect to your ollama instance directly, bypassing the backend reverse proxy. Thanks.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#66