Skip to content

dev.gitlab.org - Maintenance tasks

The Release&Deploy team is responsible for ensuring that the GitLab instance on this server remains operational.

  • Access to the node
  • Depending on whether the task requires permanent changes to /etc/gitlab/gitlab.rb, access to the Chef repo. If you do not have access to this repository, make sure you create an issue in Infrastructure issue tracker and label it access request.

In case of an issue with the latest deploy, we might need to revert the installation to a previous nightly version and lock the deployment until the fixes are ready. This is done to ensure stability of dev.gitlab.org for others using the instance.

  1. Create an issue in the release tasks issue tracker describing the downgrade and including links to related issues. Assign the issue to yourself.

  2. Announce the downgrade in the #announcements Slack channel before proceeding:

    I will be manually downgrading package on dev.gitlab.org to <version> as latest nightly is not working as expected. <link to issue>
  3. Stop Sidekiq and Puma to prevent data from being altered during the downgrade:

    Terminal window
    sudo gitlab-ctl stop sidekiq
    sudo gitlab-ctl stop puma
  4. Find the previous working version. Each time a package is installed on the instance, a message is sent to the #announcements Slack channel. For example:

    Package upgrade finished on host dev-1-01-sv-dev-1, current installed version is 18.8.1+rnightly.2272572929.567945e4-0
  5. Downgrade to the previous version:

    Terminal window
    sudo apt-get install gitlab-ce=<version>

    For example, to downgrade to version 10.4.0+rnightly.75436.44501791-0, run:

    Terminal window
    sudo apt-get install gitlab-ce=10.4.0+rnightly.75436.44501791-0

    This will automatically run reconfigure and apply the necessary changes.

  6. After reconfiguration completes, restart all services:

    Terminal window
    sudo gitlab-ctl restart
  7. Verify all services are running:

    Terminal window
    sudo gitlab-ctl status
  8. Verify the correct version is deployed by visiting https://dev.gitlab.org/help.

  9. Create a package hold to prevent automatic upgrades:

    Terminal window
    sudo apt-mark hold gitlab-ce

    Verify the hold is in place:

    Terminal window
    sudo apt-mark showhold
  10. Post a message in the #announcements channel confirming the downgrade is complete:

    Downgrade completed. The package has also been put on hold to prevent automatic upgrades. <link to issue>
  11. Close the issue and add the following labels:

    • release-blocker
    • Deploys-blocked-gstg
    • Deploys-blocked-gprd

Once the issue has been resolved, unhold the package and upgrade to the latest version.

  1. Announce the upgrade in the #announcements channel:

    I will be removing the package hold and manually upgrading package on dev.gitlab.org to the latest nightly. <link to issue>
  2. Unhold the package:

    Terminal window
    sudo apt-mark unhold gitlab-ce
  3. Continue with upgrading:

    Terminal window
    sudo apt-get update
    sudo apt-get install gitlab-ce
  4. Verify all services are running:

    Terminal window
    sudo gitlab-ctl status
  5. Verify the latest version is installed by visiting https://dev.gitlab.org/help.

  6. Finally, leave a note in the #announcements channel:

    Upgrade completed. dev.gitlab.org now runs <version>. <link to issue>

If, for some reason, you need to apply a change to /etc/gitlab/gitlab.rb, this change needs to be introduced in the dev-gitlab-org role.

If you do not have access to this repository, but you need to do a hot-patch or configuration testing, the following steps can be performed:

  1. Stop chef-client on this node:

    Terminal window
    sudo service chef-client stop
  2. Make the necessary changes to restore the instance. If changes to the gitlab.rb file are required, edit it manually and run reconfigure.

  3. Reach out to Production team to get help on getting your gitlab.rb configuration change committed to the Chef server.

  4. After the changes are applied, start the chef-client on the node:

    Terminal window
    sudo service chef-client start
  5. Make sure that any change you did is noted in an issue! It is your responsibility to revert the change on this node once the fix is in place in the package!

Failed update due to malformed configuration

Section titled “Failed update due to malformed configuration”

When a previous update failed, it may leave behind an incompleted configuration. Then, when the next update (apt install gitlab-ce) happens, it fails with the error:

Malformed configuration JSON file found at /opt/gitlab/embedded/nodes/dev-1-01-sv-dev-1.c.gitlab-dev-1.internal.json.

Make a backup of the malformed configuration:

Terminal window
sudo cp /opt/gitlab/embedded/nodes/dev-1-01-sv-dev-1.c.gitlab-dev-1.internal.json /tmp/

Remove the malformed configuration:

Terminal window
sudo rm /opt/gitlab/embedded/nodes/dev-1-01-sv-dev-1.c.gitlab-dev-1.internal.json

Rerun the update again:

Terminal window
sudo apt update
sudo apt install gitlab-ce

Once the update succeeds, validate if the instance is functional by accessing https://dev.gitlab.org/help. You may need to wait a bit when the GitLab process is restarting.

Remove the backup configuration file:

Terminal window
rm /tmp/dev-1-01-sv-dev-1.c.gitlab-dev-1.internal.json