We're Hiring!

Mattermost, Inc.

Anyone missing profile pics after 3.0 upgrade while using local storage?

Reported from Twitter

1 Like

Same issue here.

My workaround is to manually copy profile images from data/teams/{team_id}/users/ to its new location: data/users/.

Hi @bigsan, thanks for your report, could you share your logs?

Just want to check if your /data directory was present when the upgrade was run. We’ve had a similar report where that was the cause, just want to rule out that possibility.

I’m seeing this as well. My data directory was present during the upgrade.

Does someone have a shell command/script to do this?

“My workaround is to manually copy profile images from data/teams/{team_id}/users/ to its new location: data/users/.”

Hi @it33, I guess it might be the "Current working directory" and the FileSettings.Directory property defined in config.json didn’t work together properly, here is what I thought was happend:

The step 6 in upgrade doc said

  1. Run ./platform -upgrade_db_30

which implied that the current directory is {mattermost}/bin/,

and in the official config.json, the FileSettings.Directory is set to "./data/" by default,

then the data path became {mattermost}/bin/data which doesn’t exist of course.

Maybe if we ran bin/platform -upgrade_db_30 under {mattermost} while upgrading, then the problem won’t happen.

Below is the logs produced during upgrading:

[2016/05/21 16:14:20 UTC] [INFO] Current version is 3.0.0 (3.0.2/Tue May 17 21:26:28 UTC 2016/ac509b114df1c1b4b841eded74fb797805e0162d)
[2016/05/21 16:14:20 UTC] [INFO] Enterprise Enabled: false
[2016/05/21 16:14:20 UTC] [INFO] Current working directory is /mattermost/bin
[2016/05/21 16:14:20 UTC] [INFO] Loaded config file from /mattermost/config/config.json
[2016/05/21 16:14:20 UTC] [INFO] Pinging sql master database
[2016/05/21 16:14:20 UTC] [INFO] Pinging sql replica-0 database
[2016/05/21 16:14:20 UTC] [INFO] Attempting to run speical upgrade of the database schema to version 3.0 for user model changes
[2016/05/21 16:14:36 UTC] [INFO] Starting speical 3.0 database upgrade with performed_backup=YES team_name=the_team
[2016/05/21 16:14:36 UTC] [INFO] Primary team the_team will be left unchanged
[2016/05/21 16:14:36 UTC] [INFO] Upgrading primary team the_team
[2016/05/21 16:14:36 UTC] [WARN] No profile image to move for user01@example.com
...
[2016/05/21 16:14:36 UTC] [WARN] No profile image to move for usernn@example.com
[2016/05/21 16:14:36 UTC] [INFO] Upgraded nn users
[2016/05/21 16:14:36 UTC] [INFO] Altering other scheme changes needed 3.0 for user model changes
[2016/05/21 16:14:36 UTC] [INFO] Finished running speical upgrade of the database schema to version 3.0 for user model changes
[2016/05/21 16:14:36 UTC] [INFO] The database schema has been upgraded to version 3.0.0

We had a similar issue with a different cause - I ran the migration script as root, after which the users/data directory was not readable by the mattermost user. Once I chown’d everything back to mattermost, avatars re-appeared.

Thanks for the contributions on this thread. We’ve updated the upgrade guide to add explicit instructions on backing up and restoring the data folder if using local file storage. These steps will ensure profile pictures are not lost in the upgrade to v3.0.

1 Like