Upgrade Problem

Hello,

We upgraded Gitlab to 12.9.2 (ac5568eb5d8) but it is not the newest version and it says in UI “Update Asap”. When we try to upgrade the latest version, it gives an error as “12.9.2 is the newest version.” How can we fix it and upgrade to latest version?

Thanks in advance.

Would need quite a bit more information.

  1. How are you trying to upgrade?
  2. What operating system/version? Eg: Debian Buster
  3. Omnibus or source version?

I’ve just upgraded from 12.9.2 yesterday to 12.10.14, but I am on Debian Buster, and was using Omnibus version. Today have gone from 12.10.14 to 13.0.14. Let us know how you are attempting to upgrade so we can find out a bit more to help you.

Hi,

  1. How are you trying to upgrade? → I followed to command below after I upgraded to 12.9.2:

sudo apt-get update && sudo apt-get install gitlab-ce

Before that, since my version was too old, i used

apt-get install gitlab-ce=xx.x.x-ce.0

  1. What operating system/version? → Ubuntu 16.04 LTS

  2. Omnibus or source version? → Sorry i am new at Gitlab and could you please tell me how i can find out my source version?

I’ve upgraded from 10.8.7 to 11.1.4 first and followed the order on Gitlab’s website until 12.9.2. Now, I am supposed to upgrade to latest one but system does not allow me to do.

1 Like

I was also stuck at 12.9.2 as standard apt-get upgrade wouldn’t pull any newer versions like it used to. After this I did:

apt-get install gitlab-ce=12.9.3-ce.0

and have done this for all 12.9.x releases, as well as 12.10.x releases to get to 12.10.14 yesterday. This worked for me without any issues, although I expect I could have jumped a few of the releases.

Did you try upgrading like the above command and it failed? If so, were there any error messages?

Also, one of the 12.10.x releases upgrades to Postgresql 11.7, 12.9 is on Postgres 10 from what I remember.

Hello,

When I try this command “apt-get install gitlab-ce=12.9.3-ce.0” it says

Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Version ‘12.9.3-ce.0’ for ‘gitlab-ce’ was not found

I checked all packages exist but my server cannot find any of them. Do you have any other ideas?

Thanks

Yep, I had this issue, it was only after I did this, that it somehow refreshed the repo.

curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash

as usually when I did apt-get upgrade I would get the updated packages, but I got to 12.9.2 and then it stopped for ages. In the beginning I figured it was because of coronavirus and work had stopped but only after about six months, I decided to check and found a load of versions had been released. As an off-chance, I ran that command as if I was installing the repo for the first time, and then suddenly gitlab-ce became available to download.

You have to be careful though, since if you attempt apt-get upgrade now, you will get a 13.3.x release - hence why you have to do the command:

apt-get update
apt-get install gitlab-ce=12.9.3-ce.0

once the upgrade has finished, run the following command to make sure no background migrations are running:

gitlab-rails runner -e production 'puts Gitlab::BackgroundMigration.remaining'

do this after every upgrade The value returned must be a zero before you continue with another upgrade. The reason for doing it this way is because in a 12.10.x release, postgresql is upgraded to 11.7 and in later releases postgresql 10.x doesn’t exist. So to go higher than 12.10.x you need to be on postgresql 11.7 first, and then you can start thinking about moving to 13.x.x.

Below is my upgrade process from the bash history command:

root@repo:~# history | grep -i apt | grep -i install
 1525  apt-get install gitlab-ce=12.9.3-ce.0
 1535  apt-get install gitlab-ce=12.9.4-ce.0
 1537  apt-get install gitlab-ce=12.9.5-ce.0
 1539  apt-get install gitlab-ce=12.9.7-ce.0
 1541  apt-get install gitlab-ce=12.9.8-ce.0
 1543  apt-get install gitlab-ce=12.9.9-ce.0
 1545  apt-get install gitlab-ce=12.9.10-ce.0
 1549  apt-get install gitlab-ce=12.10.0-ce.0
 1559  apt-get install gitlab-ce=12.10.1-ce.0
 1562  apt-get install gitlab-ce=12.10.2-ce.0
 1565  apt-get install gitlab-ce=12.10.3-ce.0
 1568  apt-get install gitlab-ce=12.10.5-ce.0
 1571  apt-get install gitlab-ce=12.10.6-ce.0
 1574  apt-get install gitlab-ce=12.10.7-ce.0
 1577  apt-get install gitlab-ce=12.10.8-ce.0
 1580  apt-get install gitlab-ce=12.10.9-ce.0
 1583  apt-get install gitlab-ce=12.10.10-ce.0
 1586  apt-get install gitlab-ce=12.10.11-ce.0
 1589  apt-get install gitlab-ce=12.10.12-ce.0
 1592  apt-get install gitlab-ce=12.10.13-ce.0
 1595  apt-get install gitlab-ce=12.10.14-ce.0
 1689  apt-get install gitlab-ce=13.0.0-ce.0
 1692  apt-get install gitlab-ce=13.0.1-ce.0
 1695  apt-get install gitlab-ce=13.0.3-ce.0
 1698  apt-get install gitlab-ce=13.0.4-ce.0
 1701  apt-get install gitlab-ce=13.0.5-ce.0
 1704  apt-get install gitlab-ce=13.0.6-ce.0
 1707  apt-get install gitlab-ce=13.0.7-ce.0
 1710  apt-get install gitlab-ce=13.0.8-ce.0
 1713  apt-get install gitlab-ce=13.0.9-ce.0
 1716  apt-get install gitlab-ce=13.0.10-ce.0
 1719  apt-get install gitlab-ce=13.0.12-ce.0
 1722  apt-get install gitlab-ce=13.0.13-ce.0
 1725  apt-get install gitlab-ce=13.0.14-ce.0
 1823  apt-get install gitlab-ce=13.1.0-ce.0
 1826  apt-get install gitlab-ce=13.1.1-ce.0
 1829  apt-get install gitlab-ce=13.1.2-ce.0
 1832  apt-get install gitlab-ce=13.1.3-ce.0
 1835  apt-get install gitlab-ce=13.1.4-ce.0
 1838  apt-get install gitlab-ce=13.1.5-ce.0
 1841  apt-get install gitlab-ce=13.1.6-ce.0
 1843  apt-get install gitlab-ce=13.1.7-ce.0
 1845  apt-get install gitlab-ce=13.1.8-ce.0
 1847  apt-get install gitlab-ce=13.1.9-ce.0
 1859  apt-get install gitlab-ce=13.1.10-ce.0
 1861  apt-get install gitlab-ce=13.1.11-ce.0
 1863  apt-get install gitlab-ce=13.2.0-ce.0
 1865  apt-get install gitlab-ce=13.2.1-ce.0
 1867  apt-get install gitlab-ce=13.2.2-ce.0
 1869  apt-get install gitlab-ce=13.2.3-ce.0
 1871  apt-get install gitlab-ce=13.2.4-ce.0
 1873  apt-get install gitlab-ce=13.2.5-ce.0
 1875  apt-get install gitlab-ce=13.2.6-ce.0
 1877  apt-get install gitlab-ce=13.2.7-ce.0
 1879  apt-get install gitlab-ce=13.2.8-ce.0
 1881  apt-get install gitlab-ce=13.2.9-ce.0
 1884  apt-get install gitlab-ce=13.3.0-ce.0
 1885  apt-get install gitlab-ce=13.3.0-ce.1
 1888  apt-get install gitlab-ce=13.3.1-ce.0
 1890  apt-get install gitlab-ce=13.3.2-ce.0
 1892  apt-get install gitlab-ce=13.3.3-ce.0
 1894  apt-get install gitlab-ce=13.3.4-ce.0

considering the amount of upgrades I did all this split over a few days, as in total took me about 8 hours to go through all that. Each upgrade takes approx 5 - 7 mins including download time over a 200mbps connection. Maybe it was possible to do it more efficiently, but I preferred the safer route by running all of them until I got to the latest.

As of today, latest is 13.3.6.

2 Likes

Hi,

When i try this command, I got an error like “curl: (35) gnutls_handshake() failed: Error in the pull function.” so I could not try the rest.

curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash

Also when I try to run apt-get update, I cannot update all packages maybe because of our company’s network limitations.

E: Failed to fetch http://tr.archive.ubuntu.com/ubuntu/dists/xenial-backports/restricted/binary-amd64/Packages 503 Service Unavailable
E: Failed to fetch http://tr.archive.ubuntu.com/ubuntu/dists/xenial/main/binary-amd64/Packages 503 Service Unavailable
E: Failed to fetch http://ppa.launchpad.net/brightbox/ruby-ng/ubuntu/dists/xenial/main/binary-amd64/Packages 503 Service Unavailable [IP: 91.189.95.83 80]
E: Failed to fetch http://tr.archive.ubuntu.com/ubuntu/dists/xenial-updates/main/binary-amd64/Packages 503 Service Unavailable
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/main/binary-amd64/Packages 503 Service Unavailable [IP: 91.189.91.38 80]
E: Failed to fetch http://ppa.launchpad.net/certbot/certbot/ubuntu/dists/xenial/main/binary-amd64/Packages 503 Service Unavailable [IP: 91.189.95.83 80]
E: Failed to fetch https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/dists/xenial/main/source/Sources gnutls_handshake() failed: Error in the pull function.
E: Some index files failed to download. They have been ignored, or old ones used instead.

Yes, it’s possible they have restricted internet access, maybe a proxy or something. The other alternative is to download each of the deb files one-by-one from here: https://packages.gitlab.com/gitlab/gitlab-ce

When you do that, you can do this on your server:

dpkg -i gitlab-ce_12.9.3-ce.0_amd64.deb

if you can download it directly with wget on the server, or download to your computer and copy across to the server and install.

Or if possible, get them to unblock the internet access so that you can use the gitlab repository and the script link from my previous post. Will save you downloading the packages manually to install.

I managed the run this command on the packages page. I think one s was extra in your comment.

curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash

After that, I tried the command below and result is still same.

sudo apt-get install gitlab-ce=12.9.3-ce.0

Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Version ‘12.9.3-ce.0’ for ‘gitlab-ce’ was not found

Try apt-get update after running the script to ensure the repository information is refreshed. And then try the apt-get install command. If it’s still failing, then that would be odd, since I did this myself when mine wasn’t working and it worked fine. Or one other way:

apt-get clean all
curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
apt-get update
apt-get install gitlab-ce=12.9.3-ce.0

failing that, I haven’t any ideas, as it should work if internet access is available and repositories are refreshed. Otherwise will need to download the package manually and install using the dpkg command.

1 Like

Did you solve your issue?

I encountered the same problem after performing a release upgrade (from Ubuntu 18.04 to 20.04).
I tried upgrading gitlab-ce 12.10.3 to 12.10.5 but got the same message since apt was unable to find that version on Ubuntu’s 20.04 repository :

apt install gitlab-ce=12.10.5-ce.0
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Version ‘12.10.5-ce.0’ for ‘gitlab-ce’ was not found

Following iwalker’s advice I installed the package manually using the Ubuntu 18.04’s packages:

wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/ubuntu/bionic/gitlab-ce_12.10.5-ce.0_amd64.deb/download.deb
dpkg -i gitlab-ce_12.10.5-ce.0_amd64.deb

I did this until I reached version 13.0.0, once there I was able to do a “apt upgrade” and install GitLab’s last version(13.4.1).

1 Like

We had a problem with our company’s network for new gitlab-ce packages. After we updated the system, I tried the update and I managed to update to 12.10.0. It said you need to update PostgreSQL so I did but it gave an error said:

The data directory was initialized by PostgreSQL version 10, which is not compatible with this version 11.7.

I tried to fix it but could not find a proper solution so we went back to snapshot taken before update.

We will plan to update for another time and if it goes well, I will let you know.

Thanks for your helps.

Hi,

I tried the update and I managed to update to 12.10.0. It said you need to update PostgreSQL so I did but it gave an error said:

The data directory was initialized by PostgreSQL version 10, which is not compatible with this version 11.7.

When I tried to run the command

sudo gitlab-ctl pg-upgrade

It gives an error like

1: from /opt/gitlab/embedded/service/omnibus-ctl/lib/gitlab_ctl/util.rb:64:in get_node_attributes' /opt/gitlab/embedded/service/omnibus-ctl/lib/gitlab_ctl/util.rb:52:in parse_json_file’: Attributes not found in /opt/gitlab/embedded/nodes/hostname.json, has reconfigure been run yet? (GitlabCtl::Errors::NodeError)

I tried to remove the file and try to upgrade again but it did not work.

Do you have any ideas to fix this error?

Regards

We fixed the problem with upgrading Postgre first and then GitLab.

Your posting was exactly what saved my day!

Had the exact same constellation (upgraded Ubuntu 18 to 20, same error).

Also your solution worked exactly as you described (manually to 13 then again with apt upgrade).

Hi everyone.
I want to share my experience about the problem i had.
In my case was not postgres or bash script update. The problem was the version of debian: testing. codename today: “bullseye”.

When i executed the gitlab installation script, the file generated in apt had:

deb https://packages.gitlab.com/gitlab/gitlab-ce/debian/ bullseye main

but if you check the url with packages:

the “deb” package is only available for “buster”, so, i updated the apt file with the following:

deb https://packages.gitlab.com/gitlab/gitlab-ce/debian/ buster main

and for me, the problem was solved. I executed “apt update” and after “apt upgrade” and version 14 was updated.

Best regards.

Bullseye is not released yet, so it shouldn’t really surprise anyone that GitLab doesn’t get build for it, but it’s nice to hear that the buster version works.

1 Like