# Upload file error: FileNotFound:

**URL:** <https://forums.rocket.chat/t/upload-file-error-filenotfound/5107>\
**Category:** Community Support\
**Created:** [November 19, 2019, 9:50am UTC](https://forums.rocket.chat/t/upload-file-error-filenotfound/5107 "2019-11-19T09:50:26Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![dikey422](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@dikey422](https://forums.rocket.chat/u/dikey422)\
**Post date:** [November 19, 2019, 9:50am UTC](https://forums.rocket.chat/t/upload-file-error-filenotfound/5107/1 "2019-11-19T09:50:26Z")

</div>

My system:  
CentOS Linux release 7.7.1908  
Rocket.Chat Version: 2.2.0  
NodeJS Version: 8.16.2 - x64  
MongoDB Version: 4.0.13  
MongoDB Engine: mmapv1  
Platform: linux  
Process Port: 3000  
Site URL: [https://localhost](https://localhost)

File upload, file system constant error progress 0% FridFS similar problem

Error: FileNotFound: no file with id CtrsAyXbSLTrgFu6z found  
at /opt/Rocket.Chat/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb/lib/gridfs-stream/index.js:188:25  
at result (/opt/Rocket.Chat/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb/lib/utils.js:414:17)  
at session.endSession (/opt/Rocket.Chat/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb/lib/utils.js:401:11)  
at ClientSession.endSession (/opt/Rocket.Chat/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb-core/lib/sessions.js:129:41)  
at executeCallback (/opt/Rocket.Chat/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb/lib/utils.js:397:17)  
at deleteCallback (/opt/Rocket.Chat/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb/lib/operations/collection\_ops.js:349:17)  
at removeDocuments (/opt/Rocket.Chat/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb/lib/operations/collection\_ops.js:364:54)  
at handleCallback (/opt/Rocket.Chat/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb/lib/utils.js:128:55)  
at coll.s.topology.remove (/opt/Rocket.Chat/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb/lib/operations/collection\_ops.js:1208:5)  
at handler (/opt/Rocket.Chat/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb-core/lib/topologies/replset.js:1197:22)  
at /opt/Rocket.Chat/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb-core/lib/connection/pool.js:532:18  
at \_combinedTickCallback (internal/process/next\_tick.js:132:7)  
at process.\_tickDomainCallback (internal/process/next\_tick.js:219:9)

---

<div class="post-metadata">

**Author:** ![mcpcyber](https://avatars.discourse-cdn.com/v4/letter/m/c77e96/32.png) [@mcpcyber](https://forums.rocket.chat/u/mcpcyber)\
**Post date:** [December 17, 2019, 10:41am UTC](https://forums.rocket.chat/t/upload-file-error-filenotfound/5107/2 "2019-12-17T10:41:49Z")

</div>

i have the same problem

Error: FileNotFound: no file with id 2KAYQa2DwEhtkCqyC found  
Dec 17 14:09:55 sv252003001 RocketChat[5312]: at /opt/Rocket.Chat/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb/lib/gridfs-stream/index.js:188:25  
Dec 17 14:09:55 sv252003001 RocketChat[5312]: at result (/opt/Rocket.Chat/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb/lib/utils.js:414:17)  
Dec 17 14:09:55 sv252003001 RocketChat[5312]: at session.endSession (/opt/Rocket.Chat/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb/lib/utils.js:401:11)  
Dec 17 14:09:55 sv252003001 RocketChat[5312]: at ClientSession.endSession (/opt/Rocket.Chat/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb-core/lib/sessions.js:129:41)  
Dec 17 14:09:55 sv252003001 RocketChat[5312]: at executeCallback (/opt/Rocket.Chat/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb/lib/utils.js:397:17)  
Dec 17 14:09:55 sv252003001 RocketChat[5312]: at deleteCallback (/opt/Rocket.Chat/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb/lib/operations/collection\_ops.js:349:17)  
Dec 17 14:09:55 sv252003001 RocketChat[5312]: at removeDocuments (/opt/Rocket.Chat/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb/lib/operations/collection\_ops.js:364:54)  
Dec 17 14:09:55 sv252003001 RocketChat[5312]: at handleCallback (/opt/Rocket.Chat/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb/lib/utils.js:128:55)  
Dec 17 14:09:55 sv252003001 RocketChat[5312]: at coll.s.topology.remove (/opt/Rocket.Chat/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb/lib/operations/collection\_ops.js:1208:5)  
Dec 17 14:09:55 sv252003001 RocketChat[5312]: at handler (/opt/Rocket.Chat/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb-core/lib/topologies/replset.js:1197:22)  
Dec 17 14:09:55 sv252003001 RocketChat[5312]: at /opt/Rocket.Chat/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb-core/lib/connection/pool.js:532:18  
Dec 17 14:09:55 sv252003001 RocketChat[5312]: at \_combinedTickCallback (internal/process/next\_tick.js:131:7)  
Dec 17 14:09:55 sv252003001 RocketChat[5312]: at process.\_tickDomainCallback (internal/process/next\_tick.js:218:9)

---

<div class="post-metadata">

**Author:** ![arin](https://avatars.discourse-cdn.com/v4/letter/a/3e96dc/32.png) [@arin](https://forums.rocket.chat/u/arin)\
**Post date:** [January 31, 2020, 2:51am UTC](https://forums.rocket.chat/t/upload-file-error-filenotfound/5107/3 "2020-01-31T02:51:10Z")

</div>

I also have the exact same issue when trying Local file storage rather than GridFS. Same errors as well.

Can any devs look into this? It’s affecting multiple users.  
I’m running Rocket Chat on Ubuntu in Snaps.

---

<div class="post-metadata">

**Author:** ![big.test](https://avatars.discourse-cdn.com/v4/letter/b/6bbea6/32.png) [@big.test](https://forums.rocket.chat/u/big.test)\
**Post date:** [February 8, 2020, 6:24am UTC](https://forums.rocket.chat/t/upload-file-error-filenotfound/5107/4 "2020-02-08T06:24:33Z")

</div>

Same issue here, but happens with GridFS or Local file storage. Strangely though, I’m able to upload files on mobile, so it seems like a client issue. Any ideas?

---

<div class="post-metadata">

**Author:** ![Linusshen](https://avatars.discourse-cdn.com/v4/letter/l/a8b319/32.png) [@Linusshen](https://forums.rocket.chat/u/Linusshen)\
**Post date:** [February 11, 2020, 8:55am UTC](https://forums.rocket.chat/t/upload-file-error-filenotfound/5107/5 "2020-02-11T08:55:19Z")

</div>

docker version 18.09.9  
docker-compose 1.25.3  
centos 7.6  
rocket.chat 2.4.9  
upload files only mobile(ios / Android ) and desktop upload file ，log will show Upload file error

---

<div class="post-metadata">

**Author:** ![aaron.ogle](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/aaron.ogle/32/15_2.png) [@aaron.ogle](https://forums.rocket.chat/u/aaron.ogle)\
**Post date:** [February 12, 2020, 12:09am UTC](https://forums.rocket.chat/t/upload-file-error-filenotfound/5107/6 "2020-02-12T00:09:14Z")

</div>

If you have multiple instances of Rocket.Chat running. Make sure you have sticky sessions configured in your load balancer.

What can happen here is when uploading… When it starts and starts uploading chunks of the files… If they end up on different instances of Rocket.Chat running… it can’t piece the file back together.

So setting sticky sessions bypasses this.

---

<div class="post-metadata">

**Author:** ![keobr](https://avatars.discourse-cdn.com/v4/letter/k/9dc877/32.png) [@keobr](https://forums.rocket.chat/u/keobr)\
**Post date:** [April 4, 2020, 6:15pm UTC](https://forums.rocket.chat/t/upload-file-error-filenotfound/5107/7 "2020-04-04T18:15:11Z")

</div>

I also have the exact same issue when trying Local file storage rather than GridFS  
My system:  
CentOS Linux release 8.1.1911 (Core)  
Docker version 19.03.6, build 369ce74a3c  
SyncedCron ➔ info Starting “Generate download files for user data”.  
SyncedCron ➔ info Finished “Generate download files for user data”.  
Error: FileNotFound: no file with id njd4heZoXp6iGWzSH found  
at /app/bundle/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb/lib/gridfs-stream/index.js:188:25  
at result (/app/bundle/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb/lib/utils.js:410:17)  
at session.endSession (/app/bundle/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb/lib/utils.js:398:11)  
at ClientSession.endSession (/app/bundle/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb-core/lib/sessions.js:134:41)  
at executeCallback (/app/bundle/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb/lib/utils.js:395:17)  
at deleteCallback (/app/bundle/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb/lib/operations/collection\_ops.js:349:17)  
at removeDocuments (/app/bundle/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb/lib/operations/collection\_ops.js:364:54)  
at handleCallback (/app/bundle/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb/lib/utils.js:128:55)  
at coll.s.topology.remove (/app/bundle/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb/lib/operations/collection\_ops.js:1259:5)  
at /app/bundle/programs/server/npm/node\_modules/meteor/npm-mongo/node\_modules/mongodb-core/lib/connection/pool.js:397:18  
at \_combinedTickCallback (internal/process/next\_tick.js:132:7)  
at process.\_tickDomainCallback (internal/process/next\_tick.js:219:9)  
SyncedCron ➔ info Starting “Generate download files for user data”.  
SyncedCron ➔ info Finished “Generate download files for user data”.  
SyncedCron ➔ info Starting “Generate download files for user data”.  
SyncedCron ➔ info Finished “Generate download files for user data”.

---

<div class="post-metadata">

**Author:** ![keobr](https://avatars.discourse-cdn.com/v4/letter/k/9dc877/32.png) [@keobr](https://forums.rocket.chat/u/keobr)\
**Post date:** [April 4, 2020, 6:43pm UTC](https://forums.rocket.chat/t/upload-file-error-filenotfound/5107/8 "2020-04-04T18:43:36Z")

</div>

In my case I could use rocket-chat messages despite the “site url” was set as

[http://example.com/](http://example.com/)

but I have had to change it to

[https://example.com/](https://example.com/)

for file-upload to start working.

The setting is under

Administration/Settings/General/“Site URL”
