[GH-ISSUE #1634] [BUG]: Unable to upload documents when $STORAGE_DIR is not default #1068

Closed
opened 2026-02-22 18:22:58 -05:00 by yindo · 1 comment
Owner

Originally created by @neight-allen on GitHub (Jun 7, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1634

How are you running AnythingLLM?

Docker (remote machine)

What happened?

I'm pretty sure I know what's wrong, and I think I can fix it, but this is my first modification to the codebase and wanted 👀 on it before I open a PR.

When researching the error, I came across this:
https://github.com/Mintplex-Labs/anything-llm/blob/1b8386b079cdb2524212ce6ff99dc1e3ea092c1d/server/utils/files/multer.js#L10-L12

I think the collector folder should not be relative to storage. I expect the path should be resolved as it is on L11 regardless of environment.

Are there known steps to reproduce?

  • Set $STORAGE_DIR env var to /home/app/sever/storage/
  • Run docker container
  • Go through onboarding (create password, workspace, LLM settings, etc)
  • Try to upload a document in the new workspace

Fails with error:

Invalid file upload. ENOENT: no such file or directory, open '/home/app/collector/hotdir/filename.pdf'"

I did this in Azure App Service as a custom container deployment. In order to persist storage across restarts, it needs to be in the /home directory.

Originally created by @neight-allen on GitHub (Jun 7, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1634 ### How are you running AnythingLLM? Docker (remote machine) ### What happened? I'm pretty sure I know what's wrong, and I think I can fix it, but this is my first modification to the codebase and wanted 👀 on it before I open a PR. When researching the error, I came across this: https://github.com/Mintplex-Labs/anything-llm/blob/1b8386b079cdb2524212ce6ff99dc1e3ea092c1d/server/utils/files/multer.js#L10-L12 I think the `collector` folder should not be relative to storage. I expect the path should be resolved as it is on L11 regardless of environment. ### Are there known steps to reproduce? - Set `$STORAGE_DIR` env var to `/home/app/sever/storage/` - Run docker container - Go through onboarding (create password, workspace, LLM settings, etc) - Try to upload a document in the new workspace Fails with error: ``` Invalid file upload. ENOENT: no such file or directory, open '/home/app/collector/hotdir/filename.pdf'" ``` I did this in Azure App Service as a custom container deployment. In order to persist storage across restarts, it needs to be in the `/home` directory.
yindo added the possible bug label 2026-02-22 18:22:58 -05:00
yindo closed this issue 2026-02-22 18:22:58 -05:00
Author
Owner

@timothycarambat commented on GitHub (Jun 7, 2024):

The reason it is like this is that it works without us having to maintain a branch for hosting, docker, and desktop. But the downside is that it requires these options when booting in docker:

...
-v ${STORAGE_LOCATION}:/app/server/storage \
-v ${STORAGE_LOCATION}/.env:/app/server/.env \
-e STORAGE_DIR="/app/server/storage" \
...

Ref: https://github.com/Mintplex-Labs/anything-llm/blob/master/docker/HOW_TO_USE_DOCKER.md

If you change that the amount of headaches that will result will be innumerable 😓

@timothycarambat commented on GitHub (Jun 7, 2024): The reason it is like this is that it works without us having to maintain a branch for hosting, docker, and desktop. But the downside is that it requires these options when booting in docker: ``` ... -v ${STORAGE_LOCATION}:/app/server/storage \ -v ${STORAGE_LOCATION}/.env:/app/server/.env \ -e STORAGE_DIR="/app/server/storage" \ ... ``` Ref: https://github.com/Mintplex-Labs/anything-llm/blob/master/docker/HOW_TO_USE_DOCKER.md If you change that the amount of headaches that will result will be innumerable 😓
yindo changed title from [BUG]: Unable to upload documents when $STORAGE_DIR is not default to [GH-ISSUE #1634] [BUG]: Unable to upload documents when $STORAGE_DIR is not default 2026-06-05 14:38:47 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#1068