I dropped the mattermost database as described by @3rdcycle. Now Mattermost is showing the following error
GitLab Mattermost needs your help:
We could not get all teams
UPDATE
I disabled mattermost integration. Executed gitlab-ctl reconfigure
. Re-enabled mattermost and again executed gitlab-ctl reconfigure
. This time it worked.