mirror of
https://github.com/open-webui/oikb.git
synced 2026-11-05 01:27:25 +00:00
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#56
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 @silentoplayz on GitHub (Aug 1, 2026).
Original GitHub issue: https://github.com/open-webui/oikb/issues/91
Summary
oikb statuscrashes withTypeError: object of type 'NoneType' has no len()andoikb lsprints(empty)when pointed at a populated Knowledge Base on a current Open WebUI dev build (v0.11.0, image 2026-08-01). Sync itself works fine. The root cause is that newer Open WebUI no longer inlines the file list inGET /api/v1/knowledge/{id}(the web UI now fetches files from a paginated endpoint,GET /api/v1/knowledge/{id}/files?page=1), so thefilesfield oikb reads comes back asnull. This is very likely the same root cause as thevalidate --deepcrash in #89 and theNoneType has no len()part of #53.Environment
ghcr.io/open-webui/oikb:latest), daemon mode, GitHub connectorghcr.io/open-webui/open-webui:dev, image built 2026-08-01, digestsha256:f3eef6c272f9...)408 unchanged)Steps to reproduce
:dev(v0.11.0 or the current dev image).oikb status --kb-id <kb id>.oikb ls --kb-id <kb id>.Expected
statusreports the KB name and file count;lslists the synced files.Actual
Both commands go through
client.py::list_kb_files, which callsGET /knowledge/{kb_id}and reads the inlinefilesfield. On current dev that field isnullfor every KB (verified directly against the API: a KB with 408 linked files returnsfiles: null, while the web UI populates its file list fromGET /api/v1/knowledge/{id}/files?page=1&directory_id=).Suggested fix
list_kb_files, try the paginatedGET /knowledge/{id}/filesendpoint first and fall back to the legacy inlinefilesfield for older servers.len(files)sites (cli.py:770instatus, and presumably the equivalent invalidate --deep, see #89) withfiles or []so an unexpectednulldegrades to "0 files" instead of a traceback.Additional context
validate --deepNoneType crash) and the crash half of #53 (reported against the SharePoint connector, but the traceback is the samelen(files)onNone)./sync/*endpoints rather than the inlinefilesfield.:dev.This report was prepared with AI assistance; all observations were verified against the live instances described above.
@brownhouse commented on GitHub (Sep 19, 2026):
Title:
syncalso crashes with'NoneType' object has no attribute 'get'(0.5.0) -- #91 said sync was unaffected, but it now is tooRelated: #91, #89
#91 diagnosed the root cause (newer Open WebUI no longer inlines the
file list in
GET /api/v1/knowledge/{id}, sofilescomes backnull) and specifically noted:That's no longer true for me on 0.5.0.
oikb sync(andoikb sync -v,no extra detail shown) now fails outright:
oikb status --kb-id <kb-id>still crashes the same way #91 describes(
TypeError: object of type 'NoneType' has no len()atoikb/cli.py:770), consistent with that diagnosis.pip show oikbconfirms I'm on the latest available version (0.5.0),so this isn't fixed by upgrading yet.
Environment: Windows, Python 3.14, Open WebUI instance running
locally, same setup as my earlier report in #60.
Re: the suggested fix in your original writeup (paginated
GET /knowledge/{id}/filesfallback inlist_kb_files, plusguarding the
len(files)sites withfiles or []) -- that targetsthe
status/validate --deeppath specifically. Per your owndiagnosis,
syncuses the separate/sync/*endpoints, so I'm notsure whether
syncfailing now is the same underlyingnullissuesurfacing somewhere in those endpoints too, or a distinct regression.
Flagging in case the suggested fix doesn't also cover this.
Happy to test a patch or provide more logs if useful.