Seeing Waiting for GitLab to boot HTTP 502 message

I have upgrade gitlab to 16.7.7. And again try to upgrade to 17.2.0 version. While upgrading there was error come that “There was an error running gitlab-ctl reconfigure. database_objects[prostgresql] (postgresql : : standlone line 32) had an errror: RuntimeError.”

I had checked postgresql log /var/log/gitlab/postgresql/current as below.
FATAL: database files are incompatible with server
2024-07-30_08:04:26.36683 DETAIL: The data directory was initialized by PostgreSQL version 13, which is not compatible with this version 14.11.
2024-07-30_08:04:27.37194 FATAL: database files are incompatible with server
2024-07-30_08:04:27.37196 DETAIL: The data directory was initialized by PostgreSQL version 13, which is not compatible with this version 14.11.
2024-07-30_08:04:28.37700 FATAL: database files are incompatible with server
2024-07-30_08:04:28.37860 DETAIL: The data directory was initialized by PostgreSQL version 13, which is not compatible with this version 14.11.
2024-07-30_08:04:29.38223 FATAL: database files are incompatible with server.

so please help me to resolve this issue.

You need to make sure to upgrade to Postgres 14 before doing the upgrade. It’s very important to always read the changelog before attempting an upgrade, see here:

" * Prior to upgrading, you must ensure your installation is using PostgreSQL 14."