-
Bug
-
Resolution: Not A Defect
-
Critical
-
None
-
Docker image jenkins/jenkins:2.452.1-lts
Scan GitLab Group is failing with the following exception for every project:
Checking project my/project/path Cannot set web hook: Forbidden Proposing my/project/path ERROR: Failed to create or update a subproject my/project/path java.lang.NullPointerException: Cannot invoke "java.lang.Boolean.booleanValue()" because the return value of "org.gitlab4j.api.models.Project.getMergeRequestsEnabled()" is null at io.jenkins.plugins.gitlabbranchsource.GitLabSCMSource.retrieve(GitLabSCMSource.java:336) at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:372) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:326) at jenkins.branch.MultiBranchProjectFactory$BySCMSourceCriteria.recognizes(MultiBranchProjectFactory.java:262) at jenkins.branch.OrganizationFolder$SCMSourceObserverImpl$1.recognizes(OrganizationFolder.java:1356) at jenkins.branch.OrganizationFolder$SCMSourceObserverImpl$1.complete(OrganizationFolder.java:1371) at jenkins.scm.api.trait.SCMNavigatorRequest.process(SCMNavigatorRequest.java:252) at jenkins.scm.api.trait.SCMNavigatorRequest.process(SCMNavigatorRequest.java:202) at io.jenkins.plugins.gitlabbranchsource.GitLabSCMNavigator.visitSources(GitLabSCMNavigator.java:309) at jenkins.branch.OrganizationFolder.computeChildren(OrganizationFolder.java:530) at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:269) at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:167) at jenkins.branch.OrganizationFolder$OrganizationScan.run(OrganizationFolder.java:915) at hudson.model.ResourceController.execute(ResourceController.java:101) at hudson.model.Executor.run(Executor.java:442)
This error started after I upgraded both Jenkins server to bersion `2.452.1-lts` and Gitlab plugins to the latest versions.
This issue is very similar to JENKINS-71955 but in my case I do have a valid API token.
I investigated the source file and managed to get my projects to work by disabling merge request dicovery on the configurations.
Now I'm trying to get MRs to work again since they are necessary for my workflow.
At first I though there was some change on Gitlab API that was not returning the mergeRequestEnabled anumore. But running the Groovy script below returned `true`.
groovy.grape.Grape.grab(group: 'org.gitlab4j', module: 'gitlab4j-api', version: '5.3.0') import org.gitlab4j.api.*; def url = 'https://gitlab.com' def token = 'myToken' GitLabApi gitLabApi = new GitLabApi(url, token) def projectApi = gitLabApi.getProjectApi() projectApi.getProject('my/project/path').getMergeRequestsEnabled()
At this point I'm trying to setup a local environment so I can try to reproduce the issue on a clean install and maybe debug the code itself.