Upgrade failed from 18.1.2 to 18.2

Same problem here. There are still configuration files left behind from a long time ago when we tried out GitLab EE (AFAIK), maybe that is related?

git.company.tld ~ # dpkg -l | grep gitlab   
iHR gitlab-ce                         18.2.0-ce.0                                 amd64        GitLab Community Edition (including NGINX, Postgres, Redis)
rc  gitlab-ee                         11.9.4-ee.0                                 amd64        GitLab Enterprise Edition (including NGINX, Postgres, Redis)
ii  libgitlab-api-v4-perl             0.26-1                                      all          GitLab API v4 module and command-line client

To make matters worse, the downgrade is broken too, because the upgrade has garbled /opt/gitlab/embedded/nodes/git.company.tld.json:

git.company.tld ~ # apt install gitlab-ce=18.1.2-ce.0                                                  
Paketlisten werden gelesen… Fertig                                                                                                                                                                      
Abhängigkeitsbaum wird aufgebaut… Fertig                                                            
Statusinformationen werden eingelesen… Fertig                                                                                                                                                           
Die folgenden Pakete werden durch eine ÄLTERE VERSION ERSETZT (Downgrade):                          
  gitlab-ce                                                                                                                                                                                             
0 aktualisiert, 0 neu installiert, 1 durch eine ältere Version ersetzt, 0 zu entfernen und 0 nicht aktualisiert.                                                                                        
1 nicht vollständig installiert oder entfernt.                                                                                                                                                          
Es müssen 1.416 MB an Archiven heruntergeladen werden.                                              
Nach dieser Operation werden 72,3 MB Plattenplatz freigegeben.                                                                                                                                          
Möchten Sie fortfahren? [J/n]                                                                       
Holen:1 https://packages.gitlab.com/gitlab/gitlab-ce/debian bullseye/main amd64 gitlab-ce amd64 18.1.2-ce.0 [1.416 MB]                                                                                  
Es wurden 1.416 MB in 16 s geholt (88,4 MB/s).                                                                                                                                                          
dpkg: Warnung: Version 18.2.0-ce.0 des Paketes gitlab-ce wird durch ältere Version 18.1.2-ce.0 ersetzt                                                                                                  
(Lese Datenbank ... 200879 Dateien und Verzeichnisse sind derzeit installiert.)                     
Vorbereitung zum Entpacken von .../gitlab-ce_18.1.2-ce.0_amd64.deb ...                                                                                                                                  
Malformed configuration JSON file found at /opt/gitlab/embedded/nodes/git.company.tld.json.            
This usually happens when your last run of `gitlab-ctl reconfigure` didn't complete successfully.                                                                                                       
This file is used to check if any of the unsupported configurations are enabled,                    
and hence require a working reconfigure before upgrading.                                                                                                                                               
Please run `sudo gitlab-ctl reconfigure` to fix it and try again.                                   
dpkg: Fehler beim Bearbeiten des Archivs /var/cache/apt/archives/gitlab-ce_18.1.2-ce.0_amd64.deb (--unpack):                                                                                            
 »neues gitlab-ce-Skript des Paketes pre-installation«-Unterprozess gab den Fehlerwert 1 zurück                                                                                                         
Fehler traten auf beim Bearbeiten von:                                                                                                                                                                  
 /var/cache/apt/archives/gitlab-ce_18.1.2-ce.0_amd64.deb                                            
E: Sub-process /usr/bin/dpkg returned an error code (1)                                                                                                                                                 

The error message says to run gitlab-ctl reconfigure, but that runs into the same error that originally triggered all this. This aspect of the upgrade/downgrade process seems… suboptimal.

After I recovered the JSON file from our backups, I was able to get our instance running again after downgrading it to 18.1.2-ce.0.

1 Like