jenkinsci / gitlab-plugin

A Jenkins plugin for interfacing with GitLab
https://plugins.jenkins.io/gitlab-plugin/
GNU General Public License v2.0
1.44k stars 610 forks source link

com.fasterxml.jackson.databind.JsonMappingException: Scala module 2.9.9 requires Jackson Databind version >= 2.9.0 and < 2.10.0 #1289

Closed rafis closed 2 years ago

rafis commented 2 years ago

Jenkins and plugins versions report

Environment ```text Jenkins: 2.319.1 OS: Linux - 5.4.17-2136.301.1.3.el7uek.x86_64 --- Parameterized-Remote-Trigger:3.1.5.1 ace-editor:1.1 active-directory:2.25.1 additional-metrics:45.vc0cdf94c7d5b_ allure-jenkins-plugin:2.30.2 analysis-model-api:10.10.1 anchore-container-scanner:1.0.23 ansible:1.1 ansible-tower:0.16.0 ant:475.vf34069fef73c ant-in-workspace:1.2.0 antexec:196.v306c59b_7ca_ef antisamy-markup-formatter:2.7 apache-httpcomponents-client-4-api:4.5.13-1.0 aqua-microscanner:1.0.8 authentication-tokens:1.4 basic-branch-build-strategies:1.3.2 bootstrap4-api:4.6.0-5 bootstrap5-api:5.1.3-6 bouncycastle-api:2.26 branch-api:2.1046.v0ca_37783ecc5 build-pipeline-plugin:1.5.8 build-timeout:1.20 build-user-vars-plugin:1.8 build-with-parameters:1.6 built-on-column:1.1 caffeine-api:2.9.3-65.v6a_47d0f4d1fe checks-api:1.7.4 cloudbees-folder:6.722.v8165b_a_cf25e9 command-launcher:81.v9c2cb_cb_db_392 conditional-buildstep:1.4.2 config-file-provider:3.10.0 convert-to-pipeline:1.0 copyartifact:1.46.4 credentials:1087.1089.v2f1b_9a_b_040e4 credentials-binding:523.vd859a_4b_122e6 cucumber-reports:5.7.0 custom-tools-plugin:0.8 data-tables-api:1.11.4-4 database:148.v4a_ff2ca_608b_7 database-postgresql:1.2 display-url-api:2.3.5 docker-commons:1.19 docker-compose-build-step:1.0 docker-java-api:3.2.13-37.vf3411c9828b9 docker-plugin:1.2.9 docker-workflow:1.28 durable-task:496.va67c6f9eefa7 echarts-api:5.3.2-1 elasticsearch-query:1.2 email-ext:2.88 emailext-template:1.4 embeddable-build-status:2.0.3 envinject:2.4.0 envinject-api:1.8 extended-choice-parameter:346.vd87693c5a_86c external-monitor-job:191.v363d0d1efdf8 font-awesome-api:6.0.0-1 forensics-api:1.13.0 generic-webhook-trigger:1.84 git:4.11.3 git-client:3.11.0 git-parameter:0.9.16 git-server:1.11 gitlab-api:5.0.1-72.vb_8c272862e86 gitlab-branch-source:625.v85cf3a_400cfe gitlab-merge-request-jenkins:2.0.0 gitlab-plugin:1.5.32 google-oauth-plugin:1.0.6 gradle:1.38 h2-api:1.4.199 handlebars:3.0.8 handy-uri-templates-2-api:2.1.8-22.v77d5b_75e6953 hashicorp-vault-plugin:336.v182c0fbaaeb7 htmlpublisher:1.30 http_request:1.15 jackson2-api:2.13.3-285.vc03c0256d517 jacoco:3.3.2 javadoc:217.v905b_86277a_2a_ javax-activation-api:1.2.0-3 javax-mail-api:1.6.2-6 jaxb:2.3.6-1 jdk-tool:1.5 jenkins-monitor-bridge:1.0 jenkins-multijob-plugin:1.36 jersey2-api:2.35-8 job-restrictions:0.8 jobConfigHistory:2.31-rc1107.2354f08725a_8 jquery:1.12.4-1 jquery-detached:1.2.1 jquery3-api:3.6.0-3 jsch:0.1.55.2 junit:1.54 junit-attachments:95.v69691d523620 kafkalogs:0.1.8 kubernetes-cli:1.10.3 kubernetes-client-api:5.12.2-193.v26a_6078f65a_9 kubernetes-credentials:0.9.0 ldap:2.9 lockable-resources:2.15 m2release:0.16.3 mailer:414.vcc4c33714601 mask-passwords:3.1 matrix-auth:3.1.2 matrix-project:771.v574584b_39e60 mattermost:3.1.1 maven-plugin:3.16 metrics:4.1.6.1 momentjs:1.1.1 monitoring:1.91.0 nested-view:1.24 nodejs:1.5.1 oauth-credentials:0.5 pam-auth:1.8 parameterized-trigger:2.44 pipeline-as-yaml:0.16-rc pipeline-build-step:2.18 pipeline-graph-analysis:195.v5812d95a_a_2f9 pipeline-input-step:448.v37cea_9a_10a_70 pipeline-maven:3.10.0 pipeline-milestone-step:101.vd572fef9d926 pipeline-model-api:1.9.3 pipeline-model-definition:1.9.3 pipeline-model-extensions:1.9.3 pipeline-rest-api:2.24 pipeline-stage-step:293.v200037eefcd5 pipeline-stage-tags-metadata:1.9.3 pipeline-stage-view:2.24 pipeline-utility-steps:2.12.1 plain-credentials:1.8 plugin-util-api:2.16.0 popper-api:1.16.1-3 popper2-api:2.11.5-1 prism-api:1.28.0-1 prometheus:2.0.10 publish-over:0.22 publish-over-ssh:1.24 remoting-kafka:2.0.1 resource-disposer:0.19 role-strategy:3.2.0 ruby-runtime:0.12 run-condition:1.5 scm-api:608.vfa_f971c5a_a_e9 script-security:1138.v8e727069a_025 shiningpanda:0.24 shortcut-job:0.4 show-build-parameters:1.0 slack:608.v19e3b_44b_b_9ff snakeyaml-api:1.30.1 sonar:2.14 ssh-agent:295.v9ca_a_1c7cc3a_a_ ssh-credentials:277.v95c2fec1c047 ssh-slaves:1.814.vc82988f54b_10 ssh-steps:2.0.0 sshd:3.237.v883d165a_c1d3 structs:318.va_f3ccb_729b_71 synopsys-coverity:3.0.1 tfs:5.157.1 thinBackup:1.10 timestamper:1.17 token-macro:293.v283932a_0a_b_49 trilead-api:1.57.v6e90e07157e1 uno-choice:2.6.1 variant:1.4 view-job-filters:2.3 warnings-ng:9.12.0 windows-slaves:1.8.1 workflow-aggregator:578.vf9a_f99755f4a_ workflow-api:1153.vb_912c0e47fb_a_ workflow-basic-steps:2.24 workflow-cps:2660.vb_c0412dc4e6d workflow-cps-global-lib:581.ve633085a_8a_87 workflow-durable-task-step:1139.v252a_e12e8463 workflow-job:1145.v7f2433caa07f workflow-multibranch:712.vc169a_1387405 workflow-scm-step:400.v6b_89a_1317c9a_ workflow-step-api:625.vd896b_f445a_f8 workflow-support:813.vb_d7c3d2984a_0 ws-cleanup:0.42 ```

What Operating System are you using (both controller, and any agents involved in the problem)?

Oracle Linux 7.9

Reproduction steps

Install Oracle Linux v7.9. Install Jenkins v2.319.1. Install plugins according to environment above, especially Jenkins GitLab Plugin v1.5.32.

Expected Results

Jenkins GitLab Plugin is working.

Actual Results

Jenkins GitLab Plugin is not working and giving error:

com.fasterxml.jackson.databind.JsonMappingException: Scala module 2.9.9 requires Jackson Databind version >= 2.9.0 and < 2.10.0
    at com.fasterxml.jackson.module.scala.JacksonModule.setupModule(JacksonModule.scala:61)
    at com.fasterxml.jackson.module.scala.JacksonModule.setupModule$(JacksonModule.scala:46)
    at com.fasterxml.jackson.module.scala.DefaultScalaModule.setupModule(DefaultScalaModule.scala:17)
    at com.fasterxml.jackson.databind.ObjectMapper.registerModule(ObjectMapper.java:853)
    at com.fasterxml.jackson.databind.ObjectMapper.registerModules(ObjectMapper.java:1055)
    at org.glassfish.jersey.jackson.internal.DefaultJacksonJaxbJsonProvider.findAndRegisterModules(DefaultJacksonJaxbJsonProvider.java:54)
    at org.glassfish.jersey.jackson.internal.DefaultJacksonJaxbJsonProvider.<init>(DefaultJacksonJaxbJsonProvider.java:38)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:152)
Caused: java.lang.RuntimeException: RESTEASY003325: Failed to construct public org.glassfish.jersey.jackson.internal.DefaultJacksonJaxbJsonProvider()
    at org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:164)
    at org.jboss.resteasy.spi.ResteasyProviderFactory.createProviderInstance(ResteasyProviderFactory.java:2835)
    at org.jboss.resteasy.spi.ResteasyProviderFactory.addMessageBodyReader(ResteasyProviderFactory.java:1068)
    at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:1841)
Caused: java.lang.RuntimeException: RESTEASY003940: Unable to instantiate MessageBodyReader
    at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:1846)
    at org.jboss.resteasy.spi.ResteasyProviderFactory.register(ResteasyProviderFactory.java:3065)
    at org.jboss.resteasy.spi.ResteasyProviderFactory.register(ResteasyProviderFactory.java:123)
    at org.jboss.resteasy.util.FeatureContextDelegate.register(FeatureContextDelegate.java:52)
    at org.jboss.resteasy.util.FeatureContextDelegate.register(FeatureContextDelegate.java:12)
    at org.glassfish.jersey.jackson.JacksonFeature.configure(JacksonFeature.java:107)
    at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProviderInstance(ResteasyProviderFactory.java:2605)
    at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProviderInstance(ResteasyProviderFactory.java:2233)
    at org.jboss.resteasy.spi.ResteasyProviderFactory.register(ResteasyProviderFactory.java:3036)
    at org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder.register(ResteasyClientBuilder.java:617)
    at com.dabsquared.gitlabjenkins.gitlab.api.impl.ResteasyGitLabClientBuilder.buildClient(ResteasyGitLabClientBuilder.java:140)
    at com.dabsquared.gitlabjenkins.gitlab.api.impl.ResteasyGitLabClientBuilder.buildClient(ResteasyGitLabClientBuilder.java:91)
    at com.dabsquared.gitlabjenkins.connection.GitLabConnection.getClient(GitLabConnection.java:147)
    at com.dabsquared.gitlabjenkins.connection.GitLabConnectionConfig.getClient(GitLabConnectionConfig.java:66)
    at com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty.getClient(GitLabConnectionProperty.java:79)
    at com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty.getClient(GitLabConnectionProperty.java:92)
    at com.dabsquared.gitlabjenkins.util.CommitStatusUpdater.updateCommitStatus(CommitStatusUpdater.java:51)
    at com.dabsquared.gitlabjenkins.util.CommitStatusUpdater.updateCommitStatus(CommitStatusUpdater.java:97)
    at com.dabsquared.gitlabjenkins.workflow.GitLabBuildsStep$GitLabBuildStepExecution$1.onStart(GitLabBuildsStep.java:87)
    at org.jenkinsci.plugins.workflow.cps.CpsBodyExecution.launch(CpsBodyExecution.java:135)
    at org.jenkinsci.plugins.workflow.cps.CpsBodyInvoker.launch(CpsBodyInvoker.java:187)
    at org.jenkinsci.plugins.workflow.cps.DSL$ThreadTaskImpl.lambda$invokeBodiesAndSwitchToAsyncMode$0(DSL.java:781)
    at org.jenkinsci.plugins.workflow.cps.CpsStepContext.withBodyInvokers(CpsStepContext.java:544)
    at org.jenkinsci.plugins.workflow.cps.DSL$ThreadTaskImpl.invokeBodiesAndSwitchToAsyncMode(DSL.java:771)
    at org.jenkinsci.plugins.workflow.cps.DSL$ThreadTaskImpl.eval(DSL.java:736)
    at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:195)
    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.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)

Anything else?

No response

basil commented 2 years ago

Steps to reproduce are incomplete. After installing the plugins as described in the steps to reproduce, there is no error. The error only occurs after an additional action is taken to update the GitLab commit status. You have not described how to take this action. Do not file an issue without including steps to reproduce the entire problem from scratch.

Furthermore, jackson-module-scala is not bundled in the GitLab, Jackson 2 API, or Jersey 2 API plugins. jackson-module-scala_2.12-2.9.9.jar is bundled in the Remoting Kafka plugin. I suggest you disable the Remoting Kafka plugin or file a pull request in https://github.com/jenkinsci/remoting-kafka-plugin to update jackson-module-scala to a recent version or remove the dependency. Do not file issues in https://github.com/jenkinsci/gitlab-plugin about jackson-module-scala or Remoting Kafka.