mirror of
https://github.com/open-webui/oikb.git
synced 2026-11-05 01:27:25 +00:00
[GH-ISSUE #113] Open WebUI 0.11.1: oikb status fails with TypeError and oikb ls returns 0 files #67
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/oikb#67
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @lhvo on GitHub (Aug 27, 2026).
Original GitHub issue: https://github.com/open-webui/oikb/issues/113
Environment
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: