[GH-ISSUE #8889] User groups with write access to Knowledge base unable to upload files #15310

Closed
opened 2026-04-19 21:33:53 -05:00 by GiteaMirror · 10 comments
Owner

Originally created by @btreich on GitHub (Jan 24, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/8889

Bug Report


Installation Method

Docker Swarm

Environment

  • Open WebUI Version: v0.5.7 (main branch)

  • Ollama (if applicable): 0.5.7-0-ga420a45-dirty

  • Operating System:

    • Server: Debian 12
    • Client: Windows 11
  • Browser (if applicable): Firefox 134.0.1 (64-bit)

Confirmation:

  • I have read and followed all the instructions provided in the README.md.
  • I am on the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below.

Expected Behavior:

Users in a group having the ability to upload files to their assigned knowledge base

Actual Behavior:

Users in the group faced an error stating they were unable to upload a file and to check permissions with their administrator

Description

Bug Summary:

When a knowledge base is created and write permissions are assigned to a group, users in the group are unable to upload files. A couple of messages stating "Failed to add file." and "You do not have permission to access this resource. Please contact your administrator for assistance." are presented to the users despite being assigned proper access.

Reproduction Details

Steps to Reproduce:

  1. Create a user group and assign a user to the group. Ensure proper permissions to have Knowledge access in the Workspace permissions.
  2. Create a knowledge base to use for the group.
  3. Assign the group write access to the knowledge base.
  4. Sign in as a user that's part of the group and navigate to the knowledge base.
  5. Attempt to upload a file to the knowledge base as the user.

Logs and Screenshots

Browser Console Logs:

File { name: "test-data.txt", lastModified: 1737745202180, webkitRelativePath: "", size: 9, type: "text/plain" }
22.Dn9P5_ts.js:1:37942

Object { type: "file", file: "", id: null, url: "", name: "test-data.txt", size: 9, status: "uploading", error: "", itemId: "7f4df4b3-2f35-435a-a706-73e474cea6a2" }
FileItem.i5YYAUhZ.js:7:5828

Object { id: "5717ea48-4bef-4463-a0a6-9524b8ca1319", user_id: "0f22e1c6-9533-4fcf-8de4-622c698f9760", hash: "916f0027a575074ce72a331777c3478d6513f786a591bd892da1a577bf2335f9", filename: "test-data.txt", data: {…}, meta: {…}, created_at: 1737747492, updated_at: 1737747492 }
22.Dn9P5_ts.js:1:38491

XHRPOST
http://ai.internal:8080/api/v1/knowledge/e7f04996-dc7f-45cc-af12-ea7e06dced2f/file/add
[HTTP/1.1 400 Bad Request 25ms]

Object { detail: "You do not have permission to access this resource. Please contact your administrator for assistance." }
index.C1_J-sAl.js:1:2233

Object { detail: "You do not have permission to access this resource. Please contact your administrator for assistance." }
index.C1_J-sAl.js:1:2233

Docker Container Logs:

INFO [open_webui.routers.files] file.content_type: text/plain

INFO [open_webui.routers.retrieval] save_docs_to_vector_db: document test-data.txt file-5717ea48-4bef-4463-a0a6-9524b8ca1319

INFO [open_webui.routers.retrieval] adding to collection file-5717ea48-4bef-4463-a0a6-9524b8ca1319

Collection file-5717ea48-4bef-4463-a0a6-9524b8ca1319 does not exist.

INFO: 10.0.0.7:61574 - "POST /api/v1/files/ HTTP/1.1" 200 OK

INFO: 10.0.0.7:61574 - "POST /api/v1/knowledge/e7f04996-dc7f-45cc-af12-ea7e06dced2f/file/add HTTP/1.1" 400 Bad Request

INFO: 10.0.0.7:61624 - "GET /api/v1/chats/d3017cc1-4670-40d3-bf5d-cde120dd5956 HTTP/1.1" 200 OK

WARNI [python_multipart.multipart] Skipping data after last boundary

INFO [open_webui.routers.files] file.content_type: text/plain

INFO [open_webui.routers.retrieval] save_docs_to_vector_db: document test-data.txt file-d0c46c0b-6705-4442-9da6-ca9c298a3e19

INFO [open_webui.routers.retrieval] adding to collection file-d0c46c0b-6705-4442-9da6-ca9c298a3e19

Collection file-d0c46c0b-6705-4442-9da6-ca9c298a3e19 does not exist.

INFO: 10.0.0.7:61636 - "POST /api/v1/files/ HTTP/1.1" 200 OK

INFO: 10.0.0.7:61636 - "POST /api/v1/knowledge/e7f04996-dc7f-45cc-af12-ea7e06dced2f/file/add HTTP/1.1" 400 Bad Request

Screenshots/Screen Recordings (if applicable):

Image

Additional Information

I did find if a user creates their own knowledge base, they are able to upload their files, but the issue still persists to anyone else in the group when following the same assignment steps.

Also, as seen briefly in my screen recording when assigning the group to the knowledge base, I was unable to initially change the group permissions from "Read" until I hit the "Access" button and switched it after the knowledge base creation.

Note

If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!

Originally created by @btreich on GitHub (Jan 24, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/8889 # Bug Report --- ## Installation Method Docker Swarm ## Environment - **Open WebUI Version:** v0.5.7 (main branch) - **Ollama (if applicable):** 0.5.7-0-ga420a45-dirty - **Operating System:** - Server: Debian 12 - Client: Windows 11 - **Browser (if applicable):** Firefox 134.0.1 (64-bit) **Confirmation:** - [x] I have read and followed all the instructions provided in the README.md. - [x] I am on the latest version of both Open WebUI and Ollama. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below. ## Expected Behavior: Users in a group having the ability to upload files to their assigned knowledge base ## Actual Behavior: Users in the group faced an error stating they were unable to upload a file and to check permissions with their administrator ## Description **Bug Summary:** When a knowledge base is created and write permissions are assigned to a group, users in the group are unable to upload files. A couple of messages stating "Failed to add file." and "You do not have permission to access this resource. Please contact your administrator for assistance." are presented to the users despite being assigned proper access. ## Reproduction Details **Steps to Reproduce:** 1. Create a user group and assign a user to the group. Ensure proper permissions to have Knowledge access in the Workspace permissions. 2. Create a knowledge base to use for the group. 3. Assign the group write access to the knowledge base. 4. Sign in as a user that's part of the group and navigate to the knowledge base. 5. Attempt to upload a file to the knowledge base as the user. ## Logs and Screenshots **Browser Console Logs:** File { name: "test-data.txt", lastModified: 1737745202180, webkitRelativePath: "", size: 9, type: "text/plain" } 22.Dn9P5_ts.js:1:37942 Object { type: "file", file: "", id: null, url: "", name: "test-data.txt", size: 9, status: "uploading", error: "", itemId: "7f4df4b3-2f35-435a-a706-73e474cea6a2" } FileItem.i5YYAUhZ.js:7:5828 Object { id: "5717ea48-4bef-4463-a0a6-9524b8ca1319", user_id: "0f22e1c6-9533-4fcf-8de4-622c698f9760", hash: "916f0027a575074ce72a331777c3478d6513f786a591bd892da1a577bf2335f9", filename: "test-data.txt", data: {…}, meta: {…}, created_at: 1737747492, updated_at: 1737747492 } 22.Dn9P5_ts.js:1:38491 XHRPOST http://ai.internal:8080/api/v1/knowledge/e7f04996-dc7f-45cc-af12-ea7e06dced2f/file/add [HTTP/1.1 400 Bad Request 25ms] Object { detail: "You do not have permission to access this resource. Please contact your administrator for assistance." } index.C1_J-sAl.js:1:2233 Object { detail: "You do not have permission to access this resource. Please contact your administrator for assistance." } index.C1_J-sAl.js:1:2233 **Docker Container Logs:** INFO [open_webui.routers.files] file.content_type: text/plain INFO [open_webui.routers.retrieval] save_docs_to_vector_db: document test-data.txt file-5717ea48-4bef-4463-a0a6-9524b8ca1319 INFO [open_webui.routers.retrieval] adding to collection file-5717ea48-4bef-4463-a0a6-9524b8ca1319 Collection file-5717ea48-4bef-4463-a0a6-9524b8ca1319 does not exist. INFO: 10.0.0.7:61574 - "POST /api/v1/files/ HTTP/1.1" 200 OK INFO: 10.0.0.7:61574 - "POST /api/v1/knowledge/e7f04996-dc7f-45cc-af12-ea7e06dced2f/file/add HTTP/1.1" 400 Bad Request INFO: 10.0.0.7:61624 - "GET /api/v1/chats/d3017cc1-4670-40d3-bf5d-cde120dd5956 HTTP/1.1" 200 OK WARNI [python_multipart.multipart] Skipping data after last boundary INFO [open_webui.routers.files] file.content_type: text/plain INFO [open_webui.routers.retrieval] save_docs_to_vector_db: document test-data.txt file-d0c46c0b-6705-4442-9da6-ca9c298a3e19 INFO [open_webui.routers.retrieval] adding to collection file-d0c46c0b-6705-4442-9da6-ca9c298a3e19 Collection file-d0c46c0b-6705-4442-9da6-ca9c298a3e19 does not exist. INFO: 10.0.0.7:61636 - "POST /api/v1/files/ HTTP/1.1" 200 OK INFO: 10.0.0.7:61636 - "POST /api/v1/knowledge/e7f04996-dc7f-45cc-af12-ea7e06dced2f/file/add HTTP/1.1" 400 Bad Request **Screenshots/Screen Recordings (if applicable):** ![Image](https://github.com/user-attachments/assets/79617847-1bcd-47d5-8306-1c0e2e0224ac) ## Additional Information I did find if a user creates their own knowledge base, they are able to upload their files, but the issue still persists to anyone else in the group when following the same assignment steps. Also, as seen briefly in my screen recording when assigning the group to the knowledge base, I was unable to initially change the group permissions from "Read" until I hit the "Access" button and switched it after the knowledge base creation. ## Note If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!
Author
Owner

@cwthomas-llu commented on GitHub (Jan 24, 2025):

We ran into the same issue. It has to do with the code only allowing you to associate a file to a knowledge base if you are either the owner of the knowledge base or an admin. Please check out b72150c881/backend/open_webui/routers/knowledge.py (L267) This check needs to be changed to allow people with RW access to associate a file with a knowledge base. This same issue appears when listing knowledge bases and doing other knowledge base operations.

This issue makes it very difficult to have a service account do stuff without being either an admin or owning the knowledge base.

<!-- gh-comment-id:2613391324 --> @cwthomas-llu commented on GitHub (Jan 24, 2025): We ran into the same issue. It has to do with the code only allowing you to associate a file to a knowledge base if you are either the owner of the knowledge base or an admin. Please check out https://github.com/open-webui/open-webui/blob/b72150c881955721a63ae7f4ea1b9ea293816fc1/backend/open_webui/routers/knowledge.py#L267 This check needs to be changed to allow people with RW access to associate a file with a knowledge base. This same issue appears when listing knowledge bases and doing other knowledge base operations. This issue makes it very difficult to have a service account do stuff without being either an admin or owning the knowledge base.
Author
Owner

@btreich commented on GitHub (Jan 24, 2025):

Definitely agree on the difficulty factor. We currently have users we are trying to allow uploading of their own files so they don't have to go through admins, which this issue is hindering that ability.

Looking at the file you linked, it appears to me like the knowledge object has the ability to look at its ACL via the access_control property, which also shows in the class definition what is stored in the property:

b72150c881/backend/open_webui/models/knowledge.py (L27-L57)

Also, something similar seems to be done in the update_knowledge_by_id routing function above it to check user permissions on the knowledge base ACL:

b72150c881/backend/open_webui/routers/knowledge.py (L216-L225)

Unless I'm misreading the code, it might be as simple as adding that additional check?

<!-- gh-comment-id:2613447176 --> @btreich commented on GitHub (Jan 24, 2025): Definitely agree on the difficulty factor. We currently have users we are trying to allow uploading of their own files so they don't have to go through admins, which this issue is hindering that ability. Looking at the file you linked, it appears to me like the `knowledge` object has the ability to look at its ACL via the `access_control` property, which also shows in the class definition what is stored in the property: https://github.com/open-webui/open-webui/blob/b72150c881955721a63ae7f4ea1b9ea293816fc1/backend/open_webui/models/knowledge.py#L27-L57 Also, something similar seems to be done in the `update_knowledge_by_id` routing function above it to check user permissions on the knowledge base ACL: https://github.com/open-webui/open-webui/blob/b72150c881955721a63ae7f4ea1b9ea293816fc1/backend/open_webui/routers/knowledge.py#L216-L225 Unless I'm misreading the code, it might be as simple as adding that additional check?
Author
Owner

@tjbck commented on GitHub (Jan 27, 2025):

@tarmst

<!-- gh-comment-id:2615020656 --> @tjbck commented on GitHub (Jan 27, 2025): @tarmst
Author
Owner

@NovaYear commented on GitHub (Jan 27, 2025):

open-webui=0.5.7. not working file upload.
I think I have the same problem. The open-webui process ends without reporting any errors during the file upload process. There was no such problem in the previous version 0.5.4, it appeared after I updated to version 0.5.7 last night.

windows.console output ::

INFO:     ('127.0.0.1', 53864) - "WebSocket /ws/socket.io/?EIO=4&transport=websocket" [accepted]
INFO:     connection open
INFO:     127.0.0.1:53865 - "GET /_app/immutable/chunks/index.CGwCSIWv.js.map HTTP/1.1" 200 OK
INFO:     127.0.0.1:53866 - "GET /_app/immutable/chunks/Help.B2mjg06d.js.map HTTP/1.1" 200 OK
INFO:     127.0.0.1:53867 - "GET /_app/immutable/nodes/0.BGP_ULNG.js.map HTTP/1.1" 200 OK
WARNI [python_multipart.multipart] Skipping data after last boundary
INFO  [open_webui.routers.files] file.content_type: application/octet-stream
INFO:     127.0.0.1:53870 - "GET /_app/immutable/chunks/FileItem.CACyhZZd.js.map HTTP/1.1" 200 OK
INFO  [open_webui.routers.retrieval] save_docs_to_vector_db: document default.txt file-f47234fd-f1df-4958-b0d7-4c4994ee8709
Collection file-f47234fd-f1df-4958-b0d7-4c4994ee8709 does not exist.
INFO  [open_webui.routers.retrieval] adding to collection file-f47234fd-f1df-4958-b0d7-4c4994ee8709

firefox.browser.console output::

drop { target: p.is-empty.is-editor-empty
, buttons: 0, clientX: 630, clientY: 504, layerX: 182, layerY: 20 }
[MessageInput.svelte:302:10](http://localhost:8080/src/lib/components/chat/MessageInput.svelte)
Array [ File ]
[MessageInput.svelte:307:12](http://localhost:8080/src/lib/components/chat/MessageInput.svelte)
Input files handler called with: 
Array [ File ]
[MessageInput.svelte:220:10](http://localhost:8080/src/lib/components/chat/MessageInput.svelte)
Processing file: 
Object { name: "default.txt", type: "", size: 38746, extension: "txt" }
[MessageInput.svelte:222:11](http://localhost:8080/src/lib/components/chat/MessageInput.svelte)
Object { type: "file", file: "", id: null, url: "", name: "default.txt", collection_name: "", status: "uploading", size: 38746, error: "", itemId: "f72fb0bf-585a-48db-99ea-3f7ac563c025" }
[FileItemModal.svelte:21:10](http://localhost:8080/src/lib/components/common/FileItemModal.svelte)
The connection to the server ws://localhost:8080/ws/socket.io/?EIO=4&transport=websocket was lost while loading the page.
<!-- gh-comment-id:2615332671 --> @NovaYear commented on GitHub (Jan 27, 2025): open-webui=0.5.7. not working file upload. I think I have the same problem. The open-webui process ends without reporting any errors during the file upload process. There was no such problem in the previous version 0.5.4, it appeared after I updated to version 0.5.7 last night. **windows.console output ::** ``` INFO: ('127.0.0.1', 53864) - "WebSocket /ws/socket.io/?EIO=4&transport=websocket" [accepted] INFO: connection open INFO: 127.0.0.1:53865 - "GET /_app/immutable/chunks/index.CGwCSIWv.js.map HTTP/1.1" 200 OK INFO: 127.0.0.1:53866 - "GET /_app/immutable/chunks/Help.B2mjg06d.js.map HTTP/1.1" 200 OK INFO: 127.0.0.1:53867 - "GET /_app/immutable/nodes/0.BGP_ULNG.js.map HTTP/1.1" 200 OK WARNI [python_multipart.multipart] Skipping data after last boundary INFO [open_webui.routers.files] file.content_type: application/octet-stream INFO: 127.0.0.1:53870 - "GET /_app/immutable/chunks/FileItem.CACyhZZd.js.map HTTP/1.1" 200 OK INFO [open_webui.routers.retrieval] save_docs_to_vector_db: document default.txt file-f47234fd-f1df-4958-b0d7-4c4994ee8709 Collection file-f47234fd-f1df-4958-b0d7-4c4994ee8709 does not exist. INFO [open_webui.routers.retrieval] adding to collection file-f47234fd-f1df-4958-b0d7-4c4994ee8709 ``` **firefox.browser.console output::** ``` drop { target: p.is-empty.is-editor-empty , buttons: 0, clientX: 630, clientY: 504, layerX: 182, layerY: 20 } [MessageInput.svelte:302:10](http://localhost:8080/src/lib/components/chat/MessageInput.svelte) Array [ File ] [MessageInput.svelte:307:12](http://localhost:8080/src/lib/components/chat/MessageInput.svelte) Input files handler called with: Array [ File ] [MessageInput.svelte:220:10](http://localhost:8080/src/lib/components/chat/MessageInput.svelte) Processing file: Object { name: "default.txt", type: "", size: 38746, extension: "txt" } [MessageInput.svelte:222:11](http://localhost:8080/src/lib/components/chat/MessageInput.svelte) Object { type: "file", file: "", id: null, url: "", name: "default.txt", collection_name: "", status: "uploading", size: 38746, error: "", itemId: "f72fb0bf-585a-48db-99ea-3f7ac563c025" } [FileItemModal.svelte:21:10](http://localhost:8080/src/lib/components/common/FileItemModal.svelte) The connection to the server ws://localhost:8080/ws/socket.io/?EIO=4&transport=websocket was lost while loading the page. ```
Author
Owner

@tarmst commented on GitHub (Jan 27, 2025):

Sorry for the delay! I can take a look and hopefully submit a PR today. It probably is as simple as adding the check that btreich suggested.

Out of curiosity, was the groups read/write added to 0.5.4 and working? I'm not sure which version it was originally added to.

Edit: I see NovaYear says it was working with 0.5.4, I just want to double check.

<!-- gh-comment-id:2615894181 --> @tarmst commented on GitHub (Jan 27, 2025): Sorry for the delay! I can take a look and hopefully submit a PR today. It probably is as simple as adding the check that btreich suggested. Out of curiosity, was the groups read/write added to 0.5.4 and working? I'm not sure which version it was originally added to. Edit: I see NovaYear says it was working with 0.5.4, I just want to double check.
Author
Owner

@kunaltyagi commented on GitHub (Feb 1, 2025):

Image
I have this issue with ghcr.io image (main). Is this related?

<!-- gh-comment-id:2629008054 --> @kunaltyagi commented on GitHub (Feb 1, 2025): ![Image](https://github.com/user-attachments/assets/81228d7d-a210-4ab9-a604-b25fc177c643) I have this issue with ghcr.io image (`main`). Is this related?
Author
Owner

@tarmst commented on GitHub (Feb 14, 2025):

@btreich Is this working for you now in the most recent release? If so, we could ask the owners to close it.

<!-- gh-comment-id:2660049048 --> @tarmst commented on GitHub (Feb 14, 2025): @btreich Is this working for you now in the most recent release? If so, we could ask the owners to close it.
Author
Owner

@btreich commented on GitHub (Feb 14, 2025):

@tarmst The issue looks to be resolved when I tested it again with v0.5.12. I believe we can close it. Thank you for all of the help!

<!-- gh-comment-id:2660098932 --> @btreich commented on GitHub (Feb 14, 2025): @tarmst The issue looks to be resolved when I tested it again with v0.5.12. I believe we can close it. Thank you for all of the help!
Author
Owner

@zhaowei0315 commented on GitHub (Feb 24, 2025):

Hello All,
is it solved?
I create a knowledge base and set is as public.
but the normal user cannot see it and upload files to it.
how can make it possible?
thank you very much.

BR,
Felix

<!-- gh-comment-id:2677300236 --> @zhaowei0315 commented on GitHub (Feb 24, 2025): Hello All, is it solved? I create a knowledge base and set is as public. but the normal user cannot see it and upload files to it. how can make it possible? thank you very much. BR, Felix
Author
Owner

@ivanbaldo commented on GitHub (Mar 17, 2025):

Related to this, the users can't download the source document, see https://github.com/open-webui/open-webui/discussions/7578 .

<!-- gh-comment-id:2731130418 --> @ivanbaldo commented on GitHub (Mar 17, 2025): Related to this, the users can't download the source document, see https://github.com/open-webui/open-webui/discussions/7578 .
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#15310