Failed to update Gitlab commit status for project '120': HTTP 403 Forbidden
Asked Answered
E

7

8

In jenkins I'm seeing the following error message in the jenkins console while building any of our projects that are integrated with Gitlab.

Failed to update Gitlab commit status for project '120': HTTP 403 Forbidden

Would any of you guys happen to know what can be done to resolve this problem? Or where should I start to check for a solution.

Exsert answered 22/3, 2018 at 4:32 Comment(1)
I think the issue is related to the permission. Have you added ssh keys? or user has the access to the repo? Follow this link : docs.bitnami.com/1and1/how-to/create-ci-pipelinePaperweight
E
4

Thanks guys! Your responses helped me to locate my problem. I was able to fix the problem by changing the global configuration for Gitlab credentials.

I went to Jenkins > Manage Jenkins > Configure System

And under Gitlab credentials I added the correct user with valid privileges

Thanks again.

Exsert answered 23/3, 2018 at 1:42 Comment(0)
A
3

Forbidden 403

There is a lot of things that can go wrong

Firstly, recheck if the CI/CD trigger is enabled in your repository

General > Visibility, project features, permissions > Repository - CI/CD 

The second thing you need to check is if the user and API access key have a Maintainer role

After those steps hope you will solve your problem

Appendicle answered 17/9, 2021 at 10:59 Comment(0)
B
3

After following the advice in earlier posts (all good as far as I could see) I found that the problem I had was solved by removing and re-adding the credential in Jenkins > Manage Jenkins > Configure System And under Gitlab credentials
It looks like the token timed out in gitlab and I renewed it on gitlab and updated jenkins credential but jenkins gitlab plugin needed to be refreshed in jenkins as it seems to have been cached (maybe)

Broadbill answered 24/7 at 14:3 Comment(0)
B
2

apart from settings in jenkins side (under Configure System > Gitlab), be sure that user has at least Maintainer rights in the repository

Bulla answered 15/12, 2022 at 17:32 Comment(0)
B
0

You have a similar error reported in JENKINS-42535.

It includes:

Actually after some testing in another project which does more than just build steps, it seems that we should call the checkout(scm) before doing any gitlab action so that it is configured to the correct repository.

Bartolommeo answered 22/3, 2018 at 5:37 Comment(0)
C
0

403 Forbidden

, means your client side requests are forbidden and not authorised for valid responses. Check the SSL keys/ user credentials configuration for accessing Gitlab.
If you are working under a restricted network(which most organisation operates under), use a mirror proxy. Consult the local IT/DevOps team for accessing these resources.

Catchpenny answered 22/3, 2018 at 5:39 Comment(0)
H
0

One of the causes for this error might be because the branch is protected and no one is allowed to merge it.

You can find this settings in Settings > Repository > Protected branches.

Find your branch, and then change "Allow to merge" from "No one" to a group that your jenkins user is part of (usually it's maintainers).

Hake answered 15/4 at 15:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.