SideKiq overloaded after upgrading Gitlab 17.11 to Gitlab 18.0

A few weeks ago I upgraded a self-hosted Gitlab instrance from version 17.2 -> version 17.11 – > 18.0.

The first days after upgrade everything looked working fine but suddendly the devs team reported that commits were not updated in their remote branches and MRs. Digging into this I found that Sidekiq was overloaded with a lot of jobs in the default queue, more than 3k jobs stuck there. You can check this queues in https://gitlab.yourdomain.com/admin/sidekiq

Since I recently ran a major upgrade (going to version 18), I decided to run a reindex of database of Gitlab and it solved my issue.

If you are going to try this solve an error like this you have to consider the downtime while reindexing the DB, and the time depends on your DB size/weight.

Don’t forget to backup first your DB before reindexing. It’s better if you can do it out of working hours.

My step were these, all are commands running from the terminal in the Gitlab server:

  1. Backup your DB complete. If your are in cloud you can create snapshot or AMI
  2. Stop PUMA and SIDEKIQ services
sudo gitlab-ctl stop
sudo gitlab-ctl stop sidekiq

3. Reindex DB

sudo gitlab-psql -d gitlabhq_production -c "REINDEX DATABASE gitlabhq_production;"

4. Restart you Gitlab complete.

sudo gitlab-ctl start

After this Gitlab is working fine again. I hope this solution can help you or give you an idea to solve your problem.