[GH-ISSUE #89] oikb validate --deep fails with: object of type 'NoneType' has no len() #57

Closed
opened 2026-10-18 21:13:57 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @plevart on GitHub (Jul 31, 2026).
Original GitHub issue: https://github.com/open-webui/oikb/issues/89

I have a Gitlab pipeline that has a job which fails due to the following command:

$ oikb validate --deep
Deep validation
  ✓ API reachable  https://ai-api.k8s.marand.si/api/v1/
  ✗ omnicpq-usermanual: KB be48ac32-6303-479a-a381-0f0c76a748de — object of type 'NoneType' has no len()
  ✗ omnicpq-tests: KB b7dd2ecc-a05c-405b-ae56-65a246c3a053 — object of type 'NoneType' has no len()

I marked it so that the job failure doesn't fail the whole pipeline. The next job in line succeeds though:

$ oikb sync --concurrency 1
────────────────────────────────────────
Syncing: ./knowledge/omnicpq-usermanual → be48ac32-6303-479a-a381-0f0c76a748de
  53 files found
  53 files after filtering
  Diff: 53 unchanged
  Done: 53 unchanged
────────────────────────────────────────
Syncing: ./knowledge/omnicpq-tests → b7dd2ecc-a05c-405b-ae56-65a246c3a053
  72 files found
  72 files after filtering
  Diff: 72 unchanged
  Done: 72 unchanged

I believe that oikb validate should succeed too. As can be seen both KBs were already populated when validate was executed.

Originally created by @plevart on GitHub (Jul 31, 2026). Original GitHub issue: https://github.com/open-webui/oikb/issues/89 I have a Gitlab pipeline that has a job which fails due to the following command: ``` $ oikb validate --deep Deep validation ✓ API reachable https://ai-api.k8s.marand.si/api/v1/ ✗ omnicpq-usermanual: KB be48ac32-6303-479a-a381-0f0c76a748de — object of type 'NoneType' has no len() ✗ omnicpq-tests: KB b7dd2ecc-a05c-405b-ae56-65a246c3a053 — object of type 'NoneType' has no len() ``` I marked it so that the job failure doesn't fail the whole pipeline. The next job in line succeeds though: ``` $ oikb sync --concurrency 1 ──────────────────────────────────────── Syncing: ./knowledge/omnicpq-usermanual → be48ac32-6303-479a-a381-0f0c76a748de 53 files found 53 files after filtering Diff: 53 unchanged Done: 53 unchanged ──────────────────────────────────────── Syncing: ./knowledge/omnicpq-tests → b7dd2ecc-a05c-405b-ae56-65a246c3a053 72 files found 72 files after filtering Diff: 72 unchanged Done: 72 unchanged ``` I believe that oikb validate should succeed too. As can be seen both KBs were already populated when validate was executed.
Author
Owner

@plevart commented on GitHub (Jul 31, 2026):

The problem is that Open WebUI API returns explicit JSON null for the files attribute:

peter@pad:/var/home/peter/work/git/oikb$ curl -s -H "Authorization: Bearer $OPEN_WEBUI_API_KEY"   https://ai-api.k8s.marand.si/api/v1/knowledge/be48ac32-6303-479a-a381-0f0c76a748de | jq .
{
  "id": "be48ac32-6303-479a-a381-0f0c76a748de",
  "user_id": "f8f24106-7120-4f6b-8401-ddd3d896898f",
  "name": "omnicpq-usermanual",
  "description": "User instructions and explanations of the OmniCPQ product",
  "meta": null,
  "access_grants": [
    {
      "id": "daf42338-0a8b-43bc-954d-552c53745ecc",
      "resource_type": "knowledge",
      "resource_id": "be48ac32-6303-479a-a381-0f0c76a748de",
      "principal_type": "user",
      "principal_id": "bef8584b-ea62-4c32-8da9-09f772ba7528",
      "permission": "read",
      "created_at": 1785508712
    }
  ],
  "created_at": 1785502404,
  "updated_at": 1785502404,
  "files": null,
  "write_access": true
}

So this deserializes to None. But there is another API endpoint that lists the files:

peter@pad:/var/home/peter/work/git/oikb$ curl -s -H "Authorization: Bearer $OPEN_WEBUI_API_KEY" \
  https://ai-api.k8s.marand.si/api/v1/knowledge/be48ac32-6303-479a-a381-0f0c76a748de/files | jq .
{
  "items": [
    {
      "id": "2356c8a5-97c3-4011-b3f8-6a57d34399ad",
      "user_id": "f8f24106-7120-4f6b-8401-ddd3d896898f",
      "hash": "4ee221559a7e3e3b92e4c0d8d7ff8159f14c74072e8196453dbe660e544feec6",
      "filename": "ponudba-tabelarni-pregled.md",
      "data": null,
      "meta": {
        "name": "ponudba-tabelarni-pregled.md",
        "content_type": "application/octet-stream",
        "size": 18933,
        "file_hash": "4ee221559a7e3e3b92e4c0d8d7ff8159f14c74072e8196453dbe660e544feec6",
        "data": {
          "knowledge_id": "be48ac32-6303-479a-a381-0f0c76a748de",
          "file_hash": "4ee221559a7e3e3b92e4c0d8d7ff8159f14c74072e8196453dbe660e544feec6"
        },
        "collection_name": "be48ac32-6303-479a-a381-0f0c76a748de"
      },
      "created_at": 1785505460,
      "updated_at": 1785506314,
      "user": {
        "id": "f8f24106-7120-4f6b-8401-ddd3d896898f",
        "name": "gitlab-ci",
        "role": "user",
        "email": "gitlab-ci@marand.si"
      }
    },
...

So the tool should call it instead. Same problems are observed in the following subcommands: validate --deep, status, and ls

<!-- gh-comment-id:5144854292 --> @plevart commented on GitHub (Jul 31, 2026): The problem is that Open WebUI API returns explicit JSON null for the files attribute: ``` peter@pad:/var/home/peter/work/git/oikb$ curl -s -H "Authorization: Bearer $OPEN_WEBUI_API_KEY" https://ai-api.k8s.marand.si/api/v1/knowledge/be48ac32-6303-479a-a381-0f0c76a748de | jq . { "id": "be48ac32-6303-479a-a381-0f0c76a748de", "user_id": "f8f24106-7120-4f6b-8401-ddd3d896898f", "name": "omnicpq-usermanual", "description": "User instructions and explanations of the OmniCPQ product", "meta": null, "access_grants": [ { "id": "daf42338-0a8b-43bc-954d-552c53745ecc", "resource_type": "knowledge", "resource_id": "be48ac32-6303-479a-a381-0f0c76a748de", "principal_type": "user", "principal_id": "bef8584b-ea62-4c32-8da9-09f772ba7528", "permission": "read", "created_at": 1785508712 } ], "created_at": 1785502404, "updated_at": 1785502404, "files": null, "write_access": true } ``` So this deserializes to None. But there is another API endpoint that lists the files: ``` peter@pad:/var/home/peter/work/git/oikb$ curl -s -H "Authorization: Bearer $OPEN_WEBUI_API_KEY" \ https://ai-api.k8s.marand.si/api/v1/knowledge/be48ac32-6303-479a-a381-0f0c76a748de/files | jq . { "items": [ { "id": "2356c8a5-97c3-4011-b3f8-6a57d34399ad", "user_id": "f8f24106-7120-4f6b-8401-ddd3d896898f", "hash": "4ee221559a7e3e3b92e4c0d8d7ff8159f14c74072e8196453dbe660e544feec6", "filename": "ponudba-tabelarni-pregled.md", "data": null, "meta": { "name": "ponudba-tabelarni-pregled.md", "content_type": "application/octet-stream", "size": 18933, "file_hash": "4ee221559a7e3e3b92e4c0d8d7ff8159f14c74072e8196453dbe660e544feec6", "data": { "knowledge_id": "be48ac32-6303-479a-a381-0f0c76a748de", "file_hash": "4ee221559a7e3e3b92e4c0d8d7ff8159f14c74072e8196453dbe660e544feec6" }, "collection_name": "be48ac32-6303-479a-a381-0f0c76a748de" }, "created_at": 1785505460, "updated_at": 1785506314, "user": { "id": "f8f24106-7120-4f6b-8401-ddd3d896898f", "name": "gitlab-ci", "role": "user", "email": "gitlab-ci@marand.si" } }, ... ``` So the tool should call it instead. Same problems are observed in the following subcommands: `validate --deep`, `status`, and `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#57
No description provided.