[GH-ISSUE #5272] [BUG]: API endpoint /v1/document/upload/{folderName} return Internal Server Error on Windows #4994

Closed
opened 2026-06-05 14:51:22 -04:00 by yindo · 4 comments
Owner

Originally created by @B4ndre4 on GitHub (Mar 26, 2026).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/5272

How are you running AnythingLLM?

AnythingLLM desktop app

What happened?

AnythingLLM Desktop v1.11.2 on Windows 11. Calling API endpoint /v1/document/upload/{folderName} always return an internal server error (please find attached backend and collector logs), whether the folder already exists or not. The problem is not present on Linux, same AnythingLLM Desktop version (Appimage format).

upload_dir_backend-2026-03-26.log
upload_dir_collector-2026-03-26.log

Are there known steps to reproduce?

Just use the API interface provided in the "Developer API" menu to upload a document in a folder, you''ll receive the error above.

Originally created by @B4ndre4 on GitHub (Mar 26, 2026). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/5272 ### How are you running AnythingLLM? AnythingLLM desktop app ### What happened? AnythingLLM Desktop v1.11.2 on Windows 11. Calling API endpoint /v1/document/upload/{folderName} always return an internal server error (please find attached backend and collector logs), whether the folder already exists or not. The problem is not present on Linux, same AnythingLLM Desktop version (Appimage format). [upload_dir_backend-2026-03-26.log](https://github.com/user-attachments/files/26274021/upload_dir_backend-2026-03-26.log) [upload_dir_collector-2026-03-26.log](https://github.com/user-attachments/files/26274020/upload_dir_collector-2026-03-26.log) ### Are there known steps to reproduce? Just use the API interface provided in the "Developer API" menu to upload a document in a folder, you''ll receive the error above.
yindo added the possible bug label 2026-06-05 14:51:23 -04:00
yindo closed this issue 2026-06-05 14:51:23 -04:00
Author
Owner

@timothycarambat commented on GitHub (Mar 26, 2026):

curl --location 'http://localhost:3001/api/v1/document/upload/my-special-doc-folder' \
--header 'Authorization: Bearer xx-xx-xxx-xxx' \
--form 'file=@"/Users/xxx/Desktop/DOCUMENT-GENERATION-PLAN.md"'

200OK

{
    "success": true,
    "error": null,
    "documents": [
        {
            "id": "954dc7e4-c8fe-40bd-9640-56d93f6b9bc5",
            "url": "file:///Users/xxx/Library/Application Support/anythingllm-desktop/storage/hotdir/DOCUMENT-GENERATION-PLAN.md",
            "title": "DOCUMENT-GENERATION-PLAN.md",
            "docAuthor": "Unknown",
            "description": "Unknown",
            "docSource": "a text file uploaded by the user.",
            "chunkSource": "localfile://xxxx",
            "published": "3/26/2026, 1:45:07 PM",
            "wordCount": 2498,
            "pageContent": "# Document Generation ....",
            "token_count_estimate": 1362,
            "location": "my-special-doc-folder/DOCUMENT-GENERATION-PLAN.md-954dc7e4-c8fe-40bd-9640-56d93f6b9bc5.json",
            "isDirectUpload": false,
            "name": "DOCUMENT-GENERATION-PLAN.md-954dc7e4-c8fe-40bd-9640-56d93f6b9bc5.json"
        }
    ]
}

Do you have an example POST Payload I can repro with?

<!-- gh-comment-id:4138104801 --> @timothycarambat commented on GitHub (Mar 26, 2026): ```bash curl --location 'http://localhost:3001/api/v1/document/upload/my-special-doc-folder' \ --header 'Authorization: Bearer xx-xx-xxx-xxx' \ --form 'file=@"/Users/xxx/Desktop/DOCUMENT-GENERATION-PLAN.md"' ``` 200OK ```json { "success": true, "error": null, "documents": [ { "id": "954dc7e4-c8fe-40bd-9640-56d93f6b9bc5", "url": "file:///Users/xxx/Library/Application Support/anythingllm-desktop/storage/hotdir/DOCUMENT-GENERATION-PLAN.md", "title": "DOCUMENT-GENERATION-PLAN.md", "docAuthor": "Unknown", "description": "Unknown", "docSource": "a text file uploaded by the user.", "chunkSource": "localfile://xxxx", "published": "3/26/2026, 1:45:07 PM", "wordCount": 2498, "pageContent": "# Document Generation ....", "token_count_estimate": 1362, "location": "my-special-doc-folder/DOCUMENT-GENERATION-PLAN.md-954dc7e4-c8fe-40bd-9640-56d93f6b9bc5.json", "isDirectUpload": false, "name": "DOCUMENT-GENERATION-PLAN.md-954dc7e4-c8fe-40bd-9640-56d93f6b9bc5.json" } ] } ``` Do you have an example POST Payload I can repro with?
Author
Owner

@B4ndre4 commented on GitHub (Mar 27, 2026):

Yes, using API GUI:

Image

And backend.log is:

{"level":"error","message":"ENOENT: no such file or directory, rename 'C:\Users\andrea\AppData\Roaming\anythingllm-desktop\storage\documents\C:\Users\andrea\AppData\Roaming\anythingllm-desktop\storage\documents\custom-documents\An-introduction-to-neural-networks-for-beginners.pdf-484e23f6-911c-41a6-b0e5-2c339c375070.json' -> 'C:\Users\andrea\AppData\Roaming\anythingllm-desktop\storage\documents\myfolder\An-introduction-to-neural-networks-for-beginners.pdf-484e23f6-911c-41a6-b0e5-2c339c375070.json' Error: ENOENT: no such file or directory, rename 'C:\Users\andrea\AppData\Roaming\anythingllm-desktop\storage\documents\C:\Users\andrea\AppData\Roaming\anythingllm-desktop\storage\documents\custom-documents\An-introduction-to-neural-networks-for-beginners.pdf-484e23f6-911c-41a6-b0e5-2c339c375070.json' -> 'C:\Users\andrea\AppData\Roaming\anythingllm-desktop\storage\documents\myfolder\An-introduction-to-neural-networks-for-beginners.pdf-484e23f6-911c-41a6-b0e5-2c339c375070.json'\n at Object.renameSync (node:fs:1032:11)\n at C:\Users\andrea\AppData\Local\Programs\AnythingLLM\resources\backend\server.js:318:7448\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","service":"backend"}

Thanks

<!-- gh-comment-id:4140986276 --> @B4ndre4 commented on GitHub (Mar 27, 2026): Yes, using API GUI: <img width="919" height="731" alt="Image" src="https://github.com/user-attachments/assets/f07e46dd-d8af-4d64-9c7f-2db6248b8fc5" /> And backend.log is: {"level":"error","message":"ENOENT: no such file or directory, rename 'C:\\Users\\andrea\\AppData\\Roaming\\anythingllm-desktop\\storage\\documents\\C:\\Users\\andrea\\AppData\\Roaming\\anythingllm-desktop\\storage\\documents\\custom-documents\\An-introduction-to-neural-networks-for-beginners.pdf-484e23f6-911c-41a6-b0e5-2c339c375070.json' -> 'C:\\Users\\andrea\\AppData\\Roaming\\anythingllm-desktop\\storage\\documents\\myfolder\\An-introduction-to-neural-networks-for-beginners.pdf-484e23f6-911c-41a6-b0e5-2c339c375070.json' Error: ENOENT: no such file or directory, rename 'C:\\Users\\andrea\\AppData\\Roaming\\anythingllm-desktop\\storage\\documents\\C:\\Users\\andrea\\AppData\\Roaming\\anythingllm-desktop\\storage\\documents\\custom-documents\\An-introduction-to-neural-networks-for-beginners.pdf-484e23f6-911c-41a6-b0e5-2c339c375070.json' -> 'C:\\Users\\andrea\\AppData\\Roaming\\anythingllm-desktop\\storage\\documents\\myfolder\\An-introduction-to-neural-networks-for-beginners.pdf-484e23f6-911c-41a6-b0e5-2c339c375070.json'\n at Object.renameSync (node:fs:1032:11)\n at C:\\Users\\andrea\\AppData\\Local\\Programs\\AnythingLLM\\resources\\backend\\server.js:318:7448\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","service":"backend"} Thanks
Author
Owner

@timothycarambat commented on GitHub (Mar 27, 2026):

Oh, do not use the Swagger UI for file attachments - it is blocked intentionally because the docs page is open and people should not be able to push binaries/files from that. Use a proper CURL command or an REST API GUI like Bruno or Postman to test file uploads

<!-- gh-comment-id:4144476076 --> @timothycarambat commented on GitHub (Mar 27, 2026): Oh, do not use the Swagger UI for file attachments - it is blocked intentionally because the docs page is open and people should not be able to push binaries/files from that. Use a proper CURL command or an REST API GUI like Bruno or Postman to test file uploads
Author
Owner

@B4ndre4 commented on GitHub (Mar 27, 2026):

I used curl (Windows version), no difference (see below): upload a file with no folder specified works well; with the folder always receive Internal Server Error

Image
<!-- gh-comment-id:4145721579 --> @B4ndre4 commented on GitHub (Mar 27, 2026): I used curl (Windows version), no difference (see below): upload a file with no folder specified works well; with the folder always receive Internal Server Error <img width="1120" height="994" alt="Image" src="https://github.com/user-attachments/assets/3527f514-2748-4ea7-8e20-1feafd9d5845" />
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#4994