Panic: The database schema version of 1.1.0 cannot be upgraded. You must not skip a version

After an upgrade (I think it was from version 8.1 to 8.3), my Mattermost doesn’t start/work anymore. I get the following messages in /var/log/gitlab/mattermost/current each second: panic: The database schema version of 1.1.0 cannot be upgraded. You must not skip a version. and then some Go dump of go routines.

How can I solve this problem? My mattermost content is nearly empty, so I don’t mind if the solution is to recreate it from scratch, but how do I do this?

I’ve run into this as well when I tried to upgrade from 8.1.2 to 8.3.1.

Did you manage to find a way to upgrade, then?

The overall upgrade of Gitlab succeeded, but Mattermost isn’t accessible and just continues to print the error you listed above in its log.

Mattermost is designed to be upgraded sequentially through major version releases. If you skip versions when upgrading GitLab, you may find a panic: The database schema version of 1.1.0 cannot be upgraded. You must not skip a version error in your /var/log/gitlab/mattermost/current directory. If so:

  1. Run platform -version to check your version of Mattermost
  2. If your version of the Mattermost binary doesn’t match the version listed in the database error message, downgrade the version of the Mattermost binary you are using by following the manual upgrade steps for Mattermost and using the database schema version listed in the error messages for the version you select in Step 1) iv).
  3. Once Mattermost is working again, you can use the same upgrade procedure to upgrade Mattermost version by version to your current GitLab version. After this is done, GitLab automation should continue to work for future upgrades, so long as you don’t skip versions.
GitLab Version Mattermost Version
8.1.x v1.1.0
8.2.x v1.2.1
8.3.x v1.3.0

If there are any issues with this procedure, would appreciate your help starting a topic in the Mattermost Troubleshooting Forum which includes a category on GitLab Mattermost specifically

Unfortunately, that’s not particularly helpful. Your link in step 2 is broken. I found the page you copy/pasted that from and it’s broken there as well. The page you copied it from and the page that it’s linking to all seem to be the same: That’s not particularly helpful either as the Gitlab section and the main upgrade section don’t actually talk about how to upgrade a Gitlab instance of Mattermost. It basically says download the new archive, stop the server, extract it, and restart the server. That doesn’t work for Gitlab since the files are in different locations. I did eventually figure it out, partially based on the Mattermost commits into the Gitlab repo.

@lstep As it33 mentioned, we can’t skip versions and need to upgrade one version at a time. Use the table from this page to see which packages you’ll need to download:

Then the steps are as follows:

  1. Download the next upgrade package (i.e. 1.2.1)
  2. Extract it somewhere
  3. Stop Mattermost (gitlab-ctl stop mattermost).
  4. Copy and overwrite bin/platform to {install_dir}/embedded/bin/mattermost
  5. Copy and overwrite api/ to {install_dir}/embedded/service/mattermost/api/
  6. Copy and overwrite web/ to {install_dir}/embedded/service/mattermost/web/
  7. Compare config/config.json to your current config.json. For me, this was in /var/opt/gitlab/mattermost/config.json. Add any missing lines from the new one to the existing one.
  8. Run reconfigure (gitlab-ctl reconfigure).
  9. Start Mattermost (gitlab-ctl start mattermost).
  10. Verify that Mattermost is properly working.
  11. Repeat for the next version (i.e. 1.3.0).

For me, on CentOS 7, {install_dir} was /opt/gitlab/.

The easiest was is described here added by bedotech:

Note: run su - mattermost before doing this.