/home/git/gitlab no such file or directory / Upgrade Problems

Hi all!

I’m running Gitlab CE 13.12.1 on a CentOS stream VM. I used the omnibus installation method and everything went fine so far (except for the fact that the ldap authentication is not workiing, but on the other hand, we have just a couple of users who will use the git server…).

My users tested gitlab and are very happy with it. So before going into an productive use, i wanted to upgrade to the newest version.

Following this steps: Universal update guide for patch versions of source installations | GitLab I am stuck at the very first beginning…:

[root@server home]# sudo service gitlab stop
Redirecting to /bin/systemctl stop gitlab.service
Failed to stop gitlab.service: Unit gitlab.service not loaded.

[root@server home]# cd /home/git/gitlab
-bash: cd: /home/git/gitlab: No such file or directory

[root@server home]# sudo -u git -H git fetch --all
sudo: git: command not found

[root@server home]# sudo -u git -H git checkout – Gemfile.lock db/structure.sql locale
sudo: git: command not found

What am i doing worng? any ideas?

thank you all!

If you did omnibus install, then you just do dnf update or yum update to get the latest version if you followed the omnibus install for adding the repos etc.

Since you don’t have a source installation, you are following the wrong update guide.

Here is the docs you should be following: Update GitLab installed with the Omnibus GitLab package | GitLab

Also when upgrading you do not stop gitlab, since it needs the database running to upgrade and make migrations. So please let the gitlab process stop/start what it needs to.

1 Like

I thought so to, but if i run sudo yum install gitlab-ce, i get the following output:

gitlab_gitlab-ce                                357  B/s | 862  B     00:02    
gitlab_gitlab-ce-source                         385  B/s | 862  B     00:02    
gitlab_gitlab-ee                                381  B/s | 862  B     00:02    
gitlab_gitlab-ee-source                         349  B/s | 862  B     00:02    
Package gitlab-ce-13.12.1-ce.0.el8.x86_64 is already installed.
Dependencies resolved.
================================================================================
 Package        Arch        Version                 Repository             Size
================================================================================
Upgrading:
 gitlab-ce      x86_64      14.1.0-ce.0.el8         gitlab_gitlab-ce      884 M

Transaction Summary
================================================================================
Upgrade  1 Package

Total download size: 884 M
Is this ok [y/N]: y
Downloading Packages:
gitlab-ce-14.1.0-ce.0.el8.x86_64.rpm             62 MB/s | 884 MB     00:14    
--------------------------------------------------------------------------------
Total                                            62 MB/s | 884 MB     00:14     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1 
  Running scriptlet: gitlab-ce-14.1.0-ce.0.el8.x86_64                       1/2 
gitlab preinstall: It seems you are upgrading from major version 13 to major version 14.
gitlab preinstall: It is required to upgrade to the latest 14.0.x version first before proceeding.
gitlab preinstall: Please follow the upgrade documentation at https://docs.gitlab.com/ee/update/index.html#upgrade-paths
error: %prein(gitlab-ce-14.1.0-ce.0.el8.x86_64) scriptlet failed, exit status 1

Error in PREIN scriptlet in rpm package gitlab-ce
  Verifying        : gitlab-ce-14.1.0-ce.0.el8.x86_64                       1/2 
  Verifying        : gitlab-ce-13.12.1-ce.0.el8.x86_64                      2/2 

Failed:
  gitlab-ce-13.12.1-ce.0.el8.x86_64       gitlab-ce-14.1.0-ce.0.el8.x86_64      

Error: Transaction failed

So, obviusly i can’t upgrade to 14.x directly… So i started to take a look at the link provided and wanted to do an “Multi-step upgrade”
If i’m running dnf search gitlab-ce* i get:

Last metadata expiration check: 0:04:11 ago on Tue 27 Jul 2021 01:50:10 PM CEST.
=========================== Name Matched: gitlab-ce* ===========================
gitlab-ce.x86_64 : GitLab Community Edition (including NGINX, Postgres, Redis)

Aaaaaand now i’m stuck…
Because, if i rung dnf install gitlab-ce.x86_64 i get version 14.x…
I even tried to trick the system bei typing dnf install gitlab-ce=13.12.7-ce.0 … but that resulted in an error (obviusly)

Last metadata expiration check: 0:00:51 ago on Tue 27 Jul 2021 02:00:44 PM CEST.
No match for argument: gitlab-ce=13.12.7-ce.0
Error: Unable to find a match: gitlab-ce=13.12.7-ce.0

How can i upgrade?

Because the equals sign is the apt-get command for Debian/Ubuntu, here are the examples as per the docs:

# RHEL/CentOS 6 and 7
yum install gitlab-ee-12.0.12-ee.0.el7
# RHEL/CentOS 8
dnf install gitlab-ee-12.0.12-ee.0.el8

so you should be using:

dnf install gitlab-ce-13.12.7-ce.0.el8

and make sure background migrations are 0 before attempting to upgrade to the next version after this.

1 Like

OMG… :man_facepalming: I am so sorry… Totally my mistake…

Thank you!
Upgrade worked perfectly!

1 Like