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

File upload problem

Open Ukas9 opened this issue 9 years ago • 15 comments

Hey there,

I've got problem with file upload.

Quick info:

Rocket.Chat Version: 0.55.0-rc.3
Running Instances: 1
DB Replicaset OpLog: Disabled
Node Version: v4.5.0
Debian 9.0
Apache v.2.4.25

Apache SSL Reverse Proxy conf file:

<VirtualHost *:443>

ServerName domain.com

SSLEngine On
SSLCertificateFile /etc/ssl/certs/domain.com.crt
SSLCertificateKeyFile /etc/ssl/private/domain.com.key

<Location /var/www/Rocket.Chat/>
        Order allow,deny
        Allow from all
</Location>

RewriteEngine On
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /chat/(.*)           ws://localhost:3000/chat/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket [NC]
RewriteRule /chat/(.*)           http://localhost:3000/chat/$1 [P,L]

ProxyPass /chat/ http://localhost:3000/chat/
ProxyPassReverse /chat/ http://localhost:3000/chat/
</VirtualHost>

I tried to use GridFS and FileSystem but nothing works well. All time file stucks on 0%. I also tried to edit jalik_ufs.js file, in order to change storesPath to chat/ufs according to https://github.com/jalik/jalik-ufs/tree/v0.6.4#configuration. After that the progress bar comes to 100%, but after I receive internal server error and nothing happens.

Rocket.Chat logs with storesPath = chat/ufs:

{ [Error: ENOENT: no such file or directory, open '/tmp/ufs/naTNBxCzPkxCM8T55']
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/tmp/ufs/naTNBxCzPkxCM8T55' }
[Error: FileNotFound: no file with id naTNBxCzPkxCM8T55 found]
Exception while invoking method 'ufsComplete' Error: ENOENT: no such file or directory, open '/tmp/ufs/naTNBxCzPkxCM8T55'
  at Object.Future.wait (/var/www/Rocket.Chat/programs/server/node_modules/fibers/future.js:449:15)
  at [object Object].Meteor.methods.ufsComplete (/var/www/Rocket.Chat/programs/server/packages/jalik_ufs.js:818:24)
  at [object Object].methodsMap.(anonymous function) (/var/www/Rocket.Chat/programs/server/packages/rocketchat_lib.js:1069:26)
  at [object Object].methodMap.(anonymous function) (packages/rocketchat_monitoring.js:2731:30)
  at maybeAuditArgumentChecks (/var/www/Rocket.Chat/programs/server/packages/ddp-server.js:1823:12)
  at /var/www/Rocket.Chat/programs/server/packages/ddp-server.js:905:20
  at [object Object]._.extend.withValue (packages/meteor.js:1122:17)
  at /var/www/Rocket.Chat/programs/server/packages/ddp-server.js:904:41
  at [object Object]._.extend.withValue (packages/meteor.js:1122:17)
  at /var/www/Rocket.Chat/programs/server/packages/ddp-server.js:903:46
  at [object Object]._.extend.protocol_handlers.method (/var/www/Rocket.Chat/programs/server/packages/ddp-server.js:876:21)
  at /var/www/Rocket.Chat/programs/server/packages/ddp-server.js:755:85

    - - - - -
  at Error (native)

Ukas9 avatar Apr 13 '17 10:04 Ukas9

This issue was not introduced by the new version.

The problem is related with sub folder.

More info: https://github.com/jalik/jalik-ufs/issues/104

rodrigok avatar Apr 17 '17 19:04 rodrigok

The problem is relater with this line https://github.com/RocketChat/Rocket.Chat/blob/develop/packages/rocketchat-lib/lib/startup/settingsOnLoadSiteUrl.coffee#L10 where we override the ROOT_URL removing the sub folder

rodrigok avatar Apr 17 '17 19:04 rodrigok

I tried to use GridFS and FileSystem but nothing works well. All time file stucks on 0%.

I have the same issue using nginx and sub folder with the latest doker rocket.chat server (version 0.55.1)

tmtben avatar Apr 24 '17 19:04 tmtben

Same issue when running in sub dir. Any workaround or update on this?

JohnDorien1 avatar May 16 '17 11:05 JohnDorien1

Same issue here with docker 0.56

muus84 avatar May 17 '17 09:05 muus84

After Update to 0.56 our upload stopped working completely. Permissions are unchanged. Both GridFS and Filesystem do not work. Upload is always stuck at 0%, no error in the logs. No subfolder is used.

Update: Some fishy permissions on the /tmp/-folder were causing this.

mfueser avatar May 18 '17 13:05 mfueser

Same issue with 0.56 with nginx on centos. Updating to 0.57.0-rc.1 no fix for this problem.

wisnutri avatar Jun 11 '17 15:06 wisnutri

Same issue with 0.56. Upload is stuck at 0%. Each time I tested an upload got this error at server side: [Error: FileNotFound: no file with id TNfedy2KB5X7uy8vE found]

Changed from GridFS to FS, tested with several filesystem setup (different paths, different permissions). Nothing works.

Also in chrome I get this forever pending request: https://www.mydomain.com/ufs/fileSystem/qSgyhmPihERCPoXpx?token=D899C99a78&progress=0.11050036757019242

I'm running Rocket.Chat under a reverse proxy setup.

bmduarte avatar Jun 15 '17 21:06 bmduarte

I'm using Nginx with multiple instances. When i put in upstream the ip_hash option instead round-robin(default); The file stay complete, but when i save de file he come without extension; upstream rocket{ ip_hash; server 192.168.55.41:3001; server 192.168.55.41:3002; server 192.168.55.41:3003; server 192.168.55.41:3004; }

marcelogomess avatar Jul 03 '17 20:07 marcelogomess

@rodrigok kindly review

ryoshimizu avatar Jul 04 '17 09:07 ryoshimizu

i have a same issue. i run rocketchat instance at root folder not a sub folder.

  • when upload by mobile app or sometime by web app , it stuck at 0% workaround : run only 1 instance will solve this issue.
  • when download attachment is missing extension i saw that it is a client bug , report at : https://github.com/RocketChat/Rocket.Chat.Electron/issues/536

ledainam avatar Sep 20 '17 10:09 ledainam

Same issue, multiple installs. Any progress? This seems to be a never ending, and ultimately probably pretty basic, issue to resolve?

scottalanmiller avatar Jun 27 '18 14:06 scottalanmiller

Any update on this issue?

christophetd avatar Jul 27 '18 08:07 christophetd

I had this issue. The solution for me was incorrect url still set to - ROOT_URL=http://docker:3000 which can't work with uploading images if you mapped IP address and didn't change it. After a while the client (admin) is prompted to change the site URL image that fixed it by itself for me.

john8647 avatar Aug 09 '18 11:08 john8647

Thanks @john8647

For me it was an admin changing https to http in Rocket Chat settings. Unfortunately this dialog wouldn't show itself on the MacOS app, and opening up the Web version revealed the error and the fix.

farzadso avatar Jun 02 '19 10:06 farzadso