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

RC bug: FileSystem Avatars not available

Open soundstorm opened this issue 9 years ago • 25 comments

Rocket.Chat Version: 0.57.0.rc-1 Running Instances: 1

Probably this issue exists because of #6788 ? We used FileSystem as storage type, but it seems that the storage engine was changed to GridFS. Doesn't matter if I switch between both, if I upload a new avatar the file date doesn't alter, so the storage type defaults to GridFS and is not changeable.

soundstorm avatar Jun 06 '17 09:06 soundstorm

before 0.57-rc we have two different storage types: one just for avatars and another one just for file uploads. but now we just have one configuration for both features, which is the previous option for file uploads. when you upgraded your rocket.chat, your avatars should have been migrated from the FileSystem to the file uploads storage option.

with that said, are you saying you cannot change the file uploads storage type option from GridFS to FileSystem? or are you saying if you change between them the files are kept on the old option?

sampaiodiego avatar Jun 06 '17 12:06 sampaiodiego

Okay:

So the option where to store the avatars is currently remaining in the admin panel but has no influence on the storage as it is set by the main storage settings? So the deprecated menu is confusing.

When upgrading to the rc the avatars are not migrated. Is there a way to do a automatic migration instead of forcing the users to reupload their images?

They are saved in the same cryptic version as ordinary uploads in e.g. uploads/guTGt472jjHldth instead of avatars/username? And emojis get the same change?

soundstorm avatar Jun 06 '17 17:06 soundstorm

After upgrading from 0.55.1-rcX to 0.57.1-rc1 all of our avatars and files now return 404.

Avatar storage type is (was) FileSystem. File Upload storage type is (was) FileSystem.

After upgrade, it's still FileSystem for both, but actual avatars/files do not load.

Majkl578 avatar Jun 09 '17 19:06 Majkl578

Had the same problem as @Majkl578 so I guess the migration isn't working properly. Avatars were stored in gridFS, other images on disk.

lucasvanhalst avatar Jun 09 '17 22:06 lucasvanhalst

For me they are simply reset to the colored letters.

soundstorm avatar Jun 09 '17 23:06 soundstorm

For me they are simply reset to the colored letters.

Same here for avatars, altough they still exist physically in original location. Files just simply result in a 404.

Majkl578 avatar Jun 09 '17 23:06 Majkl578

My logs are full with this since 0.57.0-rc1, is it related to this problem?

Jun 10 23:46:25 nodejs-RocketChat2[47837]: rocketchat_logger rocketchat_logger.js:377 #033[34mLDAPSync ➔ info#033[39m Syncing user avatar Jun 10 23:46:25 nodejs-RocketChat2[47837]: rocketchat_logger rocketchat_logger.js:377 #033[31mLDAPSync ➔ error#033[39m { [Error: Forbidden [forbidden]] Jun 10 23:46:25 nodejs-RocketChat2[47837]: error: 'forbidden', Jun 10 23:46:25 nodejs-RocketChat2[47837]: reason: 'Forbidden', Jun 10 23:46:25 nodejs-RocketChat2[47837]: details: undefined, Jun 10 23:46:25 nodejs-RocketChat2[47837]: message: 'Forbidden [forbidden]', Jun 10 23:46:25 nodejs-RocketChat2[47837]: errorType: 'Meteor.Error' }

Scream85 avatar Jun 10 '17 23:06 Scream85

It seems this LDAP avatar sync problem also breaks the LDAP authentication and login. After disabling avatar sync, I managed to login again.

Scream85 avatar Jun 11 '17 02:06 Scream85

same here with ldap enabled and filesystem for avatar and file uploads. please fix. we have over a 100gb of files.

admin-crowd-iugo avatar Jun 13 '17 19:06 admin-crowd-iugo

@sampaiodiego is working on this: #7352

soundstorm avatar Jun 30 '17 12:06 soundstorm

@soundstorm thx for referecing it.

so #7352 should have fixed most of the problems with avatar migration, but unfortunately it does not repair broken migrations already ran. :disappointed:

looks like your rocket.chat is on an undesired state.. so let me ask: are avatar files still on the old configured path? what is your configured file upload storage type (regular files not avatar)?

sampaiodiego avatar Jun 30 '17 12:06 sampaiodiego

@Scream85 can you please fill a new issue describing your LDAP avatar sync issues? I dind't test it on #7352 so it might still be broken

sampaiodiego avatar Jun 30 '17 12:06 sampaiodiego

Confirmed with RC3, avatars still missing.

Majkl578 avatar Jun 30 '17 12:06 Majkl578

@Majkl578 as I said rc.3 will not fix broken migrations..

since you have said the original files are still on the old location, can you please confirm if you still have the old configs on your database? please run the following on mongo shell:

db['rocketchat_settings'].find({ 
  _id: { $in: ['Accounts_AvatarStoreType', 'Accounts_AvatarStorePath'] }
});

sampaiodiego avatar Jun 30 '17 12:06 sampaiodiego

root@7b3d2c86df5a:/# mongo 'mongodb://127.0.0.1:27017/rocketchat'
MongoDB shell version v3.4.5
connecting to: mongodb://127.0.0.1:27017/rocketchat
MongoDB server version: 3.4.5
Server has startup warnings: 
2017-06-30T03:34:16.599+0000 I STORAGE  [initandlisten] 
2017-06-30T03:34:16.600+0000 I STORAGE  [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2017-06-30T03:34:16.601+0000 I STORAGE  [initandlisten] **          See http://dochub.mongodb.org/core/prodnotes-filesystem
2017-06-30T03:34:20.625+0000 I CONTROL  [initandlisten] 
2017-06-30T03:34:20.625+0000 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2017-06-30T03:34:20.625+0000 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2017-06-30T03:34:20.625+0000 I CONTROL  [initandlisten] 
> db['rocketchat_settings'].find({ 
...   _id: { $in: ['Accounts_AvatarStoreType', 'Accounts_AvatarStorePath'] }
... });
{ "_id" : "Accounts_AvatarStorePath", "type" : "string", "enableQuery" : "{\"_id\":\"Accounts_AvatarStoreType\",\"value\":\"FileSystem\"}", "group" : "Accounts", "section" : "Avatar", "packageValue" : "", "valueSource" : "processEnvValue", "hidden" : false, "blocked" : false, "sorter" : 33, "processEnvValue" : "/app/uploads", "i18nLabel" : "Accounts_AvatarStorePath", "i18nDescription" : "Accounts_AvatarStorePath_Description", "ts" : ISODate("2017-06-11T01:10:20.888Z"), "_updatedAt" : ISODate("2017-06-11T01:10:20.888Z"), "createdAt" : ISODate("2016-12-07T01:06:53.515Z"), "value" : "/avatars" }
{ "_id" : "Accounts_AvatarStoreType", "type" : "select", "values" : [ { "key" : "GridFS", "i18nLabel" : "GridFS" }, { "key" : "FileSystem", "i18nLabel" : "FileSystem" } ], "group" : "Accounts", "section" : "Avatar", "packageValue" : "GridFS", "valueSource" : "packageValue", "hidden" : false, "blocked" : false, "sorter" : 32, "i18nLabel" : "Accounts_AvatarStoreType", "i18nDescription" : "Accounts_AvatarStoreType_Description", "ts" : ISODate("2017-06-11T01:10:20.872Z"), "_updatedAt" : ISODate("2017-06-11T01:10:20.872Z"), "createdAt" : ISODate("2016-12-07T01:06:53.497Z"), "value" : "FileSystem" }

Majkl578 avatar Jun 30 '17 13:06 Majkl578

So you released stable version without actually fixing this... Good job.

Majkl578 avatar Jul 04 '17 11:07 Majkl578

It looks to be fixed in the next minor release.

Instead of being rude and unappreciative, try and add something constructive.

JSzaszvari avatar Jul 04 '17 11:07 JSzaszvari

Well, I did right in the previous post. I posted the settings I was asked for (for which I had to google how to execute query in mongo etc.) and it was left without any response - can't do more as I don't code in Node/JS. So now what's being rude... ☹️

Majkl578 avatar Jul 04 '17 12:07 Majkl578

@Majkl578 this is why we strongly caution moving production systems to release candidates. They are unfinished and often contain bugs.

In this case for people coming directly from 0.56.0 to 0.57.0 it seems to work fine. This is why a release went on out.

Its cases where someone tried out 0.57.0-rc.1 / 0.57.0-rc.2 that we're having to work through

geekgonecrazy avatar Jul 04 '17 21:07 geekgonecrazy

We have a copy of our production system that went directly from 0.56 -> 0.57 (never installed a release candidate) and has this same issue with LDAP avatars. Logins are also broken until the "Sync User Avatar" option is set to false.

Is there a manual query or other work around we can use to fix the issue?

ImageEngineIT avatar Jul 04 '17 23:07 ImageEngineIT