[GH-ISSUE #113] Open WebUI 0.11.1: oikb status fails with TypeError and oikb ls returns 0 files #67

Open
opened 2026-10-18 21:14:03 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @lhvo on GitHub (Aug 27, 2026).
Original GitHub issue: https://github.com/open-webui/oikb/issues/113

Environment

  • Open WebUI 0.11.1
  • OIKB 0.4.0
  • Docker deployment

Problem

The Knowledge Base contains files and Open WebUI returns them correctly via:

GET /api/v1/knowledge/{kb_id}/files

However:

oikb ls
oikb status --kb-id

either return 0 files or fail with:

TypeError: object of type 'NoneType' has no len()

Traceback

File "/usr/local/lib/python3.11/site-packages/oikb/cli.py", line 770, in status
file_count = len(files)
TypeError: object of type 'NoneType' has no len()

Observed API responses

GET /api/v1/knowledge/

returns:

{
"items": [...],
"total": 1
}

GET /api/v1/knowledge//files

returns:

{
"items": [...],
"total": 2
}

Root cause

In oikb/client.py:

def list_kb_files(self, kb_id):
resp = self._http.get(f"/knowledge/{kb_id}")
data = resp.json()
return data.get("files", [])

The endpoint should instead be:

GET /knowledge/{kb_id}/files

and Open WebUI 0.11.1 returns file entries in:

data["items"]

rather than:

data["files"]

Proposed fix

client.py

def list_kb_files(self, kb_id):
resp = self._http.get(f"/knowledge/{kb_id}/files")
resp.raise_for_status()
data = resp.json()
return data.get("items") or data.get("files") or []

cli.py

Replace:

files = info.get("files", [])

with:

files = client.list_kb_files(kb)

This resolves both:

  • oikb status
  • oikb ls
Originally created by @lhvo on GitHub (Aug 27, 2026). Original GitHub issue: https://github.com/open-webui/oikb/issues/113 Environment - Open WebUI 0.11.1 - OIKB 0.4.0 - Docker deployment Problem The Knowledge Base contains files and Open WebUI returns them correctly via: GET /api/v1/knowledge/{kb_id}/files However: oikb ls oikb status --kb-id <kb-id> either return 0 files or fail with: TypeError: object of type 'NoneType' has no len() Traceback File "/usr/local/lib/python3.11/site-packages/oikb/cli.py", line 770, in status file_count = len(files) TypeError: object of type 'NoneType' has no len() Observed API responses GET /api/v1/knowledge/ returns: { "items": [...], "total": 1 } GET /api/v1/knowledge/<kb-id>/files returns: { "items": [...], "total": 2 } Root cause In oikb/client.py: def list_kb_files(self, kb_id): resp = self._http.get(f"/knowledge/{kb_id}") data = resp.json() return data.get("files", []) The endpoint should instead be: GET /knowledge/{kb_id}/files and Open WebUI 0.11.1 returns file entries in: data["items"] rather than: data["files"] Proposed fix client.py def list_kb_files(self, kb_id): resp = self._http.get(f"/knowledge/{kb_id}/files") resp.raise_for_status() data = resp.json() return data.get("items") or data.get("files") or [] cli.py Replace: files = info.get("files", []) with: files = client.list_kb_files(kb) This resolves both: - oikb status - oikb ls
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
open-webui/oikb#67
No description provided.