Mattermost, Inc.

[Solved] Losing Mattermost settings after GitLab update

I run Gitlab and Mattermost on a Ubuntu 14.4 VM for intranet access and each week when I do my Gitlab update (‘sudo apt-get update’ then ‘sudo apt-get install gitlab-ce’) I lose a number of Mattermost settings. I then have to get into Mattermost and revert those settings.

One example is on the Gitlab Settings page in each of the Endpoint values the fqdn of our Gitlab server gets changed to just the hostname. Example being http://dogmeat.domain.com/oauth/authorize becomes http://dogmeat/oauth/authorize.

This actually makes it fun getting back into Mattermost to the System Console but over time I’ve saved some shortcuts and log in with my Mattermost account as attempting to use my Gitlab account fails.

Other settings include e-mail being set back to disabled, settings related to webhooks turned off, team creation enabled, etc. Just various settings here and there I have to flip again. Also, the site name always reverts back to Gitlab Mattermost.

I’ve been running this since before the config changeover but I don’t recall the version and I don’t recall if I started with a standalone or if it was always in Gitlab. I’m sure this is self-inflicted as it is very likely that somewhere early on I edited a config file or something and that is getting reapplied losing what I configure in the System Console. I’ve checked /var/opt/gitlab/mattermost/config.json which has appropriate settings along with /etc/gitlab/gitlab.rb which has very little tweaked for Mattermost and what is there uncommented and set is not what it reverts to after the upgrade (example being that the site name is correct, not the default.)

So I guess my question is, where did I tweak something along the way that is getting into the mix each time I do my upgrade, or more specifically what files should I look at? We don’t have many using Mattermost at the moment as we have an internal one-off site I coded for communication (which I hope to replace with Mattermost), but I am afraid of turning away the few folks that are “previewing” it as a replacement (or dealing with this with each update.)

Thanks in advance!

Hi @tpro,

I think if you change the Mattermost settings directly in the gitlab.rb file, they should not be lost when you update GitLab.

If you use the System Console to edit Mattermost settings, we recommend backing up your Mattermost config.json file before updating, and then restoring it afterwards.

Thanks for the response. I’ll make sure I have my preferred settings defined in the gitlab.rb before the next update and see how that goes.

By setting every possible setting available within the gitlab.rb I was able to perform the 8.4 update and still log back into Mattermost.

After this, it only lost some settings related to webhooks (enable incoming and enabling overriding usernames and icons) which is a very minimal action to perform after upgrades (and which may be prevented by copying/replacing the Mattermost config.json file).

So, that was pretty much the ticket as the big issue was losing the auth/access. Thanks much!

tpro

@tpro you may want to look into https://github.com/gitlabhq/omnibus-gitlab/blob/master/files/gitlab-config-template/gitlab.rb.template where you can find a full list of variables that you can define in gitlab.rb so that no manual editing will be required anymore.

The few missing that I had to do manually that were related to webhook enabling and icon and name overriding were in the link you sent so I copied the relevant lines into my gitlab.rb and set them the way I desired.

With that, I should be a happy camper with each upgrade now!

Thanks so much!