OpenAI Network Problem on OpenWebUI #1337

Closed
opened 2025-11-11 14:43:16 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @whateverzpy on GitHub (Jun 21, 2024).

Bug Report

Description

Bug Summary:

I am experiencing an issue with OpenWebUI where it reports an "Openai: Network Problem" when setting the OpenAI API key. The same API key works fine with curl on my local machine.

curl http://localhost:8000/v1/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer sk-***************" -d '{"model": "gpt-4o","messages": [{"role": "user", "content": "Say this is a test!"}]}'
{"id":"chatcmpl-78823c3892804d50a3ec215253fb5dd4","model":"*************","object":"chat.completion","created":1718955051,"choices":[{"index":0,"message":{"role":"assistant","content":"# This is a Test!\n\nWelcome! How can I assist you with your questions or interests in Chinese modern and contemporary history today?"},"finish_reason":"stop"}],"usage":{"prompt_tokens":0,"completion_tokens":0,"total_tokens":0}}

Steps to Reproduce:

  1. Deploy OpenAI API key on local server.
  2. Use curl on local machine to verify API key works.
  3. Set the same API key in OpenWebUI.

Actual Behavior:

OpenWebUI reports "Openai: Network Problem".

Environment

  • Open WebUI Version: 0.3.1

  • Operating System: Windows 11

  • Browser (if applicable): Edge 126.0.2592.61

Reproduction Details

Confirmation:

  • I have read and followed all the instructions provided in the README.md.
  • I am on the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.

Logs and Screenshots

Browser Console Logs:

image
image
image
Ignore the Ollama error because I'm not focusing on it.

Docker Container Logs:

2024-06-21 15:24:17 INFO:apps.openai.main:get_all_models()
2024-06-21 15:24:17 ERROR:apps.openai.main:Connection error: Cannot connect to host localhost:8000 ssl:default [Connection refused]
2024-06-21 15:24:17 INFO:apps.ollama.main:get_all_models()
2024-06-21 15:24:17 ERROR:apps.ollama.main:Connection error: Cannot connect to host host.docker.internal:11434 ssl:default [Connection refused]
2024-06-21 15:24:17 INFO:     127.0.0.1:42946 - "GET /health HTTP/1.1" 200 OK
2024-06-21 15:24:47 INFO:apps.openai.main:get_all_models()
2024-06-21 15:24:47 ERROR:apps.openai.main:Connection error: Cannot connect to host localhost:8000 ssl:default [Connection refused]
2024-06-21 15:24:47 INFO:apps.ollama.main:get_all_models()
2024-06-21 15:24:47 ERROR:apps.ollama.main:Connection error: Cannot connect to host host.docker.internal:11434 ssl:default [Connection refused]
2024-06-21 15:24:47 INFO:     127.0.0.1:51980 - "GET /health HTTP/1.1" 200 OK
2024-06-21 15:25:17 INFO:apps.openai.main:get_all_models()
2024-06-21 15:25:17 ERROR:apps.openai.main:Connection error: Cannot connect to host localhost:8000 ssl:default [Connection refused]
2024-06-21 15:25:17 INFO:apps.ollama.main:get_all_models()
2024-06-21 15:25:17 ERROR:apps.ollama.main:Connection error: Cannot connect to host host.docker.internal:11434 ssl:default [Connection refused]
2024-06-21 15:25:17 INFO:     127.0.0.1:48388 - "GET /health HTTP/1.1" 200 OK

Installation Method

Docker

Originally created by @whateverzpy on GitHub (Jun 21, 2024). # Bug Report ## Description **Bug Summary:** I am experiencing an issue with OpenWebUI where it reports an "Openai: Network Problem" when setting the OpenAI API key. The same API key works fine with curl on my local machine. ```shell curl http://localhost:8000/v1/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer sk-***************" -d '{"model": "gpt-4o","messages": [{"role": "user", "content": "Say this is a test!"}]}' ``` ```shell {"id":"chatcmpl-78823c3892804d50a3ec215253fb5dd4","model":"*************","object":"chat.completion","created":1718955051,"choices":[{"index":0,"message":{"role":"assistant","content":"# This is a Test!\n\nWelcome! How can I assist you with your questions or interests in Chinese modern and contemporary history today?"},"finish_reason":"stop"}],"usage":{"prompt_tokens":0,"completion_tokens":0,"total_tokens":0}} ``` **Steps to Reproduce:** 1. Deploy OpenAI API key on local server. 2. Use curl on local machine to verify API key works. 3. Set the same API key in OpenWebUI. **Actual Behavior:** OpenWebUI reports "Openai: Network Problem". ## Environment - **Open WebUI Version:** 0.3.1 - **Operating System:** Windows 11 - **Browser (if applicable):** Edge 126.0.2592.61 ## Reproduction Details **Confirmation:** - [x] I have read and followed all the instructions provided in the README.md. - [ ] I am on the latest version of both Open WebUI and Ollama. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. ## Logs and Screenshots **Browser Console Logs:** ![image](https://github.com/open-webui/open-webui/assets/86581757/ee4af7ea-e0cb-4436-a22e-426b12c11c3c) ![image](https://github.com/open-webui/open-webui/assets/86581757/202fa7a3-56ae-4d67-9b67-8af0a7d48ed1) ![image](https://github.com/open-webui/open-webui/assets/86581757/e700ef90-a186-4164-b190-64f4f7449c55) Ignore the Ollama error because I'm not focusing on it. **Docker Container Logs:** ```txt 2024-06-21 15:24:17 INFO:apps.openai.main:get_all_models() 2024-06-21 15:24:17 ERROR:apps.openai.main:Connection error: Cannot connect to host localhost:8000 ssl:default [Connection refused] 2024-06-21 15:24:17 INFO:apps.ollama.main:get_all_models() 2024-06-21 15:24:17 ERROR:apps.ollama.main:Connection error: Cannot connect to host host.docker.internal:11434 ssl:default [Connection refused] 2024-06-21 15:24:17 INFO: 127.0.0.1:42946 - "GET /health HTTP/1.1" 200 OK 2024-06-21 15:24:47 INFO:apps.openai.main:get_all_models() 2024-06-21 15:24:47 ERROR:apps.openai.main:Connection error: Cannot connect to host localhost:8000 ssl:default [Connection refused] 2024-06-21 15:24:47 INFO:apps.ollama.main:get_all_models() 2024-06-21 15:24:47 ERROR:apps.ollama.main:Connection error: Cannot connect to host host.docker.internal:11434 ssl:default [Connection refused] 2024-06-21 15:24:47 INFO: 127.0.0.1:51980 - "GET /health HTTP/1.1" 200 OK 2024-06-21 15:25:17 INFO:apps.openai.main:get_all_models() 2024-06-21 15:25:17 ERROR:apps.openai.main:Connection error: Cannot connect to host localhost:8000 ssl:default [Connection refused] 2024-06-21 15:25:17 INFO:apps.ollama.main:get_all_models() 2024-06-21 15:25:17 ERROR:apps.ollama.main:Connection error: Cannot connect to host host.docker.internal:11434 ssl:default [Connection refused] 2024-06-21 15:25:17 INFO: 127.0.0.1:48388 - "GET /health HTTP/1.1" 200 OK ``` ## Installation Method Docker
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#1337