[GH-ISSUE #1729] Invalid file upload. ENOENT: no such file or directory #1130

Closed
opened 2026-02-22 18:23:16 -05:00 by yindo · 4 comments
Owner

Originally created by @yongshengma on GitHub (Jun 20, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1729

This is the continue on issue https://github.com/Mintplex-Labs/anything-llm/issues/1652

Following the suggestion to start collector for production, I can click the big upload button and open a windows to select files to upload. However after the selected files confirmed, an error in red shows up in the area of big upload button :

Invalid file upload. NOENT: no such file or directory, open '/home/collector/hotdir/mydocument.pdf'

I doubt it is caused by '/home' as the path to collector.

Is there anything lost in the scripts? Please let me paste them again.

echo "Killing node processes"
pkill node

echo "Installing collector dependencies"
cd /home/ubuntu/anything-llm/collector && yarn

echo "Installing server dependencies & running migrations"
cd /home/ubuntu/anything-llm/server && yarn
cd /home/ubuntu/anything-llm/server && npx prisma migrate deploy --schema=./prisma/schema.prisma
cd /home/ubuntu/anything-llm/server && npx prisma generate

echo "Booting up services."
truncate -s 0 /logs/server.log
truncate -s 0 /logs/collector.log

cd /home/ubuntu/anything-llm/server
(NODE_ENV=production node index.js) &> /logs/server.log &

cd /home/ubuntu/anything-llm/collector
(NODE_ENV=production node index.js) &> /logs/collector.log &

BTW everything works fine in development.

Originally created by @yongshengma on GitHub (Jun 20, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1729 This is the continue on issue https://github.com/Mintplex-Labs/anything-llm/issues/1652 Following the suggestion to start collector for production, I can click the big upload button and open a windows to select files to upload. However after the selected files confirmed, an error in red shows up in the area of big upload button : `Invalid file upload. NOENT: no such file or directory, open '/home/collector/hotdir/mydocument.pdf'` I doubt it is caused by `'/home'` as the path to collector. Is there anything lost in the scripts? Please let me paste them again. ``` echo "Killing node processes" pkill node echo "Installing collector dependencies" cd /home/ubuntu/anything-llm/collector && yarn echo "Installing server dependencies & running migrations" cd /home/ubuntu/anything-llm/server && yarn cd /home/ubuntu/anything-llm/server && npx prisma migrate deploy --schema=./prisma/schema.prisma cd /home/ubuntu/anything-llm/server && npx prisma generate echo "Booting up services." truncate -s 0 /logs/server.log truncate -s 0 /logs/collector.log cd /home/ubuntu/anything-llm/server (NODE_ENV=production node index.js) &> /logs/server.log & cd /home/ubuntu/anything-llm/collector (NODE_ENV=production node index.js) &> /logs/collector.log & ``` BTW everything works fine in development.
yindo closed this issue 2026-02-22 18:23:16 -05:00
Author
Owner

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

I doubt it is caused by '/home' as the path to collector.

Are you sure that is the case? I think writing to that folder is causing the issue. The root /home in Ubuntu is usually write-protected by default and only the user home directory is freely writable /home/<user>

@timothycarambat commented on GitHub (Jun 20, 2024): > I doubt it is caused by '/home' as the path to collector. Are you sure that is the case? I think writing to that folder is causing the issue. The root `/home` in Ubuntu is usually write-protected by default and only the _user_ home directory is freely writable `/home/<user>`
Author
Owner

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

Closing this as its not a bug but it is a setup issue, but changing into discussion

@timothycarambat commented on GitHub (Jun 20, 2024): Closing this as its not a bug but it is a setup issue, but changing into discussion
Author
Owner

@kelvinq commented on GitHub (Jun 20, 2024):

@yongshengma I had the same issue and resolved it by ensuring that the "STORAGE_DIR" parameter in .env file in ./server matches the path whereby the Collector server is actually launched from.

This is necessary as, currently, the Collector defines the document cache "hotdir" to be a relative path (../../collector/hotdir) from where "STORAGE_DIR" is.

In other words, if you have kept the original structure intact, and do not mind the storage to be where the code is, this will work:

  • Frontend server launched from ./anything-llm/server
  • Collector server launched from ./anything-llm/collector
  • STORAGE_DIR in ./server.env defined as 'FULL_PATH/anything-llm/server/storage'

Hope this helps!

@kelvinq commented on GitHub (Jun 20, 2024): @yongshengma I had the same issue and resolved it by ensuring that the "STORAGE_DIR" parameter in .env file in ./server matches the path whereby the Collector server is actually launched from. This is necessary as, currently, the Collector defines the document cache "hotdir" to be a relative path (../../collector/hotdir) from where "STORAGE_DIR" is. In other words, if you have kept the original structure intact, and do not mind the storage to be where the code is, this will work: - Frontend server launched from ./anything-llm/server - Collector server launched from ./anything-llm/collector - STORAGE_DIR in ./server.env defined as 'FULL_PATH/anything-llm/server/storage' Hope this helps!
Author
Owner

@yongshengma commented on GitHub (Jun 21, 2024):

@yongshengma I had the same issue and resolved it by ensuring that the "STORAGE_DIR" parameter in .env file in ./server matches the path whereby the Collector server is actually launched from.

This is necessary as, currently, the Collector defines the document cache "hotdir" to be a relative path (../../collector/hotdir) from where "STORAGE_DIR" is.

In other words, if you have kept the original structure intact, and do not mind the storage to be where the code is, this will work:

  • Frontend server launched from ./anything-llm/server
  • Collector server launched from ./anything-llm/collector
  • STORAGE_DIR in ./server.env defined as 'FULL_PATH/anything-llm/server/storage'

Hope this helps!

Exactly like what you said. I changed STORAGE_DIR and the uploading works now. Really helps a lot. Thanks!

@yongshengma commented on GitHub (Jun 21, 2024): > @yongshengma I had the same issue and resolved it by ensuring that the "STORAGE_DIR" parameter in .env file in ./server matches the path whereby the Collector server is actually launched from. > > This is necessary as, currently, the Collector defines the document cache "hotdir" to be a relative path (../../collector/hotdir) from where "STORAGE_DIR" is. > > In other words, if you have kept the original structure intact, and do not mind the storage to be where the code is, this will work: > > * Frontend server launched from ./anything-llm/server > * Collector server launched from ./anything-llm/collector > * STORAGE_DIR in ./server.env defined as 'FULL_PATH/anything-llm/server/storage' > > Hope this helps! Exactly like what you said. I changed STORAGE_DIR and the uploading works now. Really helps a lot. Thanks!
yindo changed title from Invalid file upload. ENOENT: no such file or directory to [GH-ISSUE #1729] Invalid file upload. ENOENT: no such file or directory 2026-06-05 14:39:06 -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#1130