Rocket.Chat's Community Open Call 🎤 Jan 19th, 2022 Join us!

Unable to change profile picture

Description

Some users are not abble to change profile picture.

Server Setup Information

Rocket.Chat Version: 4.3.1
NodeJS Version: 12.22.8 - x64
MongoDB Version: 4.2.17
MongoDB Engine: wiredTiger
Platform: linux
Process Port: 3000
ReplicaSet OpLog: Enabled
Commit Hash: 21045735b2
Commit Branch: HEAD

Any additional Information

{“level”:50,“time”:“2022-01-10T21:31:42.530Z”,“pid”:17566,“hostname”:“optimus-rocket-chat”,“name”:“System”,“err”:{“type”:“ApiError”,“message”:“No such object: storage-chat/QK9v8EyTKFgxmR9YZ/avatars/Z3TxCYJ9LCZuo4GuJ”,“stack”:“Error: No such object: storage-chat/QK9v8EyTKFgxmR9YZ/avatars/Z3TxCYJ9LCZuo4GuJ
at Util.parseHttpRespBody (/snap/rocketchat-server/1505/programs/server/npm/node_modules/@google-cloud/common/build/src/util.js:191:38)
at Util.handleResp (/snap/rocketchat-server/1505/programs/server/npm/node_modules/@google-cloud/common/build/src/util.js:135:117)
at /snap/rocketchat-server/1505/programs/server/npm/node_modules/@google-cloud/common/build/src/util.js:423:22
at onResponse (/snap/rocketchat-server/1505/programs/server/npm/node_modules/retry-request/index.js:214:7)
at /snap/rocketchat-server/1505/programs/server/npm/node_modules/teeny-request/build/src/index.js:222:13
at /snap/rocketchat-server/1505/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40”,“code”:404,“errors”:[{“message”:“No such object: storage-chat/QK9v8EyTKFgxmR9YZ/avatars/Z3TxCYJ9LCZuo4GuJ”,“domain”:“global”,“reason”:“notFound”}]},“msg”:“No such object: storage-chat/QK9v8EyTKFgxmR9YZ/avatars/Z3TxCYJ9LCZuo4GuJ”}
I20220110-21:31:42.965(0) Exception in setTimeout callback: TypeError: Cannot read property ‘etag’ of undefined at app/lib/server/functions/setUserAvatar.js:67:58 at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1234:12) at packages/meteor.js:550:25 at runWithEnvironment (packages/meteor.js:1286:24)

Hi!

Are you storing uploads in Google Cloud Storage?

In order to replicate, we need to set up a similar environment.

THanks!

Yes. We are using Google Cloud Storage.

Further analysis indicates that the new user can in fact choose a profile picture, but when he/she tries to change that, the rocket.chat uploads the new profile picture to the storage and then deletes the same file. I think that the program should delete before uploads.