[SOLVED] GitLab Mattermost needs your help: We encountered an error trying to find the account by authentication type

Summary

After upgrading to Gitlab version 8.12.6, users cannot authenticate via Gitlab SSO anymore and this error message is displayed: “GitLab Mattermost needs your help: We encountered an error trying to find the account by authentication type.”

Steps to reproduce

Have an existing Gitlab installation with users that authenticate via Gitlab SSO and upgrade Gitlab to version 8.12.6.
Then try to log in to Mattermost.

Expected behavior

Users should be able to authenticate via Gitlab SSO as it was possible prior to the update.

Observed behavior

Some relevant log entries from the mattermost.log:
[2016/10/12 13:54:06 CEST] [EROR] /api/v3/users/initial_load:SqlUserStore.GetDirectProfiles code=500 rid=5fjr49ya9jb9fxa7w5669spaue uid=ufhs8xpo5idsjkqbwrybyttdwe ip=10.54.74.60 We encountered an error while finding user profiles [details: gorp: no fields [themeprops] in type User] [2016/10/12 13:59:21 CEST] [EROR] /signup/gitlab/complete:SqlUserStore.GetByAuth code=500 rid=oxr9c6bautdh7mf99tq54rybth uid= ip=127.0.0.1 We encountered an error trying to find the account by authentication type. [details: authData=2, authService=gitlab, gorp: no fields [themeprops] in type User]

After some hours of investigation, I was able to fix the problem thanks to this post: http://forum.mattermost.com/t/solved-cant-login-after-upgrade-from-3-2-0-to-3-4-0/2240

Steps to fix:
sudo -u gitlab-psql /opt/gitlab/embedded/bin/psql -h /var/opt/gitlab/postgresql/ mattermost_production


mattermost_production=# UPDATE Systems SET Value = '3.1.0' WHERE Name = 'Version'; mattermost_production-# \q


sudo gitlab-ctl reconfigure sudo gitlab-ctl restart