CI_MERGE_REQUEST_REF_PATH points to non-existing reference (issue multiproject pipeline: fetch artifacts from merge request parent)

Hi,
We have a multiproject pipeline setup where child pipeline fetches artifacts from an upstream merge request pipeline. Ref to child pipeline is passed using CI_MERGE_REQUEST_REF_PATH variable. We simply use this method: Downstream pipelines | GitLab For a while everything worked fine until about month or two ago.

We are using self-hosted gitalb and now we are facing issue, where parent job is unable to find a upstream job from which it is suppose to get artifacts. I missed the moment when the problem started occurring, currently we are using 16.4.x version.

I made some investigation and I found that CI_MERGE_REQUEST_REF_PATH variable always has pattern: refs/merge_request//head
Where actual ref from upstream job sometimes has this structure: refs/merge_request//merge
Which mean that ref pointed by CI_MERGE_REQUEST_REF_PATH variable do not exist.


MicrosoftTeams-image (1)

I am not sure if it is some misconfiguration or this is a new issue in gitlab. I don’t see any changes regarding this functionality in manual.
The guide says to check forum first before reporting a bug, so here I am.

Also, someone else has a similar issue:

Thanks,
P

Is you parent pipeline normal Merge Request pipeline or by any chance someone switched it to Merge Result pipeline?

2 Likes

Yes, the checkbox was selected.
Settings β†’ Merge Request β†’ Merge Options β†’ Enabled merged results pipelines. (should not be checked)

Most likely someone marked it by mistake, instead of enabling Merge checks Pipeline must succeed option.

After I disable it, a child pipelines finally is able to download artifacts from parent job.
Thanks a lot, I would never find it on myself :slight_smile:

1 Like