After experiencing issues with a server that had been running the CE GitLab suite for quite a long time, I migrated to a new server. I am experiencing a problem after going through what I believe are all the steps in order to use GitLab on this new server. The observations/issues are as follows:
- I am unable to create new branches from my ‘Maintainer’ user on the GitLab web application. This returns 401 - Unauthorized
- I am unable to push any branch from my local machine. This fails with
remote: GitLab: 401 Unauthorized
To gitlab.example.com:example/sample.git
! [remote rejected] test-branch -> test-branch (pre-receive hook declined)
error: failed to push some refs to 'git@gitlab.example.com:example/sample.git'
- I am able to do
git fetchwithout any problems. - I am able to do
git clonevia ssh and https without any problems.
These are the steps I followed to create the backup and restore it on my new server.
- On the original (old) server (Ubuntu 18.04) I created a backup tar file using
sudo gitlab-backup create. - I used
scpto copy the tar backup, plus thegitlab.rbandgitlab-secrets.jsonfiles to my local environment. - On the new server (Ubuntu 20.04), I followed GitLab’s instructions to install the latest version of GitLab.
- I used
scpto copy my backup plus config and secrets file to the new machine. - I adjusted the permissions:
chown git:git 1636409817_2021_11_08_14.4.2_gitlab_backup.tar
chown root:root gitlab.rb
chown root:root gitlab-secrets.json
- The files were moved to the correct locations (
/etc/gitlabfor the .rb and .json files, and/var/opt/gitlab/backupsfor the .tar file) - I ran
sudo gitlab-backup restoreto restore the backup (there was only one file in/var/opt/gitlab/backups) - I ran
sudo gitlab-ctl reconfigure
Once I finished that, I accessed my website and was able to sign in with my old user account and view that all of the expected projects with all of the expected source code were present.
I tried to do a git fetch for one of the repositories on my local machine and needed to adjust the known_hosts in order to access it. Once I did that, I was able to fetch all of the updates from the remote server. As mentioned above, I am also able to clone any repositories.
The only things it seems I cannot do are create branches on the GitLab web application and push branches from my local machine.
The troubleshooting has a section for commits, pushes, and clones returning 401 that states:
You need to sync your
gitlab-secrets.jsonfile with your GitLab application nodes.
I have no idea what that means, and it also only seems to be pushes that are failing for me.
What’s going wrong here. What have I missed? How can I sync my gitlab-secrets.json file with my GitLab application nodes?