[GH-ISSUE #53] SharePoint connector: validate --deep crashes with NoneType has no len(); sync reports 0 files for a non-empty library #34

Open
opened 2026-10-18 21:13:40 +00:00 by bsakaguchi · 2 comments
Owner

Originally created by @foss-eyay on GitHub (Jun 15, 2026).
Original GitHub issue: https://github.com/open-webui/oikb/issues/53

Environment:

oikb version: 0.3.5 (Docker, ghcr.io/open-webui/oikb)
Open WebUI: v0.9.6 (Docker)
Connector: SharePoint, app-only auth (client secret)
Graph permission: Sites.Read.All (Application type, admin consent granted)
SharePoint permissions: Sites.Read.All (Application type, admin consent granted)

Summary:

For a SharePoint document library that demonstrably contains files, oikb validate --deep crashes with object of type 'NoneType' has no len(), and oikb sync reports 0 files found. Authentication to both Open WebUI and SharePoint succeeds, and the library contents are confirmed readable via Microsoft Graph using the exact same app-only credentials oikb is configured with.

Config:

sources:
  - name: Images
    source: sharepoint:<tenant>.sharepoint.com/Dokumente
    kb-id: <kb-id>
    interval: 1h

Errors:

$ oikb validate --deep
Deep validation
  ✓ API reachable  http://open-webui:8080/api/v1/
  ✗ Images: KB <kb-id> — object of type 'NoneType' has no len()
$ oikb sync --dry-run -v
Syncing: sharepoint:<tenant>.sharepoint.com/Dokumente → <kb-id>
Scanning source...
  0 files found
Source is empty — nothing to sync.

The NoneType has no len() appears to indicate the library enumeration returns None (or nothing), which is then passed to len() without a guard. The sync path handles the same empty result more gracefully ("Source is empty"), but the underlying problem looks identical: the connector retrieves no items for this library.

The library is NOT empty — confirmed via Graph with the same credentials:

Site resolves: GET /v1.0/sites/.sharepoint.com:/sites/Wiki
Site has exactly one drive, named Dokumente: GET /v1.0/sites/{site-id}/drives
Drive root contains both file and folder entries: GET /v1.0/sites/{site-id}/drives/{drive-id}/root/children
Nested content also readable: GET /v1.0/sites/{site-id}/drives/{drive-id}/root:/General/Folder%20Intern:/children

So files exist at the library root (not only in subfolders) and are readable with the same app-only token oikb uses — yet oikb retrieves 0.

Ruled out:

Auth/permissions — identical Graph calls succeed with the same credentials; Sites.Read.All (Application) + admin consent.
Wrong drive — the site has only one drive, and it's named Dokumente.
Subfolders/recursion — files exist at the root, so this is not merely a missing-recursion case.
Config scoping — reproduced with no filter, with filter.include: ["General/**"], with --path "General/...", and with config path:. All return 0 files.

Expected:
The connector enumerates and syncs the files in the Dokumente drive; validate --deep should handle an empty result without crashing.

Actual:
0 files; validate --deep crashes on len(None).

Additional docs note (separate, minor):
The SharePoint guide doesn't mention that the connector authenticates via Microsoft Graph and therefore needs Microsoft Graph application permissions (Sites.Read.All) — not only SharePoint-API permissions. Granting just the SharePoint-API permission yields a token with the wrong audience and a generalException on every Graph call, which is confusing to debug. Adding this to the guide would help.

Thank you for creating and maintaining this project ;)

Originally created by @foss-eyay on GitHub (Jun 15, 2026). Original GitHub issue: https://github.com/open-webui/oikb/issues/53 **Environment:** oikb version: 0.3.5 (Docker, ghcr.io/open-webui/oikb) Open WebUI: v0.9.6 (Docker) Connector: SharePoint, app-only auth (client secret) Graph permission: Sites.Read.All (Application type, admin consent granted) SharePoint permissions: Sites.Read.All (Application type, admin consent granted) **Summary:** For a SharePoint document library that demonstrably contains files, `oikb validate --deep` crashes with `object of type 'NoneType' has no len()`, and `oikb sync` reports 0 files found. Authentication to both Open WebUI and SharePoint succeeds, and the library contents are confirmed readable via Microsoft Graph using the exact same app-only credentials oikb is configured with. **Config:** ``` sources: - name: Images source: sharepoint:<tenant>.sharepoint.com/Dokumente kb-id: <kb-id> interval: 1h ``` **Errors:** ``` $ oikb validate --deep Deep validation ✓ API reachable http://open-webui:8080/api/v1/ ✗ Images: KB <kb-id> — object of type 'NoneType' has no len() ``` ``` $ oikb sync --dry-run -v Syncing: sharepoint:<tenant>.sharepoint.com/Dokumente → <kb-id> Scanning source... 0 files found Source is empty — nothing to sync. ``` The NoneType has no len() appears to indicate the library enumeration returns None (or nothing), which is then passed to len() without a guard. The sync path handles the same empty result more gracefully ("Source is empty"), but the underlying problem looks identical: the connector retrieves no items for this library. The library is NOT empty — confirmed via Graph with the same credentials: Site resolves: GET /v1.0/sites/<tenant>.sharepoint.com:/sites/Wiki Site has exactly one drive, named Dokumente: GET /v1.0/sites/{site-id}/drives Drive root contains both file and folder entries: GET /v1.0/sites/{site-id}/drives/{drive-id}/root/children Nested content also readable: GET /v1.0/sites/{site-id}/drives/{drive-id}/root:/General/Folder%20Intern:/children So files exist at the library root (not only in subfolders) and are readable with the same app-only token oikb uses — yet oikb retrieves 0. **Ruled out:** Auth/permissions — identical Graph calls succeed with the same credentials; Sites.Read.All (Application) + admin consent. Wrong drive — the site has only one drive, and it's named Dokumente. Subfolders/recursion — files exist at the root, so this is not merely a missing-recursion case. Config scoping — reproduced with no filter, with filter.include: ["General/**"], with --path "General/...", and with config path:. All return 0 files. **Expected:** The connector enumerates and syncs the files in the Dokumente drive; validate --deep should handle an empty result without crashing. **Actual:** 0 files; validate --deep crashes on len(None). **Additional docs note (separate, minor):** The SharePoint guide doesn't mention that the connector authenticates via Microsoft Graph and therefore needs Microsoft Graph application permissions (Sites.Read.All) — not only SharePoint-API permissions. Granting just the SharePoint-API permission yields a token with the wrong audience and a generalException on every Graph call, which is confusing to debug. Adding this to the guide would help. Thank you for creating and maintaining this project ;)
Author
Owner

@itstechgaurav commented on GitHub (Jul 6, 2026):

Hey @foss-eyay i am also going through this. Were you able to find the solution?

<!-- gh-comment-id:4896179192 --> @itstechgaurav commented on GitHub (Jul 6, 2026): Hey @foss-eyay i am also going through this. Were you able to find the solution?
Author
Owner

@foss-eyay commented on GitHub (Aug 3, 2026):

Hi @itstechgaurav, no sorry, I was unable to fix it. So I worked around with a direct graph (and sharepoint) API requests to access my content.

<!-- gh-comment-id:5163512968 --> @foss-eyay commented on GitHub (Aug 3, 2026): Hi @itstechgaurav, no sorry, I was unable to fix it. So I worked around with a direct graph (and sharepoint) API requests to access my content.
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#34
No description provided.