[GH-ISSUE #24251] Bug: Lab report upload returns 500 - UserModel object has no attribute 'get' #74844

Closed
opened 2026-05-13 07:41:28 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @har33sh on GitHub (Apr 29, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/24251

Error

POST /api/v1/patients/{id}/lab-reports → 500
{"detail": "Failed to upload lab report: 'UserModel' object has no attribute 'get'"}

Reproduction

# Sign in
curl -X POST https://ui-dev.arogyadost.in/api/v1/auths/signin \
  -H "Content-Type: application/json" \
  -d '{"email": "test@test.com", "password": "password123"}'

# Upload (replace TOKEN and USER_ID)
curl -X POST "https://ui-dev.arogyadost.in/api/v1/patients/{USER_ID}/lab-reports" \
  -H "Authorization: Bearer {TOKEN}" \
  -F "file=@web-ui/e2e/fixtures/sample-cbc-report.pdf"

Root Cause

In web-ui/backend/open_webui/routers/wiki_lab_reports.py, the code calls .get() on a UserModel Pydantic object as if it were a dict (e.g. user.get("id") instead of user.id).

Impact

  • Blocks the entire document extraction pipeline — no lab reports can be uploaded via this endpoint
  • E2E extraction accuracy tests cannot run
  • The /api/v1/files/ upload path (Textract) may still work but uses a different OCR provider

Environment

Fix

Find the .get() call on the user object in wiki_lab_reports.py and replace with attribute access.

Originally created by @har33sh on GitHub (Apr 29, 2026). Original GitHub issue: https://github.com/open-webui/open-webui/issues/24251 ## Error ``` POST /api/v1/patients/{id}/lab-reports → 500 {"detail": "Failed to upload lab report: 'UserModel' object has no attribute 'get'"} ``` ## Reproduction ```bash # Sign in curl -X POST https://ui-dev.arogyadost.in/api/v1/auths/signin \ -H "Content-Type: application/json" \ -d '{"email": "test@test.com", "password": "password123"}' # Upload (replace TOKEN and USER_ID) curl -X POST "https://ui-dev.arogyadost.in/api/v1/patients/{USER_ID}/lab-reports" \ -H "Authorization: Bearer {TOKEN}" \ -F "file=@web-ui/e2e/fixtures/sample-cbc-report.pdf" ``` ## Root Cause In `web-ui/backend/open_webui/routers/wiki_lab_reports.py`, the code calls `.get()` on a `UserModel` Pydantic object as if it were a dict (e.g. `user.get("id")` instead of `user.id`). ## Impact - **Blocks the entire document extraction pipeline** — no lab reports can be uploaded via this endpoint - E2E extraction accuracy tests cannot run - The `/api/v1/files/` upload path (Textract) may still work but uses a different OCR provider ## Environment - Dev: https://ui-dev.arogyadost.in - Tested: 2026-04-30 ## Fix Find the `.get()` call on the user object in `wiki_lab_reports.py` and replace with attribute access.
Author
Owner

@har33sh commented on GitHub (Apr 29, 2026):

Opened on wrong repo by mistake. Sorry!

<!-- gh-comment-id:4347465709 --> @har33sh commented on GitHub (Apr 29, 2026): Opened on wrong repo by mistake. Sorry!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#74844