mattermost local server storage files not showing in frontend after apt-get upgrade to 8.2
after running apt-get update && apt-get install gitlab-ce
I noticed avatars seem to be missing, then noticed uploaded pasted chat images were missing too.
The Mattermost server log shows many lines like this...
[2015/11/23 17:14:50 EST] [EROR] readFile: Encountered an error reading from local server storage, open /var/opt/gitlab/mattermost/data/teams/1neo6rum8fy47gjqx3xhg3x74r/channels/33ooyd9t4p8m5ko7157wwgbp5a/users/hehh9t7ncbd7b8z6uyi54fmbqa/yopridm6fbbu8fo9fz8mqt6mah/Image Pasted at 2015-10-20 16-22_thumb.jpg: no such file or directory
[2015/11/23 17:14:50 EST] [EROR] /api/v1/files/get/33ooyd9t4p8m5ko7157wwgbp5a/6igydm7xsjgdjqxctzedt7y36r/3i7hxjqz3pdzpddyqgsra7drfy/Image Pasted at 2015-10-20 16-23_thumb.jpg:getFile code=404 rid=tbf7oyrhztyzfdtdgijnc4m16a uid=hehh9t7ncbd7b8z6uyi54fmbqa ip=10.150.17.17 Could not find file. [details: path=teams/1neo6rum8fy47gjqx3xhg3x74r/channels/33ooyd9t4p8m5ko7157wwgbp5a/users/6igydm7xsjgdjqxctzedt7y36r/3i7hxjqz3pdzpddyqgsra7drfy/Image Pasted at 2015-10-20 16-23_thumb.jpg]
It appears that maybe there was previously a typo in some path "mattermost/datateams" instead of "mattermost/data/teams". And some of it got copied to the right place when the upgrade happened, and some didn't?
root@git01kwd01:/var/opt/gitlab/mattermost# find `pwd` -name 'channels'
/var/opt/gitlab/mattermost/datateams/1neo6rum8fy47gjqx3xhg3x74r/channels
The user avatar files do still appear to exist on the filesystem, but interestingly there are two copies, one from Oct 23, and one from today...
root@git01kwd01:/var/opt/gitlab/mattermost# ll
total 20
drwxr-xr-x 4 mattermost root 4096 Nov 23 16:58 ./
drwxr-xr-x 18 root root 4096 Nov 23 16:58 ../
-rw-r--r-- 1 mattermost root 3489 Nov 23 16:59 config.json
drwxr-xr-x 3 mattermost root 4096 Nov 23 16:58 data/
drwxr-xr-- 5 mattermost mattermost 4096 Oct 23 12:06 datateams/
root@git01kwd01:/var/opt/gitlab/mattermost# find `pwd` -name profile.png | xargs ls -l
-rw-r--r-- 1 mattermost mattermost 1722 Nov 23 16:58 /var/opt/gitlab/mattermost/data/teams/1neo6rum8fy47gjqx3xhg3x74r/users/41s6iiy6pty4fb4x4ohenwn9jc/profile.png
-rw-r--r-- 1 mattermost mattermost 1722 Oct 23 15:54 /var/opt/gitlab/mattermost/datateams/1neo6rum8fy47gjqx3xhg3x74r/users/41s6iiy6pty4fb4x4ohenwn9jc/profile.png
-rw-r--r-- 1 mattermost mattermost 1509 Nov 23 16:58 /var/opt/gitlab/mattermost/data/teams/1neo6rum8fy47gjqx3xhg3x74r/users/467y4gowr3ymjxbtwqjca4daiw/profile.png
-rw-r--r-- 1 mattermost mattermost 24393 Oct 23 12:19 /var/opt/gitlab/mattermost/datateams/1neo6rum8fy47gjqx3xhg3x74r/users/467y4gowr3ymjxbtwqjca4daiw/profile.png
To fix my missing uploaded channel images this worked.
cp -Rfp /var/opt/gitlab/mattermost/datateams/1neo6rum8fy47gjqx3xhg3x74r/channels /var/opt/gitlab/mattermost/data/teams/1neo6rum8fy47gjqx3xhg3x74r/
I wasn't able to figure out how to fix the missing avatars
I suspect maybe a db migration or something else broke that user setting somehow. I'm happy to help troubleshoot this if somebody can point me in the right direction!
Mattermost 1.2.1
Build Number:4063
Build Date:Mon Nov 16 16:56:43 UTC 2015
Build Hash:49a459d696fc8fee0b508990fca571fb8d2f2654
This issue didn't start until the GitLab 8.2 update, I didn't change any configurations.
Hope this info helps somebody else!