[PR #23109] [CLOSED] fix: handle None meta in FileMeta.sanitize_meta() to prevent API 500 errors #27033

Closed
opened 2026-04-20 06:49:49 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/23109
Author: @yang1002378395-cmyk
Created: 3/26/2026
Status: Closed

Base: mainHead: fix/files-api-500-null-meta


📝 Commits (1)

  • d88c531 fix: handle None meta in FileMeta.sanitize_meta() to prevent API 500 error

📊 Changes

1 file changed (+65 additions, -77 deletions)

View changed files

📝 backend/open_webui/models/files.py (+65 -77)

📄 Description

Summary

  • Fix regression in v0.8.11 where /api/v1/files/ returns HTTP 500
  • Root cause: FileMeta.sanitize_meta() returns None unchanged when input is None
  • FileModelResponse.meta is required, so Pydantic raises ValidationError

Fix

Return empty dict {} instead of None for non-dict input in sanitize_meta()

Test Plan

  1. Create files with NULL meta in database
  2. Call GET /api/v1/files/
  3. Should return 200 instead of 500

Fixes #23101


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/23109 **Author:** [@yang1002378395-cmyk](https://github.com/yang1002378395-cmyk) **Created:** 3/26/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/files-api-500-null-meta` --- ### 📝 Commits (1) - [`d88c531`](https://github.com/open-webui/open-webui/commit/d88c531cbda375dff263cd313914271ec4db2975) fix: handle None meta in FileMeta.sanitize_meta() to prevent API 500 error ### 📊 Changes **1 file changed** (+65 additions, -77 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/models/files.py` (+65 -77) </details> ### 📄 Description ## Summary - Fix regression in v0.8.11 where /api/v1/files/ returns HTTP 500 - Root cause: FileMeta.sanitize_meta() returns None unchanged when input is None - FileModelResponse.meta is required, so Pydantic raises ValidationError ## Fix Return empty dict {} instead of None for non-dict input in sanitize_meta() ## Test Plan 1. Create files with NULL meta in database 2. Call GET /api/v1/files/ 3. Should return 200 instead of 500 Fixes #23101 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-20 06:49:49 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#27033