Hi all,
I’m trying to integrate Jenkins with a self-hosted GitLab Community Edition instance and the GitLab Branch Source Plugin.
Environment:
-
GitLab CE version: [your version]
-
Jenkins version: 2.516.1
-
GitLab Branch Source Plugin: [your version]
What I did:
-
Created a Personal Access Token with all available scopes (
api,read_api,read_repository,write_repository). -
Also tested with a full Admin user (instance-wide admin, not just group Owner).
-
Verified the token works with curl, for example:
curl -H "PRIVATE-TOKEN:xxxxx" https://gitlab.example.com/api/v4/groups/kubernetes→ returns the expected JSON.
Problem:
When Jenkins scans the GitLab group with the organization folder job, it fails with:
org.gitlab4j.api.GitLabApiException: 403 Forbidden - Not authorized to access /api/v4/users
Caused: java.lang.IllegalStateException: Unable to fetch