We are on latest snap package and 🚀 chat is at Version: 0.40.1
Here's the background:
It was working previously in 0.38 version. It stopped working after the upgrade of a snap package. Actually, I was fiddling with settings on AVATAR upload path and I remember setting to FILESYSTEM with /opt/avatar and I broke it. Since server itself was not starting up, I had to change things from backend through MongoDB console in rocketchat.settings collection ( reverted to GridFS).
We started experiencing this as well. Symptoms are almost the same but the scenarios are different.
When "upload" settings are tied to "Filesystem", the progress bar would freeze at 100% and nothing happens at all no matter the time. We get following in the log
ufs: cannot write file "zkb9tX9CKP8zLkX2W" (EROFS: read-only file system, open '/zkb9tX9CKP8zLkX2W.gif') { [Error: EROFS: read-only file system, open '/zkb9tX9CKP8zLkX2W.gif']
errno: -30,
code: 'EROFS',
syscall: 'open',
path: '/zkb9tX9CKP8zLkX2W.gif' }
Exception while invoking method 'ufsComplete' Error: EROFS: read-only file system, open '/zkb9tX9CKP8zLkX2W.gif'
at Object.Future.wait (/snap/rocketchat-server/45/node_modules/fibers/future.js:449:15)
at [object Object].ufsComplete (meteor://💻app/packages/jalik:ufs/ufs-methods.js:62:20)
at [object Object].methodsMap.(anonymous function) (meteor://💻app/packages/rocketchat:lib/server/lib/debug.js:17:26)
at maybeAuditArgumentChecks (meteor://💻app/packages/ddp-server/livedata_server.js:1711:12)
at meteor://💻app/packages/ddp-server/livedata_server.js:711:19
at [object Object]._.extend.withValue (meteor://💻app/packages/meteor/dynamics_nodejs.js:56:1)
at meteor://💻app/packages/ddp-server/livedata_server.js:709:40
at [object Object]._.extend.withValue (meteor://💻app/packages/meteor/dynamics_nodejs.js:56:1)
at meteor://💻app/packages/ddp-server/livedata_server.js:707:46
at Session.method (meteor://💻app/packages/ddp-server/livedata_server.js:681:23)
at meteor://💻app/packages/ddp-server/livedata_server.js:551:43
- - - - -
at Error (native)
ufs: cannot delete temp file "/tmp/ufs/zkb9tX9CKP8zLkX2W" (ENOENT: no such file or directory, unlink '/tmp/ufs/zkb9tX9CKP8zLkX2W')
As for GridFS case, upload shows it worked fine but we get the blank placeholder of zero-byte / an empty file. However, nothing gets vomited in logs in this case.
@geekgonecrazy Was this resolved in the #ubuntu-snap channel or is this still ongoing?
Ongoing. Couple other reports in non snap installs. Trying to get to the bottom of it still
I am experimenting the same problem using the latest #ubuntu-snap
@rodripf experimenting or experiencing ? For former, thank you :) and for the latter, kudos for validating my case 👍
I am on snap 0.41 and I am experiencing this too.
I’m experiencing this issue too. Here are some details about the behaviour on my side:
I’m also running the latest snap. Avatar images and file uploads are both set to GridFS. In both cases, I get an empty file after upload (just like OP) and no warning or error message.
However, both file upload and avatar images work if I start the server directly in Node JS (without running it through Snap), e.g. like this:
cd /snap/rocketchat-server/current/
export ROOT_URL=http://localhost PORT=3000 MONGO_URL=mongodb://localhost:27017/parties
./bin/node main.js
So the issue seems very snap specific.
I noted that for me, uploading files only doesn’t work for _image files_ (e.g. pdf is okay). Furthermore, Avatar images work if I disable resizing them.
Does Rocket.Chat try to resize uploaded images? (Or run them through graphicsmagick
for any other reason?) If yes, can this be disabled? Because that could be a workaround.
If the issue is really because of graphicsmagick
, my wild guess would be that Rocket.Chat cannot find the gm
executable in its Snap container.
To summarize, the situation on my server is like this:
| | Running through snap | Running directly through Node JS |
| --- | --- | --- |
| Avatar upload with resizing | No | Yes |
| Avatar upload without resizing | Yes | Yes |
| Image upload | No | Yes |
| Other File upload | Yes | Yes |
@jGleitz It looks like it uses $SNAP/usr/bin/convert.
vim stable/snapcraft.yaml
stage-packages:
- imagemagick
organize:
usr/bin/convert-im6: usr/bin/convert
It looks like it uses $SNAP/usr/bin/convert.
Good hint. But if it’s using its own binary, then why is there a difference between running inside the snap and “outside”?
I thought Rocket.Chat would use gm because that’s mentioned in this bug:
Rocket.Chat uses GraphicsMagick for resizing, so you'd have to have that installed on your box.
Is that outdated info?
Both imagemagick and graphicsmagick provide the convert command. Rocket.Chat works with either one of them. We install imagemagick and include it in the snap.
Snaps are a isolated environment. Its packaged up with all of its dependencies. Also its restricted on which files and folders it can access. It can just access any file or folder it wishes. They are tightly controlled by the snap platform. This is one of the big benefits to using snaps.
So it appears for some reason its trying to use a file or folder it doesn't have access to on file upload.
I can confirm @jGleitz's findings. Exact same symptoms for me.
In the latest snap it should be fixed.
We used to work with imagemagick or graphicsmagick. Something changed and if using imagemagick it seems to screw things up. So Graphicsmagick is required.
And so it is. Thanks for your efforts.
I encountered that exact same issue.
Rocket.Chat Version: 0.54.2
Ubuntu 16.04 / snap install
Can't it be due to file system access restriction inherent to snaps?
@maxlath if you have it setup to point to a filesystem path. Then yes absolutely. What path do you have specified?
@geekgonecrazy I let the path field unaltered
@maxlath could you grab the value and paste it here? Its possible this value got messed up and maybe something we need to address.
Step to reproduce:
File Upload
> Storage Type
to FileSystem
, without change anything else.Upload File?
modal correctly but once hitting Send
, a message notify you of an internal server error
:ufs: cannot delete temp file "/tmp/ufs/7ZfNqsQsGomDeELRP" (ENOENT: no such file or directory, unlink '/tmp/ufs/7ZfNqsQsGomDeELRP')
ufs: cannot delete temp file at /tmp/ufs/WmDJcA9nSB24rn697 (ENOENT: no such file or directory, unlink '/tmp/ufs/WmDJcA9nSB24rn697')
ufs: cannot write file "WmDJcA9nSB24rn697" (EROFS: read-only file system, open '/WmDJcA9nSB24rn697.jpg') { [Error: EROFS: read-only file system, open '/WmDJcA9nSB24rn697.jpg']
errno: -30,
code: 'EROFS',
syscall: 'open',
path: '/WmDJcA9nSB24rn697.jpg' }
Exception while invoking method 'ufsComplete' Error: EROFS: read-only file system, open '/WmDJcA9nSB24rn697.jpg'
at Object.Future.wait (/snap/rocketchat-server/580/node_modules/fibers/future.js:449:15)
at [object Object].Meteor.methods.ufsComplete (/snap/rocketchat-server/580/programs/server/packages/jalik_ufs.js:824:24)
at [object Object].methodsMap.(anonymous function) (/snap/rocketchat-server/580/programs/server/packages/rocketchat_lib.js:1095:26)
at maybeAuditArgumentChecks (/snap/rocketchat-server/580/programs/server/packages/ddp-server.js:1817:12)
at /snap/rocketchat-server/580/programs/server/packages/ddp-server.js:905:20
at [object Object]._.extend.withValue (packages/meteor.js:1122:17)
at /snap/rocketchat-server/580/programs/server/packages/ddp-server.js:904:41
at [object Object]._.extend.withValue (packages/meteor.js:1122:17)
at /snap/rocketchat-server/580/programs/server/packages/ddp-server.js:903:46
at [object Object]._.extend.protocol_handlers.method (/snap/rocketchat-server/580/programs/server/packages/ddp-server.js:876:21)
at /snap/rocketchat-server/580/programs/server/packages/ddp-server.js:755:85
- - - - -
at Error (native)
ufs: cannot delete temp file "/tmp/ufs/WmDJcA9nSB24rn697" (ENOENT: no such file or directory, unlink '/tmp/ufs/WmDJcA9nSB24rn697')
@maxlath what is the value of the filesystem path? Snaps are only allowed to write to certain places. So this is an important piece to verify
@geekgonecrazy the input[name='FileUpload_FileSystemPath']
value is empty, is there another place I should check or is that the value you are looking for?
That's the value. It should be something like: /var/snap/rocketchat-server/common/uploads
yep, it works when setting the path to /var/snap/rocketchat-server/common/uploads
, you just need to mkdir /var/snap/rocketchat-server/common/uploads
first
@maxlath I'll take a look at prepopulating the setting 👍
I have the same issue :(
using the latest ubuntu lts, rocketchat version and snap version
```Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-72-generic x86_64)
Rocket.Chat version 0.55.0
snap-confine/xenial-updates,now 2.22.6 amd64 [installed,automatic]
snapd/xenial-updates,now 2.22.6 amd64 [installed]``
still i got the same error
Apr 19 13:54:04 server-1011871-1 snap[3218]: Exception in callback of async function: Error: EROFS: read-only file system, mkdir '/var/rocketchat'
/var/rocketchat is existing, and already make it chmod 777 just to test, since the error is read-only file system. /var/rocketchat is where our emoji is located
is there any updates for this error?
@rrepolona it looks like from that you are trying to set the path to /var/rocketchat. Snaps are isolated environments with restricted access to the filesystem for security. That folder is not accessible by the snap
@geekgonecrazy
i see, actually had the transition from the manual installation to snap (by restoring mongo db to parties)
rocket.chat system went well for the whole week having this configuration '/var/rocketchat' it only acts i believe when our team made some update to integration. (but not sure if this is related)
currently running it like this (as mention by @jGleitz )
cd /snap/rocketchat-server/current/
export ROOT_URL=http://localhost PORT=3000 MONGO_URL=mongodb://localhost:27017/parties
./bin/node main.js
but i will check this, and remove the setting. ill give you feedback. thanks
I am still getting this error, with the latest build of RocketChat, this isnt a snap but a manual install. Any help?
```{ [Error: ENOENT: no such file or directory, open '/tmp/ufs/BsBPqk4hDPjHDEDbp']
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/tmp/ufs/BsBPqk4hDPjHDEDbp' }
[Error: FileNotFound: no file with id BsBPqk4hDPjHDEDbp found]
Exception while invoking method 'ufsComplete' Error: ENOENT: no such file or directory, open '/tmp/ufs/BsBPqk4hDPjHDEDbp'
at Object.Future.wait (/srv/rocketchat-builds/rc-0.55.1/programs/server/node_modules/fibers/future.js:449:15)
at [object Object].Meteor.methods.ufsComplete (/srv/rocketchat-builds/rc-0.55.1/programs/server/packages/jalik_ufs.js:818:24)
at [object Object].methodsMap.(anonymous function) (/srv/rocketchat-builds/rc-0.55.1/programs/server/packages/rocketchat_lib.js:1069:26)
at [object Object].methodMap.(anonymous function) (packages/rocketchat_monitoring.js:2731:30)
at maybeAuditArgumentChecks (/srv/rocketchat-builds/rc-0.55.1/programs/server/packages/ddp-server.js:1823:12)
at /srv/rocketchat-builds/rc-0.55.1/programs/server/packages/ddp-server.js:905:20
at [object Object]._.extend.withValue (packages/meteor.js:1122:17)
at /srv/rocketchat-builds/rc-0.55.1/programs/server/packages/ddp-server.js:904:41
at [object Object]._.extend.withValue (packages/meteor.js:1122:17)
at /srv/rocketchat-builds/rc-0.55.1/programs/server/packages/ddp-server.js:903:46
at [object Object]._.extend.protocol_handlers.method (/srv/rocketchat-builds/rc-0.55.1/programs/server/packages/ddp-server.js:876:21)
at /srv/rocketchat-builds/rc-0.55.1/programs/server/packages/ddp-server.js:755:85
- - - - -
at Error (native)
```
@oliver-bowman you are using multiple instances right? If so please follow #6926
@maxlath Perfect!!!!!!!
Hi Guys, I
am also facing the same issue with the latest snap, with connecting it through Google cloud storage, it says "Internal server error 500"
-- Logs begin at Mon 2019-04-01 21:08:19 UTC. --
Apr 02 12:22:29 rocket-chat rocketchat-server.rocketchat-server[27507]: at Generator.next (
Apr 02 12:22:29 rocket-chat rocketchat-server.rocketchat-server[27507]: at /snap/rocketchat-server/1367/programs/server/npm/node_modules/google-auth-library/build/src/auth
/oauth2client.js:22:71
Apr 02 12:22:29 rocket-chat rocketchat-server.rocketchat-server[27507]: at new Promise (
Apr 02 12:22:29 rocket-chat rocketchat-server.rocketchat-server[27507]: at __awaiter (/snap/rocketchat-server/1367/programs/server/npm/node_modules/google-auth-library/bui
ld/src/auth/oauth2client.js:18:12)
Apr 02 12:22:29 rocket-chat rocketchat-server.rocketchat-server[27507]: at JWT.getRequestHeaders (/snap/rocketchat-server/1367/programs/server/npm/node_modules/google-auth
-library/build/src/auth/oauth2client.js:250:16)
Apr 02 12:22:29 rocket-chat rocketchat-server.rocketchat-server[27507]: at GoogleAuth.
h-library/build/src/auth/googleauth.js:582:42)
Apr 02 12:22:29 rocket-chat rocketchat-server.rocketchat-server[27507]: at Generator.next (
Apr 02 12:22:29 rocket-chat rocketchat-server.rocketchat-server[27507]: at fulfilled (/snap/rocketchat-server/1367/programs/server/npm/node_modules/google-auth-library/bui
ld/src/auth/googleauth.js:19:58)
Apr 02 12:22:29 rocket-chat rocketchat-server.rocketchat-server[27507]: at /snap/rocketchat-server/1367/programs/server/npm/node_modules/meteor/promise/node_modules/meteor
-promise/fiber_pool.js:43:40
Apr 02 12:22:29 rocket-chat rocketchat-server.rocketchat-server[27507]: ufs: cannot delete temp file "/tmp/ufs/gWCxrJv7xH3ErNA7p" (ENOENT: no such file or directory, unlink '/
tmp/ufs/gWCxrJv7xH3ErNA7p')
yep, it works when setting the path to
/var/snap/rocketchat-server/common/uploads
, you just need tomkdir /var/snap/rocketchat-server/common/uploads
first
worked for me with "FileSystem" storage type in admin interface.
(Ubuntu 18.04, Snap latest version)
Hey @Meloman-zz, thanks for the help but I am using rocket chat with docker now. Could you please help me with the same in docker? as my primary disk is full & I am adding a new one for media storage.
Most helpful comment
yep, it works when setting the path to
/var/snap/rocketchat-server/common/uploads
, you just need tomkdir /var/snap/rocketchat-server/common/uploads
first