While Gitlab merge Your merge request is almost ready! and keep on loading

While merging the code from one branch to another is not allowed. I am showing the below message.

Your merge request is almost ready!

I got the same issue after upgrade from gitlab-ce version 16.6.0 to 16.7.2.
I did the upgrade due to I got a notification to upgrade for security patch.

Jiamin, For me, the issue was resolved by upgrading to 16.7.0. 16.7.2 gitlab container is crashing.

The same issue still exists even I downgrade to 16.6.0.

I checked the mr status in DB. The mr is in ‘preparing’ status, but I don’t know what’s going on and how to solve it.

# gitlab-rails dbconsole

gitlabhq_production=> select id, iid as merge_id, source_branch, target_branch, merge_error, merge_commit_sha, in_progress_merge_commit_sha, merge_status from merge_requests where merge_status='preparing' order by id desc;
 id | merge_id |         source_branch         | target_branch | merge_error | merge_commit_sha | in_progress_merge_commit_sha | merge_status
----+----------+-------------------------------+---------------+-------------+------------------+------------------------------+--------------
 26 |        3 | 001                           | main          |             |                  |                              | preparing
 25 |        2 | 001                           | main          |             |                  |                              | preparing
 24 |        1 | 001                           | main          |             |                  |                              | preparing

Not quite sure what make it works, but this is what I did and it seems work!:

  • Run gitlab-ctl reconfigure
  • Run gitlab-rake gitlab:check
  • Stop all services, wait for a while for all gitlab services to be shutdown
  • Restart runsv by systemctl start gitlab-runsvdir.service
  • Restart gitlab services gitlab-ctl start

Same issue here.

Upgraded from docker, ce 16.6.2 to 16.6.4.

since then all merge request hang at “Your merge request is almost ready!”

Upgrading from 16.6.4 to 16.6.5 did not help.

gitlab-ctl reconfigure did not help.

gitlab-rake gitlab:check shows no issues.

restarrting services did not help.

Has anyone have some Ideas what to do ?

Thanks for reply, but it does not solve my problem.

  • in some cases, close and reopen the mr may fix the problem
  • in some cases, gitlab-ctl reconfigure may fix the problem
  • in some cases, upgrade may fix the problem

I finally solved the problem.

  • I first upgrade from 16.6.0 to 16.6.5, not work
  • Then upgrade from 16.6.5 to 16.7.0. Close ‘pending’ MR then reopen it. Done!

I tried almost all integrity check on Integrity check Rake task | GitLab, I found the only error I got is:

# gitlab-rake gitlab:doctor:secrets
...
WARNING: Active Record does not support composite primary key.

ci_pipeline_variables has composite primary key. Composite primary key is ignored.
rake aborted!
ActiveRecord::StatementInvalid: PG::SyntaxError: ERROR:  zero-length delimited identifier at or near """"
LINE 1: ...eline_variables" ORDER BY "ci_pipeline_variables"."" ASC LIM...

I don’t know how to fix it, it looks like related with PostgreSQL. I tried following but not work for me.

# gitlab-rake db:migrate
main: == [advisory_lock_connection] object_id: 118800, pg_backend_pid: 1552268
main: == [advisory_lock_connection] object_id: 118800, pg_backend_pid: 1552268

# gitlab-ctl reconfigure
...
[2024-01-16T10:00:00+08:00] INFO: Report handlers complete
Infra Phase complete, 2/810 resources updated in 18 seconds
gitlab Reconfigured!

After upgrade from 16.6.5 to 16.7.0, the problem gone. That’s all.

same here, after updating 16.6.4 > 16.6.5 >16.7.0. > 16.7.3 everything seems to be fine now

Hey guys did you find any resolution on that issue?