[GH-ISSUE #5257] [BUG]: File uploading fails on Windows 11 25H2 due to full-width quotes being incorrectly normalized into illegal half-width quotes #4989

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

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

Originally assigned to: @timothycarambat on GitHub.

How are you running AnythingLLM?

AnythingLLM desktop app

What happened?

On Windows 11 25H2 Desktop version, uploading files with full-width quotation marks (e.g., and ) in the filename fails immediately. Although these are legal characters in Windows, the backend collector seems to incorrectly normalize or escape them into half-width quotes ("), which are illegal in Windows file paths, causing an ENOENT error in the file-writing pipeline.

Image

Actual Behavior:

  • The UI reports a processing error.
  • The file is not added to the library, but a copy remains orphaned in the local directory: %AppData%\anythingllm-desktop\storage\hotdir.
  • Log Evidence: The collector.log confirms that the system fails when attempting to write a .json metadata file to the following path (which contains illegal "): %AppData%\anythingllm-desktop\storage\documents\custom-documents\"test".md-[UUID].json

Full Error Log:

JSON

{"level":"info","message":"-- Working ”test“.md --","service":"collector"}
{"level":"error","message":"Error: ENOENT: no such file or directory, open 'C:\\Users\\na\\AppData\\Roaming\\anythingllm-desktop\\storage\\documents\\custom-documents\\\"test\".md-341fbfa4-7429-44dc-bc61-fe8f0f2a040e.json'\n    at Object.writeFileSync (node:fs:2367:20)\n    at Rr (D:\\Program Files\\AnythingLLM\\resources\\backend\\collector.js:1:4579)\n    at Mr (D:\\Program Files\\AnythingLLM\\resources\\backend\\collector.js:1:7620)\n    at Ci (D:\\Program Files\\AnythingLLM\\resources\\backend\\collector.js:23:3103)\n    at D:\\Program Files\\AnythingLLM\\resources\\backend\\collector.js:54:1305\n    at Layer.handle [as handle_request] (D:\\Program Files\\AnythingLLM\\resources\\backend\\node_modules\\express\\lib\\router\\layer.js:95:5)\n    at next (D:\\Program Files\\AnythingLLM\\resources\\backend\\node_modules\\express\\lib\\router\\route.js:149:13)\n    at $a (D:\\Program Files\\AnythingLLM\\resources\\backend\\collector.js:26:4416)\n    at Layer.handle [as handle_request] (D:\\Program Files\\AnythingLLM\\resources\\backend\\node_modules\\express\\lib\\router\\layer.js:95:5)\n    at next (D:\\Program Files\\AnythingLLM\\resources\\backend\\node_modules\\express\\lib\\router\\route.js:149:13)","service":"collector"}

Expected Behavior: The system should handle full-width quotes correctly without converting them to illegal half-width characters, allowing the file to be processed and moved to the permanent documents folder.

Current Workaround: Renaming the file by replacing the full-width quotation marks with other brackets (such as and ) resolves the issue and allows successful uploading.

Are there known steps to reproduce?

Environment:

  • OS: Windows 11 25H2
  • AnythingLLM Version: v1.11.2 (Desktop, using UI)

Steps to Reproduce:

  1. Create a new Workspace.
  2. Prepare a test file with some text content and a filename containing full-width quotes, e.g., ”test“.md.
  3. Upload or drag the file into the workspace.
  4. The UI shows "A processing error occurred".
Originally created by @sopreigj on GitHub (Mar 23, 2026). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/5257 Originally assigned to: @timothycarambat on GitHub. ### How are you running AnythingLLM? AnythingLLM desktop app ### What happened? On Windows 11 25H2 Desktop version, uploading files with full-width quotation marks (e.g., `“` and `”`) in the filename fails immediately. Although these are legal characters in Windows, the backend `collector` seems to incorrectly normalize or escape them into half-width quotes (`"`), which are illegal in Windows file paths, causing an `ENOENT` error in the file-writing pipeline. <img width="1600" height="852" alt="Image" src="https://github.com/user-attachments/assets/0feffc45-a235-4cf5-bac6-7047956b8a69" /> **Actual Behavior:** - The UI reports a processing error. - The file is not added to the library, but a copy remains orphaned in the local directory: `%AppData%\anythingllm-desktop\storage\hotdir`. - **Log Evidence:** The `collector.log` confirms that the system fails when attempting to write a `.json` metadata file to the following path (which contains illegal `"`): `%AppData%\anythingllm-desktop\storage\documents\custom-documents\"test".md-[UUID].json` **Full Error Log:** JSON ``` {"level":"info","message":"-- Working ”test“.md --","service":"collector"} {"level":"error","message":"Error: ENOENT: no such file or directory, open 'C:\\Users\\na\\AppData\\Roaming\\anythingllm-desktop\\storage\\documents\\custom-documents\\\"test\".md-341fbfa4-7429-44dc-bc61-fe8f0f2a040e.json'\n at Object.writeFileSync (node:fs:2367:20)\n at Rr (D:\\Program Files\\AnythingLLM\\resources\\backend\\collector.js:1:4579)\n at Mr (D:\\Program Files\\AnythingLLM\\resources\\backend\\collector.js:1:7620)\n at Ci (D:\\Program Files\\AnythingLLM\\resources\\backend\\collector.js:23:3103)\n at D:\\Program Files\\AnythingLLM\\resources\\backend\\collector.js:54:1305\n at Layer.handle [as handle_request] (D:\\Program Files\\AnythingLLM\\resources\\backend\\node_modules\\express\\lib\\router\\layer.js:95:5)\n at next (D:\\Program Files\\AnythingLLM\\resources\\backend\\node_modules\\express\\lib\\router\\route.js:149:13)\n at $a (D:\\Program Files\\AnythingLLM\\resources\\backend\\collector.js:26:4416)\n at Layer.handle [as handle_request] (D:\\Program Files\\AnythingLLM\\resources\\backend\\node_modules\\express\\lib\\router\\layer.js:95:5)\n at next (D:\\Program Files\\AnythingLLM\\resources\\backend\\node_modules\\express\\lib\\router\\route.js:149:13)","service":"collector"} ``` **Expected Behavior:** The system should handle full-width quotes correctly without converting them to illegal half-width characters, allowing the file to be processed and moved to the permanent `documents` folder. **Current Workaround:** Renaming the file by replacing the full-width quotation marks with other brackets (such as `「` and `」`) resolves the issue and allows successful uploading. ### Are there known steps to reproduce? **Environment:** - **OS:** Windows 11 25H2 - **AnythingLLM Version:** v1.11.2 (Desktop, using UI) **Steps to Reproduce:** 1. Create a new Workspace. 2. Prepare a test file with some text content and a filename containing full-width quotes, e.g., `”test“.md`. 3. Upload or drag the file into the workspace. 4. The UI shows "A processing error occurred".
yindo added the possible bug label 2026-06-05 14:51:20 -04:00
yindo closed this issue 2026-06-05 14:51:20 -04:00
Author
Owner

@sopreigj commented on GitHub (Mar 24, 2026):

Temporary Workaround: Batch script to rename files

Since the backend currently fails to process filenames with full-width quotation marks on Windows, I’ve written a simple batch script to recursively rename files in my knowledge base. It replaces and with and , which allows AnythingLLM to process them correctly.

Usage: Place this .bat file in your root directory and run it.

@echo off
setlocal enabledelayedexpansion

:: COMMENT: This is a temporary workaround for my knowledge base to resolve 
:: the file upload/processing failure caused by full-width quotation marks.

:: Set the working directory to the directory where the script is located
cd /d "%~dp0"

echo Recursively processing filenames in subfolders...

:: /r for recursion, %%i represents the full path of the file
for /r %%i in (*“* *”*) do (
    set "oldfullpath=%%i"
    set "oldname=%%~nxi"
    
    :: Initialize the new filename variable
    set "newname=!oldname!"
    :: Replace left full-width quote “ with 「
    set "newname=!newname:“=「!"
    :: Replace right full-width quote ” with 」
    set "newname=!newname:”=」!"
    
    :: Execute only if the filename has actually changed
    if not "!oldname!"=="!newname!" (
        echo Renaming in place: "!oldname!" -> "!newname!"
        
        :: Use move /y to overwrite at the original location (performing a rename)
        :: "%%~dpi" extracts the original folder path of the file
        move /y "!oldfullpath!" "%%~dpi!newname!" >nul
    )
)

echo.
echo Processing complete. All files have been renamed within their original folders.
pause
<!-- gh-comment-id:4115240967 --> @sopreigj commented on GitHub (Mar 24, 2026): **Temporary Workaround: Batch script to rename files** Since the backend currently fails to process filenames with full-width quotation marks on Windows, I’ve written a simple batch script to recursively rename files in my knowledge base. It replaces `“` and `”` with `「` and `」`, which allows AnythingLLM to process them correctly. **Usage:** Place this `.bat` file in your root directory and run it. ```bat @echo off setlocal enabledelayedexpansion :: COMMENT: This is a temporary workaround for my knowledge base to resolve :: the file upload/processing failure caused by full-width quotation marks. :: Set the working directory to the directory where the script is located cd /d "%~dp0" echo Recursively processing filenames in subfolders... :: /r for recursion, %%i represents the full path of the file for /r %%i in (*“* *”*) do ( set "oldfullpath=%%i" set "oldname=%%~nxi" :: Initialize the new filename variable set "newname=!oldname!" :: Replace left full-width quote “ with 「 set "newname=!newname:“=「!" :: Replace right full-width quote ” with 」 set "newname=!newname:”=」!" :: Execute only if the filename has actually changed if not "!oldname!"=="!newname!" ( echo Renaming in place: "!oldname!" -> "!newname!" :: Use move /y to overwrite at the original location (performing a rename) :: "%%~dpi" extracts the original folder path of the file move /y "!oldfullpath!" "%%~dpi!newname!" >nul ) ) echo. echo Processing complete. All files have been renamed within their original folders. pause ```
Author
Owner

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

Interesting, does not happen on Mac, but encodes the chars instead - will see if we can fix on both just so they are normalized.

<!-- gh-comment-id:4115269700 --> @timothycarambat commented on GitHub (Mar 24, 2026): Interesting, does not happen on Mac, but encodes the chars instead - will see if we can fix on both just so they are normalized.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#4989