[GH-ISSUE #8248] Exception Unpacking Error in process_chat_payload #15051

Closed
opened 2026-04-19 21:20:03 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @albinvar on GitHub (Jan 1, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/8248

When an exception occurred in process_chat_payload, it was being returned instead of raised.

image

Instead of

image (1)

This caused the caller (chat_completion) to attempt unpacking the Exception object as if it were a tuple, leading to the error:

{"detail": "cannot unpack non-iterable Exception object"}

The issue can be reproduced by intentionally raising an exception within the custom function (example).

It seems to have been introduced in version 0.5.x, whereas earlier versions handled this correctly.

Originally created by @albinvar on GitHub (Jan 1, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/8248 When an exception occurred in `process_chat_payload`, it was being returned instead of raised. ![image](https://github.com/user-attachments/assets/8a56737f-5729-4077-9531-ed8aabea2205) Instead of ![image (1)](https://github.com/user-attachments/assets/49ce9784-85a9-434d-957d-05ef62965ce8) This caused the caller (chat_completion) to attempt unpacking the Exception object as if it were a tuple, leading to the error: ```json {"detail": "cannot unpack non-iterable Exception object"} ``` The issue can be reproduced by intentionally raising an exception within the custom function ([example](https://gist.github.com/albinvar/902a0e3734232e742528147761269b76)). It seems to have been introduced in version `0.5.x`, whereas earlier versions handled this correctly.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#15051