Rocket.chat: Avatars and uploads broken after upgrade to 0.57

Created on 5 Jul 2017  Â·  8Comments  Â·  Source: RocketChat/Rocket.Chat

Rocket.Chat Version: 0.57.0
Running Instances: 1
DB Replicaset OpLog: Enabled
Node Version: v4.8.1

  • After upgrading our setup to version 0.57.0 file uploads and avatars are broken. Same as in #7410 and with error messages as in #7411
  • We have the following enabled: Settings - File upload - StorageType: FileSystem
  • A downgrade to 0.56.0 afterwards results in #7409
  • Testing with backend gridFS showed that this error is connected to the specified StorageType.
Jul  5 14:10:56 Chat-Stage rocketchat_app_1[21487]: rocketchat_logger rocketchat_logger.js:377 #033[34mMeteor âž” method#033[39m UserPresence:online -> userId: wsHsuKcBSxxeTKuMG , arguments:  {}
Jul  5 14:11:56 Chat-Stage rocketchat_app_1[21487]: message repeated 6 times: [ rocketchat_logger rocketchat_logger.js:377 #033[34mMeteor âž” method#033[39m UserPresence:online -> userId: wsHsuKcBSxxeTKuMG , arguments:  {}]
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]: rocketchat_logger rocketchat_logger.js:377 #033[34mMeteor âž” method#033[39m ufsCreate -> userId: 8bL6YWWcTLexEdoCq , arguments:  { '0':
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]:    { name: 'Neue_Infrastr__f_r_die_DNB.pdf',
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]:      size: 403049,
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]:      type: 'application/pdf',
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]:      rid: 'GENERAL',
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]:      description: '',
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]:      store: 'Uploads' } }
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]: rocketchat_logger rocketchat_logger.js:377 #033[34mUploadProxy âž” debug#033[39m Upload URL: /ufs/FileSystem:Uploads/TpBoA5aDcetP5bavA?token=79a80B791a&progress=0.04065014427526182
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]: rocketchat_logger rocketchat_logger.js:377 #033[34mUploadProxy âž” debug#033[39m Correct instance
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]: rocketchat_logger rocketchat_logger.js:377 #033[34mUploadProxy âž” debug#033[39m Upload URL: /ufs/FileSystem:Uploads/TpBoA5aDcetP5bavA?token=79a80B791a&progress=1
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]: rocketchat_logger rocketchat_logger.js:377 #033[34mUploadProxy âž” debug#033[39m Correct instance
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]: rocketchat_logger rocketchat_logger.js:377 #033[34mMeteor âž” method#033[39m ufsComplete -> userId: 8bL6YWWcTLexEdoCq , arguments:  { '0': 'TpBoA5aDcetP5bavA', '1': 'Uploads', '2': '79a80B791a' }
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]: ufs: cannot delete temp file at /tmp/ufs/TpBoA5aDcetP5bavA (ENOENT: no such file or directory, unlink '/tmp/ufs/TpBoA5aDcetP5bavA')
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]: [Error: FileNotFound: no file with id TpBoA5aDcetP5bavA found]
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]: ufs: cannot write file "TpBoA5aDcetP5bavA" (EACCES: permission denied, open '/TpBoA5aDcetP5bavA.pdf') { [Error: EACCES: permission denied, open '/TpBoA5aDcetP5bavA.pdf']
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]:   errno: -13,
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]:   code: 'EACCES',
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]:   syscall: 'open',
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]:   path: '/TpBoA5aDcetP5bavA.pdf' }
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]: Exception while invoking method 'ufsComplete' Error: EACCES: permission denied, open '/TpBoA5aDcetP5bavA.pdf'
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]:   at Object.Future.wait (/app/bundle/programs/server/node_modules/fibers/future.js:449:15)
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]:   at [object Object].Meteor.methods.ufsComplete (/app/bundle/programs/server/packages/jalik_ufs.js:818:24)
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]:   at [object Object].methodsMap.(anonymous function) (/app/bundle/programs/server/packages/rocketchat_lib.js:1028:26)
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]:   at [object Object].methodMap.(anonymous function) (packages/rocketchat_monitoring.js:2731:30)
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]:   at maybeAuditArgumentChecks (/app/bundle/programs/server/packages/ddp-server.js:1823:12)
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]:   at /app/bundle/programs/server/packages/ddp-server.js:905:20
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]:   at [object Object]._.extend.withValue (packages/meteor.js:1122:17)
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]:   at /app/bundle/programs/server/packages/ddp-server.js:904:41
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]:   at [object Object]._.extend.withValue (packages/meteor.js:1122:17)
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]:   at /app/bundle/programs/server/packages/ddp-server.js:903:46
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]:   at [object Object]._.extend.protocol_handlers.method (/app/bundle/programs/server/packages/ddp-server.js:876:21)
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]:   at /app/bundle/programs/server/packages/ddp-server.js:755:85
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]:
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]:     - - - - -
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]:   at Error (native)
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]:
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]: ufs: cannot delete temp file "/tmp/ufs/TpBoA5aDcetP5bavA" (ENOENT: no such file or directory, unlink '/tmp/ufs/TpBoA5aDcetP5bavA')
Jul  5 14:11:58 Chat-Stage rocketchat_app_1[21487]: rocketchat_logger rocketchat_logger.js:377 #033[34mMeteor âž” method#033[39m ufsDelete -> userId: 8bL6YWWcTLexEdoCq , arguments:  { '0': 'TpBoA5aDcetP5bavA', '1': 'Uploads', '2': '79a80B791a' }
Jul  5 14:12:06 Chat-Stage rocketchat_app_1[21487]: rocketchat_logger rocketchat_logger.js:377 #033[34mMeteor âž” method#033[39m UserPresence:online -> userId: wsHsuKcBSxxeTKuMG , arguments:  {}
file sharing release candidate bug

Most helpful comment

@bbrauns you need to set the System Path for FileSystem uploads (under Administration > File Uploads > File System). in your example it should be /data/upload (which you have mapped as a volume)

All 8 comments

Yeap, you can't save new directory for files, it's using /tmp/ufs/ all the time:

Setting default file store to FileSystem
ufs: cannot write chunk of file "yeme3o7DhE9cEm8SY" (EACCES: permission denied, open '/tmp/ufs/yeme3o7DhE9cEm8SY')
ufs: cannot delete temp file "/tmp/ufs/yeme3o7DhE9cEm8SY" (EACCES: permission denied, unlink '/tmp/ufs/yeme3o7DhE9cEm8SY')
[Error: FileNotFound: no file with id yeme3o7DhE9cEm8SY found]

duplicate of #7385

@MartinSchoeler sorry that I disagree with you :-) but I dont think this a duplicate, because #7385 is strictly about avatars, but with StorageType: FileSystem in 0.57.0 everything file related is broken

you're right @bbrauns .. reopening

@bbrauns have you tried 0.57.1? we have done a few fixes

its just the same....I can reproduce the error with the following steps:

  • Host:
root@Chat-Stage:/tmp# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.5 LTS"
root@Chat-Stage:/tmp# docker version
Client:
 Version:      17.03.1-ce
 API version:  1.27
 Go version:   go1.7.5
 Git commit:   c6d412e
 Built:        Mon Mar 27 17:10:36 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.03.1-ce
 API version:  1.27 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   c6d412e
 Built:        Mon Mar 27 17:10:36 2017
 OS/Arch:      linux/amd64
 Experimental: false

  • Steps:
root@Chat-Stage:/tmp# mkdir db
root@Chat-Stage:/tmp# chmod 777 db
root@Chat-Stage:/tmp# cat docker-compose.yml
version: "2"
services:
  app:
    image: rocketchat/rocket.chat:0.57.1
    restart: always
    ports:
      - 3000:3000
    volumes:
      - /tmp:/data/upload
    environment:
      - PORT=3000
      - ROOT_URL=http://chat-stage.gwdg.de
      - MONGO_URL=mongodb://mongo:27017/rocketchat
      - MONGO_OPLOG_URL=mongodb://mongo:27017/local
    depends_on:
      - mongo
    logging:
      driver: syslog
      options:
        tag: "{{.Name}}"

  mongo:
    image: mongo:3.4
    restart: always
    volumes:
      - /tmp/db:/data/db
    command: mongod --smallfiles --oplogSize 128 --replSet rs0
    logging:
      driver: syslog
      options:
        tag: "{{.Name}}"

  mongo-init-replica:
    image: mongo:3.4
    command: 'mongo mongo/rocketchat --eval "rs.initiate({ _id: ''rs0'', members: [ { _id: 0, host: ''localhost:27017'' } ]})"'
    depends_on:
      - mongo
    logging:
      driver: syslog
      options:
        tag: "{{.Name}}"
root@Chat-Stage:/tmp# docker-compose -f docker-compose.yml up -d
Starting tmp_mongo_1
Starting tmp_mongo-init-replica_1
Starting tmp_app_1
  • Register account and login first time
  • upload files -> that works
  • go to settings - file upload - set storage type to: filesystem
  • upload file -> does not work

@bbrauns you need to set the System Path for FileSystem uploads (under Administration > File Uploads > File System). in your example it should be /data/upload (which you have mapped as a volume)

thx @sampaiodiego I should have checked that setting...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Buzzele picture Buzzele  Â·  3Comments

ghost picture ghost  Â·  3Comments

lunitic picture lunitic  Â·  3Comments

neha1deshmukh picture neha1deshmukh  Â·  3Comments

mattlin picture mattlin  Â·  3Comments