Gitlab Merge request status not updated

Hi guys, could someone help me…

I’m trying to connect drone with our gitlab.
When I make a merge-request, drone get it and launch the pipeline fine… But It can’t update pipeline status on gitlab…

In my logs I have this always this error…

{"commit":"<my commit sha>","error":"404 References for commit Not Found","event":"pull_request","level":"warning","msg":"trigger: cannot create status","ref":"refs/merge-requests/651/head","repo":"<my repo>","time":"2019-10-01T10:51:30Z"}
{"build.id":5,"build.number":5,"error":"404 References for commit Not Found","level":"warning","msg":"manager: cannot publish status","repo.id":85,"stage.id":5,"time":"2019-10-01T10:51:31Z"}
{"build.id":5,"build.number":5,"error":"404 References for commit Not Found","level":"warning","msg":"manager: cannot publish status","repo.id":85,"stage.id":5,"time":"2019-10-01T10:51:51Z"}

Do you have any idea of what’s going wrong?!

I recommend looking at your gitlab server logs to understand why the commit is not found in gitlab. If the commit is not found in gitlab, why did gitlab send the commit sha to Drone in the first place?

Problem, I use the hosted gits service…
As far as I know, I therefore do not have access to the integration log…

After investigation…
I have this error only when I have a merge request from a fork…

Do I have to do something special to make update status action works with forks??!..

{"fields.time":"2019-10-01T15:58:20Z","latency":218772,"level":"debug","method":"POST","msg":"","remote":"35.231.224.133:50087","request":"/api/hook?owner=[...]","request-id":"<id>","time":"2019-10-01T15:58:20Z"}
{"commit":"<commit sha>","error":"404 References for commit Not Found","event":"pull_request","level":"warning","msg":"trigger: cannot create status","ref":"refs/merge-requests/659/head","repo":"yoomap-project/styleguide","time":"2019-10-01T15:58:21Z"}

Thanks for your help

Hello,

After more investigation. It’s clearly a wong Gitlab API Call …

On a merge request between forked and main repository. Drone always try to update destitation repository status commit.

But in gitlab it’s the source repository you need to update…