Skip to content

status crashes and ls reports empty against Open WebUI dev: GET /knowledge/{id} no longer inlines files (same root cause as #89) #91

Description

@silentoplayz

Summary

oikb status crashes with TypeError: object of type 'NoneType' has no len() and oikb ls prints (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 in GET /api/v1/knowledge/{id} (the web UI now fetches files from a paginated endpoint, GET /api/v1/knowledge/{id}/files?page=1), so the files field oikb reads comes back as null. This is very likely the same root cause as the validate --deep crash in #89 and the NoneType has no len() part of #53.

Environment

  • oikb 0.4.0 (ghcr.io/open-webui/oikb:latest), daemon mode, GitHub connector
  • Open WebUI v0.11.0 (ghcr.io/open-webui/open-webui:dev, image built 2026-08-01, digest sha256:f3eef6c272f9...)
  • The affected Knowledge Base contains 408 files and syncs correctly (hourly diffs report 408 unchanged)

Steps to reproduce

  1. Run Open WebUI :dev (v0.11.0 or the current dev image).
  2. Sync any source into a Knowledge Base with oikb 0.4.0 (sync works; files land and link correctly).
  3. Run oikb status --kb-id <kb id>.
  4. Run oikb ls --kb-id <kb id>.

Expected

status reports the KB name and file count; ls lists the synced files.

Actual

$ oikb status --kb-id e1c8e711-...
Traceback (most recent call last):
  ...
  File "/app/src/oikb/cli.py", line 770, in status
    file_count = len(files)
                 ^^^^^^^^^^
TypeError: object of type 'NoneType' has no len()

$ oikb ls --kb-id e1c8e711-...
(empty)

Both commands go through client.py::list_kb_files, which calls GET /knowledge/{kb_id} and reads the inline files field. On current dev that field is null for every KB (verified directly against the API: a KB with 408 linked files returns files: null, while the web UI populates its file list from GET /api/v1/knowledge/{id}/files?page=1&directory_id=).

Suggested fix

  • In list_kb_files, try the paginated GET /knowledge/{id}/files endpoint first and fall back to the legacy inline files field for older servers.
  • Independently, guard the len(files) sites (cli.py:770 in status, and presumably the equivalent in validate --deep, see oikb validate --deep fails with: object of type 'NoneType' has no len() #89) with files or [] so an unexpected null degrades to "0 files" instead of a traceback.

Additional context

This report was prepared with AI assistance; all observations were verified against the live instances described above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions