Upgrade Gitlab version 16.11.5 -> 17.x.x

Problem to solve

I am currently running a self managed gitlab-ce:16.11.5-ce.0 via docker and have made several attempts to upgrade to v17.0.0, v17.0.1, v17.0.2, v17.1.0, all fail.

I use the follow to start the container:

BASE_DIR=/mnt/gitlab BACKUPDIR=$BASE_DIR/backups \
   docker run -d \
        --memory="16G" \
        --restart=always \
        --name gitlab \
        -v "${BASE_DIR}/config:/etc/gitlab" \
        -v "${BASE_DIR}/log:/var/log/gitlab" \
        -v "${BASE_DIR}/data:/var/opt/gitlab" \
        -v "${BASE_DIR}/registry:/var/opt/registry" \
        -v "${BACKUP_DIR}:/var/opt/gitlab/backups" \
        -p $ip:2022:22 \
        -p $ip:80:80 \
        -p $ip:443:443 \
        -p $ip:5005:5005 \
        gitlab/gitlab-ce:16.11.5-ce.0

When starting with one of the v17 images, it crashes and restarts continuously.

My guess is that this is related to the errors I see in the postgresql/current log:

2024-06-27_19:17:18.61742 FATAL:  database files are incompatible with server
2024-06-27_19:17:18.61753 DETAIL:  The data directory was initialized by PostgreSQL version 13, which is not compatible with this version 14.11.
2024-06-27_19:17:19.61886 FATAL:  database files are incompatible with server
2024-06-27_19:17:19.61887 DETAIL:  The data directory was initialized by PostgreSQL version 13, which is not compatible with this version 14.11.

I’ve been running this gitlab server and upgrading since about 2019, and have only ever needed to start the container with the new image, it has been awesome. Did I miss a step this time? I did some searching for documentation about this, but haven’t been able to find anything. I also haven’t been able to find messages indicating others have experienced this problem.

Any ideas?

Versions

Please select whether options apply, and add the version information.

Versions
gitlab-ce:16.11.5-ce.0
gitlab-ce:17.0.0-ce.0

1 Like

Having the same issue here :frowning_face:

1 Like

Just try this solution
https://centerionware.com/Posts/Gitlab/2024-upgrade-16.10-17/

1 Like

I had same problems,Did you had resolve this issue, can you share ,thanks

I tried running pg-upgrade like a previous post suggested. This fails, but I haven’t found the logs yet to determine why it fails. I’ll be looking at this issue more after Aug 15.

Anyone manage to fix the issues?

I have not been successful yet. My current plan which I have yet to do, is to set up another instance of GitLab running the latest version, and migrate the projects to it, once I’m satisfied all data has been transferred, I’ll shut down the old version. I’m not excited about this approach, but not sure what else to do at this point.

Note that I have no experience with running GitLab in docker, so I have no idea how that works (although reading this gives me an idea).

I would also think a gitlab-ctl pg-upgrade (like that link does) could fix it or at least say something about what is wrong. It seems you’ve tried that, but you’ve only said it fails, not what it says. If you’re not busy with the migration approach, could you try to share that?

Nope, pg-upgrde didn’t help. Its major on Gitaly. Its i failing to create link file under gitaly/run/ which more into gitaly issues. Looks there is major changes in Gitaly when upgrading from 16–>17 version. May have to read throughly to understand the issue