[GH-ISSUE #7138] Disabling OpenAI API connection results in API errors such as "invalid model ID" for other connections depending on order in which the connections were added. #117935

Closed
opened 2026-05-20 19:27:31 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @returnofblank on GitHub (Nov 21, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/7138

Bug Report

Installation Method

Installed with Docker Compose on Linux kernel 6.11.5-zen1

Environment

  • Open WebUI Version: v0.4.2

  • Operating System: NixOS 25.05 (Warbler)

  • Browser (if applicable): Firefox 132.0.2

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.
  • I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below.

Expected Behavior:

Disabling OpenAI API connections should not interfere with other connections.

If I add an OpenAI connection and then an Openrouter connection, disabling the former should have no effect on the latter.

Actual Behavior:

Disabling a connection interferes with the other, depending on the order of a connections.

A connection placed at the top of the list will interfere with connections below it if disabled. This applies even if the connection itself is valid, still resulting in an inability to use any connection below it.

As an example, I have two OpenAI API connections: OpenAI and Openrouter. OpenAI was added first so it is at the top of the list, while OpenRouter is below it. Disabling OpenAI results in the invalid model ID error for Openrouter when chatting with any model.

Oddly enough, having OpenAI as a connection below a disabled Openrouter connection does not lead to an error. But having a disabled invalid URL as a connection at the top of the list does cause issues. I don't have the time to really look into that, but I will update if I see anything else.

Description

Bug Summary:
Disabled connections can cause issues for other connections, somewhat dependent on the order in which they were added.

Reproduction Details

Steps to Reproduce:

  1. Add two connections (in my case, OpenAI and Openrouter)
  2. Disable the top one
  3. Speak to any model on the connection below it
  4. Witness the API error.
  5. Reenable the top one
  6. Reorder the list to swap the positions of the two connections
  7. Now disable the top connection (which should differ from previously)
  8. There is now an API error for the other connection.

Logs and Screenshots

INFO  [open_webui.apps.openai.main] get_all_models()
INFO  [open_webui.apps.openai.main] get_all_models()
ERROR [open_webui.apps.openai.main] 400, message='Bad Request', url='https://api.openai.com/v1/chat/completions'
Traceback (most recent call last):
  File "/app/backend/open_webui/apps/openai/main.py", line 630, in generate_chat_completion
    r.raise_for_status()
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1121, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url='https://api.openai.com/v1/chat/completions'

Above is disabling OpenAI connection with an Openrouter connection below it (and speaking to an Openrouter connection.)

Originally created by @returnofblank on GitHub (Nov 21, 2024). Original GitHub issue: https://github.com/open-webui/open-webui/issues/7138 # Bug Report ## Installation Method Installed with Docker Compose on Linux kernel 6.11.5-zen1 ## Environment - **Open WebUI Version:** v0.4.2 - **Operating System:** NixOS 25.05 (Warbler) - **Browser (if applicable):** Firefox 132.0.2 **Confirmation:** - [x] I have read and followed all the instructions provided in the README.md. - [x] I am on the latest version of both Open WebUI and Ollama. - [ ] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below. ## Expected Behavior: Disabling OpenAI API connections should not interfere with other connections. If I add an OpenAI connection and then an Openrouter connection, disabling the former should have no effect on the latter. ## Actual Behavior: Disabling a connection interferes with the other, depending on the order of a connections. A connection placed at the top of the list will interfere with connections below it if disabled. This applies even if the connection itself is valid, still resulting in an inability to use any connection below it. As an example, I have two OpenAI API connections: OpenAI and Openrouter. OpenAI was added first so it is at the top of the list, while OpenRouter is below it. Disabling OpenAI results in the invalid model ID error for Openrouter when chatting with any model. Oddly enough, having OpenAI as a connection below a disabled Openrouter connection does not lead to an error. But having a disabled invalid URL as a connection at the top of the list does cause issues. I don't have the time to really look into that, but I will update if I see anything else. ## Description **Bug Summary:** Disabled connections can cause issues for other connections, somewhat dependent on the order in which they were added. ## Reproduction Details **Steps to Reproduce:** 1. Add two connections (in my case, OpenAI and Openrouter) 2. Disable the top one 3. Speak to any model on the connection below it 4. Witness the API error. 5. Reenable the top one 6. Reorder the list to swap the positions of the two connections 7. Now disable the top connection (which should differ from previously) 8. There is now an API error for the other connection. ## Logs and Screenshots ``` INFO [open_webui.apps.openai.main] get_all_models() INFO [open_webui.apps.openai.main] get_all_models() ERROR [open_webui.apps.openai.main] 400, message='Bad Request', url='https://api.openai.com/v1/chat/completions' Traceback (most recent call last): File "/app/backend/open_webui/apps/openai/main.py", line 630, in generate_chat_completion r.raise_for_status() File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1121, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url='https://api.openai.com/v1/chat/completions' ``` Above is disabling OpenAI connection with an Openrouter connection below it (and speaking to an Openrouter connection.)
Author
Owner

@isikepalaku commented on GitHub (Nov 21, 2024):

openai
erorr

<!-- gh-comment-id:2490838559 --> @isikepalaku commented on GitHub (Nov 21, 2024): ![openai](https://github.com/user-attachments/assets/fa1847d0-3fe3-47b5-bd3c-bf602ca7134f) erorr
Author
Owner

@tjbck commented on GitHub (Nov 22, 2024):

Pushed a potential fix to dev, testing wanted here!

<!-- gh-comment-id:2492882925 --> @tjbck commented on GitHub (Nov 22, 2024): Pushed a potential fix to dev, testing wanted here!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#117935