Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Users no longer able to upload files

Open drickerusa opened this issue 9 years ago • 12 comments

Rocket.Chat Version: 0.49.3 Running Instances: 7 DB Replicaset OpLog: yes

This seems to be a recent issue. Users are reporting that uploads are no longer working. If I look at the my exception logs I see the following: image

These errors happen when the user is uploading a file. I also see if when trying to delete a file that I attempted to upload. image

In my two servers both of the /tmp/ufs directories look like this.

image

drickerusa avatar Feb 07 '17 16:02 drickerusa

@drickerusa Thanks for reporting this issue. We value your time in helping us to make Rocket.Chat great. We always try to fix confirmed problems as quickly as we can, and it appears that the issue you reported might already be fixed in the latest release. Can you please help us test it against current latest release? Much appreciated. And please remember to backup your data before upgrading, just to be safe. Cheers!

MartinSchoeler avatar Feb 07 '17 17:02 MartinSchoeler

@MartinSchoeler I'll take an emergency change tonight in order to upgrade to 0.51.0, I'll report back after I've done so.

drickerusa avatar Feb 07 '17 17:02 drickerusa

@drickerusa We just upgraded to 0.51.0 and I can confirm it's still broken... I recall from a previous issue that we are running a similar setup.

I think I may have found something, as when I looked at the rocketchat_uploads collection I noticed a new field: path which has the same value as the url field minus a / like so:

{ "_id" : "XN4Bdn3z3Yw28dcai", "path" : "ufs/rocketchat_uploads/XN4Bdn3z3Yw28dcai/IMG.PNG", "url" : "/ufs/rocketchat_uploads/XN4Bdn3z3Yw28dcai/IMG.PNG" }

I am able to download the file if I go to this url in the browser, so the upload was in fact successful but it's almost as if the rendering of the upload in the channel is looking for something on the filesystem where it previously used to retrieve it from a fully qualified URL instead.

It's late here, but I'll get around to some more digging tomorrow 👍

jamie-owen avatar Feb 07 '17 23:02 jamie-owen

@drickerusa Are you using a reverse proxy? We basically resolved this by setting ip-hash as the load balancing method, where we were previously using least-connected.

Still though, something has changed in recent months, least-connected was working fine for us up until we upgraded last night.

jamie-owen avatar Feb 08 '17 12:02 jamie-owen

@Jamie-Owen I upgraded last night to 0.51.0 and was able to upload files now. I do use nginx as the reverse proxy and use the ip_hash setting. I have also tried least-connected. It seems over time I have gone back and forth on these settings (can you use both ?). I have some saml issues that seem to have cropped up after 0.48.1 but I'm not sure if that is the version they showed up after. I'll have to go back and look and create another issue. As far as the upload I'll watch it over the course of the day and reply later to this issue.

drickerusa avatar Feb 08 '17 14:02 drickerusa

Can I delete the files in /tmp/ufs? I wanted to clean this up.

drickerusa avatar Feb 08 '17 19:02 drickerusa

RC version 0.51.0 Update: I personally can upload files to the system. but, I just saw an exception error that looks painfully familiar. I have not received any complaints yet. So this may only be one error. Here is the screen. image

drickerusa avatar Feb 08 '17 21:02 drickerusa

@drickerusa please keep us posted. Is there anyway you can setup a server or a channel on your server that we can use for debugging?

engelgabriel avatar Feb 09 '17 00:02 engelgabriel

@engelgabriel Because of security we only allow SSO through SAML to the RC server. Local logins are removed. Its possible that I would have to create a designated user which would have to be treated as a contractor in order for you to use the directory to authenticate to the system. For right now I'll watch the logs, but as of today I have yet to see another error like that from 2 days ago. It looks as though @Jamie-Owen may have the same issue with the latest version.

drickerusa avatar Feb 10 '17 16:02 drickerusa

We switched to ip-hash on the reverse proxy and users are no longer complaining about file uploads being broken. As @drickerusa mentioned, there is the odd exception complaining about no such file in /tmp/ufs but I haven't had any direct complaints or been able to reproduce it myself.

We're not able to use least-connected load balancing anymore since we upgraded without file upload completely breaking, our version jumped pretty drastically though, we upgraded from 0.37.1 to 0.51.0 so a lot has changed/been introduced.

The problem seems to stem from the fact that part of the file upload process now relies on something in the filesystem, and using least-connected at the reverse proxy means that any request is likely to not end up at a backend that knows about this file (even more unlikely for us as we're running it in containers too). I would be interested to find out if anyone running a multi-host configuration is experiencing the same issue under similar circumstances.

jamie-owen avatar Feb 13 '17 18:02 jamie-owen

Is this problem still present in the latest version of Rocket.Chat?

Hudell avatar Apr 09 '18 15:04 Hudell

Closing due to inactivity

pierre-lehnen-rc avatar Apr 09 '20 16:04 pierre-lehnen-rc