mirror of
https://github.com/open-webui/oikb.git
synced 2026-11-05 01:27:25 +00:00
[GH-ISSUE #51] 401 unauthorized on openwebui #31
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#31
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 @huntyh on GitHub (Jun 14, 2026).
Original GitHub issue: https://github.com/open-webui/oikb/issues/51
Hello,
After several hours of troubleshooting, I can't get the OIKB daemon to work, as I always get a 401 Unauthorized reply.
Compose:
Config:
I tried both the sk-[key] and the JWT token, none of them work and I always get 401. The api key was created with my admin account, the knowledge base has global write access enabled, nothing I try works.
I noticed that if I use CURL with my api key on the host machine, i get 401s, but if I use CURL with my JWT token on the host machine, it goes through.
@omeganot commented on GitHub (Jun 17, 2026):
I just ran into this issue myself. I think it's parsing the token oddly. After reading through the code (and I'm not great at Python) it seems like there's a chance in the resolve_token method (config.py) that the OPEN_WEBUI_API_KEY doesn't actually get used. I think when the OikbClient gets created it could be passing an empty string for the token somewhere, thus overriding the environment variable (which comes second in resolve_token). That leads to the 401 error.
What fixed it for me was providing the API key for my account from Open WebUI (not the JWT) as the token parameter under that git source. Which is bonkers. But, it worked. I provided the GITHUB_TOKEN through the environment variable, and the OWUI token in my .oikb.yaml file where you have ${GITLAB_TOKEN}.
This would also mean you can only authenticate with one GitHub account and one GitLab account, which each have access to any repo you want to sync, as those have to be environment variables.
@silentoplayz commented on GitHub (Jun 19, 2026):
Confirming this issue on oikb 0.3.5 + Open WebUI 0.9.6 (dev).
Symptoms: Initial sync via
/api/v1/files/succeeds (all 295 files uploaded), but subsequent incremental syncs fail with401 UnauthorizedonPOST /api/v1/knowledge/{id}/sync/diff.Debugging steps that narrowed it down:
/sync/diffdirectly from another container on the same Docker network viacurl— returns200 OK/sync/diffreturns 401Root cause: As @omeganot identified, the
token:field in the source config (intended for the source connector, e.g.GITHUB_TOKEN) appears to overrideOPEN_WEBUI_API_KEYwhen oikb constructs the request to the/sync/diffendpoint.Workaround: Remove
token:from the source config entirely. The GitHub/GitLab token is still picked up from the environment variable automatically.@omeganot commented on GitHub (Jun 20, 2026):
@silentoplayz - Thanks for the tip on removing the token variable from the config. I'll give that a try too. Still an error here between intention and implementation, it seems, but this is another good workaround for now.