[GH-ISSUE #8914] Using OpenAI API with deepseek-reasoner and pasting an image in to the chat box causes 422: Failed to deserialize the JSON #30851

Closed
opened 2026-04-25 05:02:28 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @rayone on GitHub (Jan 25, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/8914

Installation Method
Proxmox PXC

Environment
Open WebUI Version: v0.5.4 to v0.5.7
Operating System: Debian 12

Confirmation:
I am on the latest version of both Open WebUI and Ollama.
I have included the System logs.
I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below.

Expected Behavior:
Pasting an image in to the chat box and submitting the msg does not cause a failure of the whole chat session and ideally actual response is returned.

Actual Behavior:
422: Failed to deserialize the JSON body into the target type: messages[11]: data did not match any variant of untagged enum ChatCompletionRequestContent at line 1 column [n]

Description
Using OpenAI API with deepseek-reasoner and pasting an image in to the chat box causes a JSON error that breaks the whole session.

Reproduction Details
Steps to Reproduce:

  1. New chat - select deepseek-reasoner
  2. send a message
  3. screenshot a part of the page
  4. paste (Ctrl + v) the screenshot in to the chat
  5. add text to the msg and send
  6. result
    Image

This is not a once off, it's consistent and it also happens with deepseeker-chat.

Relevant log entries:
Jan 25 21:18:39 openwebui start.sh[13972]: INFO [open_webui.routers.openai] get_all_models()
Jan 25 21:18:41 openwebui start.sh[13972]: ERROR [open_webui.routers.openai] 422, message='Attempt to decode JSON with unexpected mimetype: text/plain; charset=utf-8', url='https://api.deepseek.com/chat/completions'
Jan 25 21:18:41 openwebui start.sh[13972]: ERROR [open_webui.routers.openai] 422, message='Unprocessable Entity', url='https://api.deepseek.com/chat/completions'
Jan 25 21:18:41 openwebui start.sh[13972]: Traceback (most recent call last):
Jan 25 21:18:41 openwebui start.sh[13972]: File "/opt/open-webui/backend/open_webui/routers/openai.py", line 696, in generate_chat_completion
Jan 25 21:18:41 openwebui start.sh[13972]: r.raise_for_status()
Jan 25 21:18:41 openwebui start.sh[13972]: File "/usr/local/lib/python3.11/dist-packages/aiohttp/client_reqrep.py", line 1157, in raise_for_status
Jan 25 21:18:41 openwebui start.sh[13972]: raise ClientResponseError(
Jan 25 21:18:41 openwebui start.sh[13972]: aiohttp.client_exceptions.ClientResponseError: 422, message='Unprocessable Entity', url='https://api.deepseek.com/chat/completions'
Jan 25 21:18:41 openwebui start.sh[13972]: INFO: 10.0.21.115:56110 - "POST /api/chat/completions HTTP/1.1" 400 Bad Request
Jan 25 21:18:41 openwebui start.sh[13972]: INFO: 10.0.21.115:56110 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK

Originally created by @rayone on GitHub (Jan 25, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/8914 Installation Method Proxmox PXC Environment Open WebUI Version: v0.5.4 to v0.5.7 Operating System: Debian 12 Confirmation: I am on the latest version of both Open WebUI and Ollama. I have included the System logs. I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below. Expected Behavior: Pasting an image in to the chat box and submitting the msg does not cause a failure of the whole chat session and ideally actual response is returned. Actual Behavior: 422: Failed to deserialize the JSON body into the target type: messages[11]: data did not match any variant of untagged enum ChatCompletionRequestContent at line 1 column [_n_] Description Using OpenAI API with deepseek-reasoner and pasting an image in to the chat box causes a JSON error that breaks the whole session. Reproduction Details Steps to Reproduce: 1. New chat - select deepseek-reasoner 2. send a message 3. screenshot a part of the page 4. paste (Ctrl + v) the screenshot in to the chat 5. add text to the msg and send 6. result ![Image](https://github.com/user-attachments/assets/7d7548f4-7681-4c82-accb-cd8d68edce06) This is not a once off, it's consistent and it also happens with deepseeker-chat. Relevant log entries: Jan 25 21:18:39 openwebui start.sh[13972]: INFO [open_webui.routers.openai] get_all_models() Jan 25 21:18:41 openwebui start.sh[13972]: ERROR [open_webui.routers.openai] 422, message='Attempt to decode JSON with unexpected mimetype: text/plain; charset=utf-8', url='https://api.deepseek.com/chat/completions' Jan 25 21:18:41 openwebui start.sh[13972]: ERROR [open_webui.routers.openai] 422, message='Unprocessable Entity', url='https://api.deepseek.com/chat/completions' Jan 25 21:18:41 openwebui start.sh[13972]: Traceback (most recent call last): Jan 25 21:18:41 openwebui start.sh[13972]: File "/opt/open-webui/backend/open_webui/routers/openai.py", line 696, in generate_chat_completion Jan 25 21:18:41 openwebui start.sh[13972]: r.raise_for_status() Jan 25 21:18:41 openwebui start.sh[13972]: File "/usr/local/lib/python3.11/dist-packages/aiohttp/client_reqrep.py", line 1157, in raise_for_status Jan 25 21:18:41 openwebui start.sh[13972]: raise ClientResponseError( Jan 25 21:18:41 openwebui start.sh[13972]: aiohttp.client_exceptions.ClientResponseError: 422, message='Unprocessable Entity', url='https://api.deepseek.com/chat/completions' Jan 25 21:18:41 openwebui start.sh[13972]: INFO: 10.0.21.115:56110 - "POST /api/chat/completions HTTP/1.1" 400 Bad Request Jan 25 21:18:41 openwebui start.sh[13972]: INFO: 10.0.21.115:56110 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
Author
Owner

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

It's not a vision model.

<!-- gh-comment-id:2614784064 --> @d0rc commented on GitHub (Jan 27, 2025): It's not a vision model.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#30851