jenkinsci / gitlab-branch-source-plugin

A Jenkins Plugin for GitLab Multibranch Pipeline jobs and Folder Organization
https://plugins.jenkins.io/gitlab-branch-source
MIT License
124 stars 94 forks source link

Errors when trying to use a remote Jenkinsfile #151

Open Evyatar-WM opened 3 years ago

Evyatar-WM commented 3 years ago
Jenkins: 2.277.2
OS: Linux - 5.4.0-1045-aws
---
popper2-api:2.5.4-2
gradle:1.36
cloudbees-folder:6.15
ws-cleanup:0.39
durable-task:1.37
plain-credentials:1.7
pipeline-stage-view:2.19
ec2-fleet:2.3.2
github:1.33.1
ant:1.11
bouncycastle-api:2.20
workflow-job:2.41
pipeline-model-api:1.8.5
workflow-step-api:2.23
timestamper:1.13
workflow-aggregator:2.6
ldap:2.7
pipeline-model-extensions:1.8.5
okhttp-api:3.14.9
pipeline-stage-tags-metadata:1.8.5
plugin-util-api:2.3.0
echarts-api:5.1.2-2
workflow-multibranch:2.24
aws-java-sdk:1.11.995
apache-httpcomponents-client-4-api:4.5.13-1.0
ssh-credentials:1.18.1
matrix-project:1.18
ssh-slaves:1.31.5
bootstrap4-api:4.6.0-3
variant:1.4
lockable-resources:2.11
workflow-support:3.8
branch-api:2.6.4
display-url-api:2.3.5
popper-api:1.16.1-2
pam-auth:1.6
momentjs:1.1.1
ace-editor:1.1
workflow-durable-task-step:2.39
workflow-cps-global-lib:2.21
pipeline-stage-step:2.5
token-macro:2.15
git-client:3.7.2
git-server:1.9
jsch:0.1.55.2
checks-api:1.7.0
structs:1.23
caffeine-api:2.9.1-23.v51c4e2c879c8
pipeline-rest-api:2.19
git:4.7.2
matrix-auth:2.6.7
build-timeout:1.20
handlebars:3.0.8
antisamy-markup-formatter:2.1
jdk-tool:1.5
workflow-scm-step:2.13
pipeline-milestone-step:1.3.2
github-branch-source:2.10.2
snakeyaml-api:1.29.1
pipeline-build-step:2.13
pipeline-input-step:2.12
trilead-api:1.0.13
font-awesome-api:5.15.3-3
workflow-api:2.46
jackson2-api:2.12.3
github-api:1.123
script-security:1.77
jquery3-api:3.6.0-1
mailer:1.34
pipeline-github-lib:1.0
scm-api:2.6.4
pipeline-model-definition:1.8.5
junit:1.50
bootstrap5-api:5.0.1-2
email-ext:2.83
aws-credentials:1.29
pipeline-graph-analysis:1.11
jjwt-api:0.11.2-9.c8b45b8bb173
workflow-basic-steps:2.23
credentials-binding:1.26
resource-disposer:0.16
command-launcher:1.6
credentials:2.5
workflow-cps:2.92
ansicolor:1.0.0
config-file-provider:3.8.0
ivy:2.1
javadoc:1.6
maven-plugin:3.12
artifactory:3.11.4
authentication-tokens:1.4
handy-uri-templates-2-api:2.1.8-1.0
cloudbees-bitbucket-branch-source:2.9.9
blueocean-commons:1.24.7
blueocean-rest:1.24.7
pubsub-light:1.16
blueocean-pipeline-scm-api:1.24.7
htmlpublisher:1.25
jenkins-design-language:1.24.7
blueocean-core-js:1.24.7
blueocean-web:1.24.7
blueocean-jwt:1.24.7
favorite:2.3.3
blueocean-rest-impl:1.24.7
blueocean-pipeline-api-impl:1.24.7
blueocean-bitbucket-pipeline:1.24.7
blueocean-github-pipeline:1.24.7
blueocean-git-pipeline:1.24.7
blueocean-config:1.24.7
blueocean-dashboard:1.24.7
blueocean-personalization:1.24.7
blueocean-display-url:2.4.1
sse-gateway:1.24
blueocean-events:1.24.7
blueocean-pipeline-editor:1.24.7
blueocean-i18n:1.24.7
blueocean-autofavorite:1.2.4
blueocean:1.24.7
configuration-as-code:1.51
configuration-as-code-groovy:1.1
content-replace:1.6.0
dashboard-view:2.17
docker-commons:1.17
docker-workflow:1.26
jquery:1.12.4-1
extended-choice-parameter:0.82
file-operations:1.11
generic-webhook-trigger:1.74
git-parameter:0.9.13
http_request:1.9.0
nodejs:1.4.0
nunit:0.27
run-condition:1.5
conditional-buildstep:1.4.1
parameterized-trigger:2.41
pipeline-npm:0.9.2
pipeline-utility-steps:2.8.0
publish-over:0.22
publish-over-ssh:1.22
rebuild:1.32
role-strategy:3.1.1
copyartifact:1.46.1
s3:0.11.7
slack:2.48
ssh-agent:1.22
ssh:2.6.1
theme-manager:0.6
material-theme:0.3.3
simple-theme-plugin:0.6
gitlab-plugin:1.5.20
gitlab-api:1.0.6
gitlab-branch-source:1.5.7
remote-file:1.17
atlassian-bitbucket-server-integration:2.1.3
mercurial:2.15
bitbucket:1.1.29
stashNotifier:1.20
Controller: Ubuntu , Agents: Centos

Reproduction steps

Results

Expected result:

Should Run the Job and print the files list.

Actual result:

Job fails with multiple errors:

java.lang.ClassCastException: Cannot cast org.glassfish.jersey.inject.hk2.Hk2InjectionManagerFactory to org.glassfish.jersey.internal.inject.InjectionManagerFactory
    at java.lang.Class.cast(Class.java:3369)
    at org.glassfish.jersey.internal.ServiceFinder$LazyObjectIterator.hasNext(ServiceFinder.java:690)
    at org.glassfish.jersey.internal.inject.Injections.lookupService(Injections.java:88)
    at org.glassfish.jersey.internal.inject.Injections.lookupInjectionManagerFactory(Injections.java:73)
    at org.glassfish.jersey.internal.inject.Injections.createInjectionManager(Injections.java:44)
    at org.glassfish.jersey.client.ClientConfig$State.initRuntime(ClientConfig.java:412)
    at org.glassfish.jersey.internal.util.collection.Values$LazyValueImpl.get(Values.java:317)
    at org.glassfish.jersey.client.ClientConfig.getRuntime(ClientConfig.java:807)
    at org.glassfish.jersey.client.ClientRequest.getClientRuntime(ClientRequest.java:219)
    at org.glassfish.jersey.client.ClientRequest.getInjectionManager(ClientRequest.java:610)
    at org.glassfish.jersey.client.JerseyWebTarget.onBuilder(JerseyWebTarget.java:364)
    at org.glassfish.jersey.client.JerseyWebTarget.request(JerseyWebTarget.java:192)
    at org.glassfish.jersey.client.JerseyWebTarget.request(JerseyWebTarget.java:36)
    at org.gitlab4j.api.GitLabApiClient.invocation(GitLabApiClient.java:783)
    at org.gitlab4j.api.GitLabApiClient.invocation(GitLabApiClient.java:748)
    at org.gitlab4j.api.GitLabApiClient.get(GitLabApiClient.java:399)
    at org.gitlab4j.api.GitLabApiClient.get(GitLabApiClient.java:387)
    at org.gitlab4j.api.AbstractApi.get(AbstractApi.java:213)
Caused: org.gitlab4j.api.GitLabApiException: Cannot cast org.glassfish.jersey.inject.hk2.Hk2InjectionManagerFactory to org.glassfish.jersey.internal.inject.InjectionManagerFactory
    at org.gitlab4j.api.AbstractApi.handle(AbstractApi.java:655)
    at org.gitlab4j.api.AbstractApi.get(AbstractApi.java:215)
    at org.gitlab4j.api.RepositoryApi.getBranch(RepositoryApi.java:104)
    at io.jenkins.plugins.gitlabbranchsource.GitLabSCMSource.retrieve(GitLabSCMSource.java:258)
    at jenkins.scm.api.SCMSource.fetch(SCMSource.java:582)
    at org.jenkinsci.plugins.workflow.multibranch.SCMVar.getValue(SCMVar.java:101)
    at org.jenkinsci.plugins.workflow.multibranch.SCMVar.getValue(SCMVar.java:58)
    at org.jenkinsci.plugins.workflow.cps.CpsScript.getProperty(CpsScript.java:135)
    at sun.reflect.GeneratedMethodAccessor1607.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:57)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
    at org.jenkinsci.plugins.pipeline.modeldefinition.Utils.getScriptPropOrParam(Utils.groovy:112)
    at org.jenkinsci.plugins.pipeline.modeldefinition.Utils$getScriptPropOrParam$17.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
    at org.jenkinsci.plugins.pipeline.modeldefinition.Utils$getScriptPropOrParam$17.call(Unknown Source)
    at org.jenkinsci.plugins.pipeline.modeldefinition.model.Environment$EnvironmentResolver.getScriptPropOrParam(Environment.groovy:133)
    at sun.reflect.GeneratedMethodAccessor1787.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
    at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:163)
    at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:23)
    at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:158)
    at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:161)
    at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:165)
    at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:130)
    at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:135)
    at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17)
Caused: java.io.IOException: Failed to retrieve the SCM revision for develop
    at io.jenkins.plugins.gitlabbranchsource.GitLabSCMSource.retrieve(GitLabSCMSource.java:298)
    at jenkins.scm.api.SCMSource.fetch(SCMSource.java:582)
    at org.jenkinsci.plugins.workflow.multibranch.SCMVar.getValue(SCMVar.java:101)
    at org.jenkinsci.plugins.workflow.multibranch.SCMVar.getValue(SCMVar.java:58)
    at org.jenkinsci.plugins.workflow.cps.CpsScript.getProperty(CpsScript.java:135)
    at sun.reflect.GeneratedMethodAccessor1607.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:57)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
    at org.jenkinsci.plugins.pipeline.modeldefinition.Utils.getScriptPropOrParam(Utils.groovy:112)
    at org.jenkinsci.plugins.pipeline.modeldefinition.Utils$getScriptPropOrParam$17.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
    at org.jenkinsci.plugins.pipeline.modeldefinition.Utils$getScriptPropOrParam$17.call(Unknown Source)
    at org.jenkinsci.plugins.pipeline.modeldefinition.model.Environment$EnvironmentResolver.getScriptPropOrParam(Environment.groovy:133)
    at sun.reflect.GeneratedMethodAccessor1787.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
    at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:163)
    at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:23)
    at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:158)
    at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:161)
    at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:165)
    at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:130)
    at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:135)
    at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17)
    at WorkflowScript.run(WorkflowScript)
    at WorkflowScript.run(WorkflowScript)
    at WorkflowScript.run(WorkflowScript)
    at WorkflowScript.run(WorkflowScript)
    at WorkflowScript.run(WorkflowScript)
    at WorkflowScript.run(WorkflowScript)
    at WorkflowScript.run(WorkflowScript)
    at WorkflowScript.run(WorkflowScript)
    at WorkflowScript.run(WorkflowScript)
    at WorkflowScript.run(WorkflowScript)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.withEnvBlock(ModelInterpreter.groovy:431)
    at com.cloudbees.groovy.cps.CpsDefaultGroovyMethods.callClosureForMapEntry(CpsDefaultGroovyMethods:5226)
    at com.cloudbees.groovy.cps.CpsDefaultGroovyMethods.collect(CpsDefaultGroovyMethods:3446)
    at com.cloudbees.groovy.cps.CpsDefaultGroovyMethods.collect(CpsDefaultGroovyMethods:3463)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.withEnvBlock(ModelInterpreter.groovy:429)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.call(ModelInterpreter.groovy:78)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.withCredentialsBlock(ModelInterpreter.groovy:476)
    at ___cps.transform___(Native Method)
    at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:86)
    at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:113)
    at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:83)
    at sun.reflect.GeneratedMethodAccessor1342.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
    at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
    at com.cloudbees.groovy.cps.Next.step(Next.java:83)
    at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174)
    at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)
    at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:129)
    at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:268)
    at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)
    at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
    at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:51)
    at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:185)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:400)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$400(CpsThreadGroup.java:96)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:312)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:276)
    at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:67)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139)
    at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
    at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

FYI , When I use the Jenkinsfile not remotely It works fine.

alexjfisher commented 3 years ago

I think I'm hitting this too. @Evyatar-WM did you manage to fix this, or find any workaround?

b1czu commented 3 years ago

Same problem for me when using pipeline-multibranch-defaults-plugin to provide external Jenkinsfile. @Evyatar-WM, @alexjfisher did you maybe manage to fix this, or find any workaround?

EDIT: I've just discovered that when using gitlab-branch-source:1.4.6 and gitlab-api:1.0.6 loading external Jenkinsfile works as expected. It is broken starting from gitlab-branch-source version 1.5.0.

EDIT2: On version 1.4.6 it also throws this exception (Cannot cast org.glassfish.jersey.inject.hk2.Hk2InjectionManagerFactory to org.glassfish.jersey.internal.inject.InjectionManagerFactory) in Jenkins' logs during checkout scm step but pipeline completes without problem. I think that this behavior is related to this commit https://github.com/jenkinsci/gitlab-branch-source-plugin/commit/e2de9aaea783a64ebe00a781f828661e3344f80a.

teodor20 commented 2 years ago

I am also getting the same issue. Has anyone found a workaround?

teodor20 commented 2 years ago

@b1czu @alexjfisher

I think the issue is caused by clashing Jersey dependencies. Check if you have the "Artifactory" plugin installed and remove it if not needed, this fixed it for me. Unfortunately, I do not have a solution in the case where you need the "Artifactory" plugin or any other plugin that is using a Jersey version bigger than 2.26

alexjfisher commented 2 years ago

I do have the artifactory plugin installed (and I can't remove it!). Still don't understand the conflict though as both plugins seem to use the same version of jersey.

bash-4.2$ find . -name '*jersey*.jar'
./artifactory/WEB-INF/lib/jersey-apache-connector-2.30.1.jar
./artifactory/WEB-INF/lib/jersey-client-2.30.1.jar
./artifactory/WEB-INF/lib/jersey-common-2.30.1.jar
./artifactory/WEB-INF/lib/jersey-hk2-2.30.1.jar
./artifactory/WEB-INF/lib/docker-java-transport-jersey-3.2.12.jar
./gitlab-api/WEB-INF/lib/jersey-hk2-2.30.1.jar
./gitlab-api/WEB-INF/lib/jersey-common-2.30.1.jar
./gitlab-api/WEB-INF/lib/jersey-client-2.30.1.jar
./gitlab-api/WEB-INF/lib/jersey-media-multipart-2.30.1.jar
./gitlab-api/WEB-INF/lib/jersey-apache-connector-2.30.1.jar
readonlyuser1 commented 2 years ago

checkout scm >

Running on [narqubegroup-test-sonarqubegroup-test-2ftestpommvn2-dev-1-9q2dz](https://jenkins/computer/narqubegroup-test-sonarqubegroup-test-2ftestpommvn2-dev-1-9q2dz/)[](https://jenkins/job/test-Sonarqube-test/job/SonarqubeGroup-test%252FtestPomMvn2/job/dev/1/console#) in /home/jenkins/agent/workspace/arqubeGroup-test_testPomMvn2_dev
[Pipeline] {
Querying the current revision of branch dev...
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // podTemplate
[Pipeline] End of Pipeline
java.lang.ClassCastException: Cannot cast org.glassfish.jersey.inject.hk2.Hk2InjectionManagerFactory to org.glassfish.jersey.internal.inject.InjectionManagerFactory
    at java.base/java.lang.Class.cast(Class.java:3605)
    at org.glassfish.jersey.internal.ServiceFinder$LazyObjectIterator.hasNext(ServiceFinder.java:690)
    at org.glassfish.jersey.internal.inject.Injections.lookupService(Injections.java:88)
    at org.glassfish.jersey.internal.inject.Injections.lookupInjectionManagerFactory(Injections.java:73)
    at org.glassfish.jersey.internal.inject.Injections.createInjectionManager(Injections.java:44)
    at org.glassfish.jersey.client.ClientConfig$State.initRuntime(ClientConfig.java:412)
    at org.glassfish.jersey.internal.util.collection.Values$LazyValueImpl.get(Values.java:317)
    at org.glassfish.jersey.client.ClientConfig.getRuntime(ClientConfig.java:807)
    at org.glassfish.jersey.client.ClientRequest.getClientRuntime(ClientRequest.java:219)
    at org.glassfish.jersey.client.ClientRequest.getInjectionManager(ClientRequest.java:610)
    at org.glassfish.jersey.client.JerseyWebTarget.onBuilder(JerseyWebTarget.java:364)
    at org.glassfish.jersey.client.JerseyWebTarget.request(JerseyWebTarget.java:192)
    at org.glassfish.jersey.client.JerseyWebTarget.request(JerseyWebTarget.java:36)
    at org.gitlab4j.api.GitLabApiClient.invocation(GitLabApiClient.java:783)
    at org.gitlab4j.api.GitLabApiClient.invocation(GitLabApiClient.java:748)
    at org.gitlab4j.api.GitLabApiClient.get(GitLabApiClient.java:399)
    at org.gitlab4j.api.GitLabApiClient.get(GitLabApiClient.java:387)
    at org.gitlab4j.api.AbstractApi.get(AbstractApi.java:213)
Caused: org.gitlab4j.api.GitLabApiException: Cannot cast org.glassfish.jersey.inject.hk2.Hk2InjectionManagerFactory to org.glassfish.jersey.internal.inject.InjectionManagerFactory
    at org.gitlab4j.api.AbstractApi.handle(AbstractApi.java:655)
    at org.gitlab4j.api.AbstractApi.get(AbstractApi.java:215)
    at org.gitlab4j.api.RepositoryApi.getBranch(RepositoryApi.java:104)
    at io.jenkins.plugins.gitlabbranchsource.GitLabSCMSource.retrieve(GitLabSCMSource.java:258)
    at jenkins.scm.api.SCMSource.fetch(SCMSource.java:582)
    at org.jenkinsci.plugins.workflow.multibranch.SCMVar.getValue(SCMVar.java:104)
    at org.jenkinsci.plugins.workflow.multibranch.SCMVar.getValue(SCMVar.java:59)
    at org.jenkinsci.plugins.workflow.cps.CpsScript.getProperty(CpsScript.java:135)
    at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:174)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getProperty(ScriptBytecodeAdapter.java:456)
    at org.kohsuke.groovy.sandbox.impl.Checker$7.call(Checker.java:355)
    at org.kohsuke.groovy.sandbox.GroovyInterceptor.onGetProperty(GroovyInterceptor.java:68)
    at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onGetProperty(SandboxInterceptor.java:355)
    at org.kohsuke.groovy.sandbox.impl.Checker$7.call(Checker.java:353)
    at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:357)
    at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:333)
    at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:333)
    at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.getProperty(SandboxInvoker.java:29)
    at com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:20)
Caused: java.io.IOException: Failed to retrieve the SCM revision for dev
    at io.jenkins.plugins.gitlabbranchsource.GitLabSCMSource.retrieve(GitLabSCMSource.java:298)
    at jenkins.scm.api.SCMSource.fetch(SCMSource.java:582)
    at org.jenkinsci.plugins.workflow.multibranch.SCMVar.getValue(SCMVar.java:104)
    at org.jenkinsci.plugins.workflow.multibranch.SCMVar.getValue(SCMVar.java:59)
    at org.jenkinsci.plugins.workflow.cps.CpsScript.getProperty(CpsScript.java:135)
    at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:174)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getProperty(ScriptBytecodeAdapter.java:456)
    at org.kohsuke.groovy.sandbox.impl.Checker$7.call(Checker.java:355)
    at org.kohsuke.groovy.sandbox.GroovyInterceptor.onGetProperty(GroovyInterceptor.java:68)
    at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onGetProperty(SandboxInterceptor.java:355)
    at org.kohsuke.groovy.sandbox.impl.Checker$7.call(Checker.java:353)
    at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:357)
    at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:333)
    at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:333)
    at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.getProperty(SandboxInvoker.java:29)
    at com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:20)
    at WorkflowScript.run(WorkflowScript:52)
    at ___cps.transform___(Native Method)
    at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.get(PropertyishBlock.java:74)
    at com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30)
    at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.fixName(PropertyishBlock.java:66)
    at jdk.internal.reflect.GeneratedMethodAccessor461.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
    at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
    at com.cloudbees.groovy.cps.Next.step(Next.java:83)
    at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174)
    at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)
    at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:129)
    at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:268)
    at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)
    at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
    at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:51)
    at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:185)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:402)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$400(CpsThreadGroup.java:96)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:314)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:278)
    at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:67)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139)
    at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
    at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:829)
Finished: FAILURE
seanly commented 2 years ago

my error logs:

checkout scm

java.lang.ClassCastException: class org.glassfish.jersey.jaxb.internal.JaxbAutoDiscoverable cannot be cast to class org.glassfish.jersey.internal.spi.AutoDiscoverable (org.glassfish.jersey.jaxb.internal.JaxbAutoDiscoverable is in unnamed module of loader jenkins.util.URLClassLoader2 @789313e; org.glassfish.jersey.internal.spi.AutoDiscoverable is in unnamed module of loader jenkins.util.URLClassLoader2 @a68050b)
    at java.base/java.util.TreeMap.compare(TreeMap.java:1292)
    at java.base/java.util.TreeMap.put(TreeMap.java:536)
    at java.base/java.util.TreeSet.add(TreeSet.java:255)
    at java.base/java.util.AbstractCollection.addAll(AbstractCollection.java:352)
    at java.base/java.util.TreeSet.addAll(TreeSet.java:312)
    at org.glassfish.jersey.model.internal.CommonConfig.configureAutoDiscoverableProviders(CommonConfig.java:609)
    at org.glassfish.jersey.client.ClientConfig$State.configureForcedAutoDiscoverableProviders(ClientConfig.java:388)
    at org.glassfish.jersey.client.ClientConfig$State.initRuntime(ClientConfig.java:441)
    at org.glassfish.jersey.internal.util.collection.Values$LazyValueImpl.get(Values.java:317)
    at org.glassfish.jersey.client.ClientConfig.getRuntime(ClientConfig.java:820)
    at org.glassfish.jersey.client.ClientRequest.getClientRuntime(ClientRequest.java:176)
    at org.glassfish.jersey.client.ClientRequest.getInjectionManager(ClientRequest.java:567)
    at org.glassfish.jersey.client.JerseyWebTarget.onBuilder(JerseyWebTarget.java:371)
    at org.glassfish.jersey.client.JerseyWebTarget.request(JerseyWebTarget.java:199)
    at org.glassfish.jersey.client.JerseyWebTarget.request(JerseyWebTarget.java:38)
    at org.gitlab4j.api.GitLabApiClient.invocation(GitLabApiClient.java:808)
    at org.gitlab4j.api.GitLabApiClient.invocation(GitLabApiClient.java:772)
    at org.gitlab4j.api.GitLabApiClient.get(GitLabApiClient.java:416)
    at org.gitlab4j.api.GitLabApiClient.get(GitLabApiClient.java:404)
    at org.gitlab4j.api.AbstractApi.get(AbstractApi.java:214)
Caused: org.gitlab4j.api.GitLabApiException: class org.glassfish.jersey.jaxb.internal.JaxbAutoDiscoverable cannot be cast to class org.glassfish.jersey.internal.spi.AutoDiscoverable (org.glassfish.jersey.jaxb.internal.JaxbAutoDiscoverable is in unnamed module of loader jenkins.util.URLClassLoader2 @789313e; org.glassfish.jersey.internal.spi.AutoDiscoverable is in unnamed module of loader jenkins.util.URLClassLoader2 @a68050b)
    at org.gitlab4j.api.AbstractApi.handle(AbstractApi.java:664)
    at org.gitlab4j.api.AbstractApi.get(AbstractApi.java:216)
    at org.gitlab4j.api.RepositoryApi.getBranch(RepositoryApi.java:110)
    at io.jenkins.plugins.gitlabbranchsource.GitLabSCMSource.retrieve(GitLabSCMSource.java:258)
    at jenkins.scm.api.SCMSource.fetch(SCMSource.java:582)
    at org.jenkinsci.plugins.workflow.multibranch.SCMVar.getValue(SCMVar.java:104)
    at org.jenkinsci.plugins.workflow.multibranch.SCMVar.getValue(SCMVar.java:59)
    at org.jenkinsci.plugins.workflow.cps.CpsScript.getProperty(CpsScript.java:135)
    at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:190)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getProperty(ScriptBytecodeAdapter.java:469)
    at org.kohsuke.groovy.sandbox.impl.Checker$7.call(Checker.java:355)
    at org.kohsuke.groovy.sandbox.GroovyInterceptor.onGetProperty(GroovyInterceptor.java:68)
    at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onGetProperty(SandboxInterceptor.java:355)
    at org.kohsuke.groovy.sandbox.impl.Checker$7.call(Checker.java:353)
    at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:357)
    at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:333)
    at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.getProperty(SandboxInvoker.java:29)
    at com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:20)
Caused: java.io.IOException: Failed to retrieve the SCM revision for master
    at io.jenkins.plugins.gitlabbranchsource.GitLabSCMSource.retrieve(GitLabSCMSource.java:298)
    at jenkins.scm.api.SCMSource.fetch(SCMSource.java:582)
    at org.jenkinsci.plugins.workflow.multibranch.SCMVar.getValue(SCMVar.java:104)
    at org.jenkinsci.plugins.workflow.multibranch.SCMVar.getValue(SCMVar.java:59)
    at org.jenkinsci.plugins.workflow.cps.CpsScript.getProperty(CpsScript.java:135)
    at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:190)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getProperty(ScriptBytecodeAdapter.java:469)
    at org.kohsuke.groovy.sandbox.impl.Checker$7.call(Checker.java:355)
    at org.kohsuke.groovy.sandbox.GroovyInterceptor.onGetProperty(GroovyInterceptor.java:68)
    at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onGetProperty(SandboxInterceptor.java:355)
    at org.kohsuke.groovy.sandbox.impl.Checker$7.call(Checker.java:353)
    at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:357)
    at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:333)
    at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.getProperty(SandboxInvoker.java:29)
    at com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:20)
    at WorkflowScript.run(WorkflowScript:13)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.delegateAndExecute(ModelInterpreter.groovy:137)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.executeSingleStage(ModelInterpreter.groovy:666)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.catchRequiredContextForNode(ModelInterpreter.groovy:395)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.catchRequiredContextForNode(ModelInterpreter.groovy:393)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.executeSingleStage(ModelInterpreter.groovy:665)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(ModelInterpreter.groovy:288)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.toolsBlock(ModelInterpreter.groovy:544)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.toolsBlock(ModelInterpreter.groovy:543)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(ModelInterpreter.groovy:276)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.withEnvBlock(ModelInterpreter.groovy:443)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.withEnvBlock(ModelInterpreter.groovy:442)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(ModelInterpreter.groovy:275)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.withCredentialsBlock(ModelInterpreter.groovy:481)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.withCredentialsBlock(ModelInterpreter.groovy:480)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(ModelInterpreter.groovy:274)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.inDeclarativeAgent(ModelInterpreter.groovy:586)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.inDeclarativeAgent(ModelInterpreter.groovy:585)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(ModelInterpreter.groovy:272)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.stageInput(ModelInterpreter.groovy:356)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.stageInput(ModelInterpreter.groovy:355)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(ModelInterpreter.groovy:261)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.inWrappers(ModelInterpreter.groovy:618)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.inWrappers(ModelInterpreter.groovy:617)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(ModelInterpreter.groovy:259)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.withEnvBlock(ModelInterpreter.groovy:443)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.withEnvBlock(ModelInterpreter.groovy:442)
    at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(ModelInterpreter.groovy:254)
    at ___cps.transform___(Native Method)
    at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.get(PropertyishBlock.java:74)
    at com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30)
    at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.fixName(PropertyishBlock.java:66)
    at jdk.internal.reflect.GeneratedMethodAccessor263.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
    at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
    at com.cloudbees.groovy.cps.Next.step(Next.java:83)
    at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174)
    at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)
    at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:136)
    at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:275)
    at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)
    at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
    at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:51)
    at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:185)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:403)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$400(CpsThreadGroup.java:97)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:315)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:279)
    at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:67)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139)
    at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
    at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:829)
Turiok commented 7 months ago

Hi @Evyatar-WM ,

I think this issue can be closed. The analysis of @alexjfisher is right with the Artifactory plugin. And artifactory plugin has made a correction : https://github.com/jfrog/jenkins-artifactory-plugin/commit/5e91ed1ba81237a7b891efc8c1a0d588141fed0c