Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IllegalArgumentException: RESTEASY003900 with jersey2-api:2.39-1 #1419

Closed
jakwarrior opened this issue Feb 28, 2023 · 34 comments
Closed

IllegalArgumentException: RESTEASY003900 with jersey2-api:2.39-1 #1419

jakwarrior opened this issue Feb 28, 2023 · 34 comments
Labels
bug For changelog: Minor bug. Will be listed after features

Comments

@jakwarrior
Copy link

Jenkins and plugins versions report

Environment
Jenkins: 2.375.3
OS: Linux - 3.10.0-1160.71.1.el7.x86_64
Java: 11.0.16.1 - Red Hat, Inc. (OpenJDK 64-Bit Server VM)
---
git:5.0.0
git-client:4.1.0
git-server:99.va_0826a_b_cdfa_d
gitlab-plugin:1.7.7
jersey2-api:2.39-1

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

Ubuntu 20.04

Reproduction steps

I have a pipeline job that looks like this:

stages{
  stage('Stage 1'){
      steps{
           updateGitlabCommitStatus name: 'Jenkins build', state: 'pending'
      }
  }
  stage('Stage 2'){
      steps{
          updateGitlabCommitStatus name: 'Jenkins build', state: 'running'
      }
  }
}

Expected Results

I expect to have no errors.

Actual Results

With jersey2-api:2.39-1, I have this stacktrace:

java.lang.IllegalArgumentException: RESTEASY003900: Unable to find a public constructor for provider class org.glassfish.jersey.jackson.internal.DefaultJacksonJaxbJsonProvider
  at org.jboss.resteasy.spi.ResteasyProviderFactory.createConstructorInjector(ResteasyProviderFactory.java:2844)
  at org.jboss.resteasy.spi.ResteasyProviderFactory.createProviderInstance(ResteasyProviderFactory.java:2833)
  at org.jboss.resteasy.spi.ResteasyProviderFactory.addMessageBodyReader(ResteasyProviderFactory.java:1068)
  at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:1841)
  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:141)
  at com.dabsquared.gitlabjenkins.gitlab.api.impl.ResteasyGitLabClientBuilder.buildClient(ResteasyGitLabClientBuilder.java:92)
  at com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectingGitLabClient.autodetect(AutodetectingGitLabClient.java:378)
  at com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectingGitLabClient.autodetectOrDie(AutodetectingGitLabClient.java:368)
  at com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectingGitLabClient.delegate(AutodetectingGitLabClient.java:361)
  at com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectingGitLabClient$GitLabOperation.execute(AutodetectingGitLabClient.java:397)
  at com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectingGitLabClient.execute(AutodetectingGitLabClient.java:391)
  at com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectingGitLabClient.getCurrentUser(AutodetectingGitLabClient.java:306)
  at com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectingGitLabClient.autodetect(AutodetectingGitLabClient.java:380)
  at com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectingGitLabClient.autodetectOrDie(AutodetectingGitLabClient.java:368)
  at com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectingGitLabClient.delegate(AutodetectingGitLabClient.java:361)
  at com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectingGitLabClient$GitLabOperation.execute(AutodetectingGitLabClient.java:397)
  at com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectingGitLabClient.execute(AutodetectingGitLabClient.java:391)
  at com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectingGitLabClient.getCommit(AutodetectingGitLabClient.java:197)
  at com.dabsquared.gitlabjenkins.util.CommitStatusUpdater.existsCommit(CommitStatusUpdater.java:123)
  at com.dabsquared.gitlabjenkins.util.CommitStatusUpdater.updateCommitStatus(CommitStatusUpdater.java:84)
  at com.dabsquared.gitlabjenkins.util.CommitStatusUpdater.updateCommitStatus(CommitStatusUpdater.java:99)
  at com.dabsquared.gitlabjenkins.workflow.UpdateGitLabCommitStatusStep$UpdateGitLabCommitStatusStepExecution.run(UpdateGitLabCommitStatusStep.java:80)
  at com.dabsquared.gitlabjenkins.workflow.UpdateGitLabCommitStatusStep$UpdateGitLabCommitStatusStepExecution.run(UpdateGitLabCommitStatusStep.java:64)
  at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousStepExecution.start(AbstractSynchronousStepExecution.java:41)
  at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:322)
  at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:196)
  at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:124)
  at jdk.internal.reflect.GeneratedMethodAccessor884.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 org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
  at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
  at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)
  at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
  at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:41)
  at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
  at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
  at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:180)
  at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:23)
  at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:163)
  at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:178)
  at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:182)
  at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:152)
  at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17)
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:141)
  at com.dabsquared.gitlabjenkins.gitlab.api.impl.ResteasyGitLabClientBuilder.buildClient(ResteasyGitLabClientBuilder.java:92)
  at com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectingGitLabClient.autodetect(AutodetectingGitLabClient.java:378)
  at com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectingGitLabClient.autodetectOrDie(AutodetectingGitLabClient.java:368)
  at com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectingGitLabClient.delegate(AutodetectingGitLabClient.java:361)
  at com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectingGitLabClient$GitLabOperation.execute(AutodetectingGitLabClient.java:397)
  at com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectingGitLabClient.execute(AutodetectingGitLabClient.java:391)
  at com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectingGitLabClient.getCurrentUser(AutodetectingGitLabClient.java:306)
  at com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectingGitLabClient.autodetect(AutodetectingGitLabClient.java:380)
  at com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectingGitLabClient.autodetectOrDie(AutodetectingGitLabClient.java:368)
  at com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectingGitLabClient.delegate(AutodetectingGitLabClient.java:361)
  at com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectingGitLabClient$GitLabOperation.execute(AutodetectingGitLabClient.java:397)
  at com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectingGitLabClient.execute(AutodetectingGitLabClient.java:391)
  at com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectingGitLabClient.getCommit(AutodetectingGitLabClient.java:197)
  at com.dabsquared.gitlabjenkins.util.CommitStatusUpdater.existsCommit(CommitStatusUpdater.java:123)
  at com.dabsquared.gitlabjenkins.util.CommitStatusUpdater.updateCommitStatus(CommitStatusUpdater.java:84)
  at com.dabsquared.gitlabjenkins.util.CommitStatusUpdater.updateCommitStatus(CommitStatusUpdater.java:99)
  at com.dabsquared.gitlabjenkins.workflow.UpdateGitLabCommitStatusStep$UpdateGitLabCommitStatusStepExecution.run(UpdateGitLabCommitStatusStep.java:80)
  at com.dabsquared.gitlabjenkins.workflow.UpdateGitLabCommitStatusStep$UpdateGitLabCommitStatusStepExecution.run(UpdateGitLabCommitStatusStep.java:64)
  at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousStepExecution.start(AbstractSynchronousStepExecution.java:41)
  at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:322)
  at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:196)
  at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:124)
  at jdk.internal.reflect.GeneratedMethodAccessor884.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 org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
  at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
  at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)
  at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
  at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:41)
  at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
  at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
  at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:180)
  at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:23)
  at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:163)
  at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:178)
  at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:182)
  at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:152)
  at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17)
  at WorkflowScript.run(WorkflowScript:93)
  at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.delegateAndExecute(ModelInterpreter.groovy:137)
  at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.runPostConditions(ModelInterpreter.groovy:761)
  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.runPostConditions(ModelInterpreter.groovy:760)
  at com.cloudbees.groovy.cps.CpsDefaultGroovyMethods.each(CpsDefaultGroovyMethods:2125)
  at com.cloudbees.groovy.cps.CpsDefaultGroovyMethods.each(CpsDefaultGroovyMethods:2110)
  at com.cloudbees.groovy.cps.CpsDefaultGroovyMethods.each(CpsDefaultGroovyMethods:2151)
  at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.runPostConditions(ModelInterpreter.groovy:750)
  at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.runPostConditions(ModelInterpreter.groovy)
  at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.executePostBuild(ModelInterpreter.groovy:728)
  at ___cps.transform___(Native Method)
  at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:90)
  at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:116)
  at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:85)
  at jdk.internal.reflect.GeneratedMethodAccessor838.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.CollectionLiteralBlock$ContinuationImpl.dispatch(CollectionLiteralBlock.java:55)
  at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.item(CollectionLiteralBlock.java:45)
  at jdk.internal.reflect.GeneratedMethodAccessor841.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:152)
  at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:146)
  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:146)
  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:187)
  at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:420)
  at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:330)
  at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:294)
  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:30)
  at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:70)
  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)

Anything else?

Everything is fine with gitlab-plugin:1.7.7 and jersey2-api:2.38-1. There is a regression with jersey2-api:2.39-1.

@jakwarrior jakwarrior added the bug For changelog: Minor bug. Will be listed after features label Feb 28, 2023
@MarkEWaite
Copy link
Contributor

Thanks for the report @jakwarrior . We're investigating the changes in the jersey2 api plugin as part of jenkinsci/bom#1794 . For the moment, you've taken the best path by falling back to the previous release.

@MarkEWaite
Copy link
Contributor

MarkEWaite commented Feb 28, 2023

I believe the change that caused this issue is in the Jersey 2.39 pull request:

That pull request removed the no-args constructor on the DefaultJacksonJaxbJsonProvider class and added a constructor with the @Inject annotation and two arguments. It appears that RESTEasy 3.15.3 needs the old constructor rather than the new constructor.

@freafrea
Copy link

freafrea commented Mar 1, 2023

I can confirm that reverting the version to .38 fixes the issue. I had to first uninstall gitlab plugin (and others that depended on jersey), revert jersey and reinstall plugins. Thanks for the tip.

@hasmikg
Copy link

hasmikg commented Mar 2, 2023

thanks for providing workaround. Will be looking forward for the fix.

@nicomodeus
Copy link
Contributor

I was able to workaround by just downloading both hpi files from the corresponding plugin download sites and uploading both manually through 'Manage Jenkins > Plugin Manager -> Deploy Plugin'. After that a restart was necessary. No issues with deleting other plugins or so.

@MarkEWaite
Copy link
Contributor

thanks for providing workaround. Will be looking forward for the fix.

I'm not sure when a fix will be available. My time is limited right now so that I'm not able to spend the effort to create a focused example that highlights the incompatibility in Jersey 2.39 compared to Jersey 2.38. I'm not willing to submit an issue to the Jersey project without a focused example that highlights the incompatibility.

Ultimately, we hope that the GitLab plugin modernization project idea for Google Summer of Code will replace the use of RESTEasy client with calls to gitlab4j. However, even if that project idea is accepted, it won't be implemented until July-September 2023.

If others are willing to create a focused example the highlights the incompatibility in Jersey 2.39 compared to Jersey 2.38, that would be a great help.

@sach-edna
Copy link

I was able to workaround by just downloading both hpi files from the corresponding plugin download sites and uploading both manually through 'Manage Jenkins > Plugin Manager -> Deploy Plugin'. After that a restart was necessary. No issues with deleting other plugins or so.

I can confirm that for me installing the jersey-2 plugin via hpi file and reverting the gitlab plugin works as a workaround for this issue. Thanks for the suggestion 😄

@dmanero
Copy link

dmanero commented Mar 4, 2023

I also confirm.

After updating the plugin

  1. Manage Jenkins > Configure System > GitLab Test Connection Failed!!!!
  2. In the pipelines updateGitlabCommitStatus failed with a RESTEASY003900: Unable to find a public constructor for provider class org.glas

Solution:

  1. Uninstall GitLab Plugin
  2. Install manually jersey 2.38-1 (https://updates.jenkins.io/download/plugins/jersey2-api/2.38-1/jersey2-api.hpi)
  3. reinstall GitLab plugin

Thanks everyone!!!!!!

@MarkEWaite
Copy link
Contributor

MarkEWaite commented Mar 5, 2023

A new release of REST Easy client 3.x has been proposed for inclusion in the plugin with the pull request:

It would be much appreciated if one of those affected by this bug could "test drive" the pre-release build of that library update. The pre-release build will be available at https://ci.jenkins.io/job/Plugins/job/gitlab-plugin/view/change-requests/job/PR-1421/ once that job completes successfully.

@trentapple
Copy link

trentapple commented Mar 5, 2023

I encountered this and can confirm that manually installing the previous Jersey 2 API package version 2.38-1 was a temporary workaround while still running GitLab Plugin 1.7.7.

@MarkEWaite Tested the gitlab prerelease package. If I understand correctly — this should be used with the latest updated Jersey 2 API plugin (2.39-1 at the time of writing this).

Installing the GitLab plugin prerelease package then upgrading Jersey 2 API plugin appears to work well until attempting a webhook. The Unable to find a public constructor for provider class org.glassfish.jersey.jackson.internal.DefaultJacksonJaxbJsonProvider returns.

@MCMicS
Copy link

MCMicS commented Mar 5, 2023

I also has tested the PR Build

The error still exists with Jersey 2.39-1

@MarkEWaite
Copy link
Contributor

Thanks @trentapple and @MCMicS . I had hoped that we might be lucky and that a fix had been included in the RESTEasy client release. Not as luck as I had hoped.

I think the new REST Easy client library is still a good thing to include in the plugin, but it does not resolve this issue.

@MCMicS
Copy link

MCMicS commented Mar 5, 2023

No Problem. I can also try to find a solution the days or my be create a small focused sample to reproduce

@MarkEWaite
Copy link
Contributor

No Problem. I can also try to find a solution the days or my be create a small focused sample to reproduce

That would be great! We're much more likely to persuade the Jersey API maintainers of a regression if we have a small focused sample that duplicates the problem and clearly shows that what worked in 2.38 and does not work in 2.39.

@MCMicS
Copy link

MCMicS commented Mar 5, 2023

Hi @MarkEWaite
I created a small sample. The issue is the usage of JacksonFeature.
Sample at: https://github.com/MCMicS/jersey-jackson
Executed actions:

Hope it helps

I also checked the official examples/docs of jersey but I cannot find any difference.
Docs: https://eclipse-ee4j.github.io/jersey.github.io/documentation/latest/user-guide.html
Examples: https://github.com/eclipse-ee4j/jersey/blob/2.39/examples/json-jackson/src/test/java/org/glassfish/jersey/examples/jackson/JacksonTest.java

Tested also RestEasy 4.7.9.Final but error is still with this version

@MarkEWaite
Copy link
Contributor

Thanks! That looks like it may be a private repository. Would you be willing to either make me @MarkEWaite a collaborator or make it public?

@MCMicS
Copy link

MCMicS commented Mar 6, 2023

It is now public.
The jersey examples from official site uses JerseyClientBuilder instead TestEasyClientBuilder and the JacksonFeature works ion this setup because the look for the parameters to inject

@jonl-percsolutions-com
Copy link

Our users are badly affected by this bug. This fix appears to be incorporated in the RC for 1.7.8, is that correct? If so, how long does it take for the RC to go to released? If I download and install the release candidate, will the next version be recommended when it's available, or will I have to uninstall the RC and reinstall the plugin?

https://ci.jenkins.io/job/Plugins/job/gitlab-plugin/job/master/

@krisstern
Copy link
Member

I see @basil has two pending pull requests to fix this issue in jenkinsci/jersey2-api-plugin#60 and jenkins-infra/update-center2#688. Once those are merged, I will cut a new release if no one else get to that yet.

@basil
Copy link
Member

basil commented Mar 6, 2023

The Jersey 2.39 upgrade has been reverted in jenkinsci/jersey2-api-plugin#60, and the Jersey 2 API plugin 2.39-1 has been suspended from distribution in jenkins-infra/update-center2#688. Affected users should downgrade Jersey 2 API plugin from 2.39-1 to 2.38-1.

@basil
Copy link
Member

basil commented Mar 7, 2023

As of jenkinsci/jersey2-api-plugin#61 the Jersey 2 API plugin test suite tests compatibility with RESTEasy 3.15.x. These tests pass on Jersey 2.38 and fail on Jersey 2.39. The new tests ensure that all future releases of Jersey 2 API plugin will be compatible with RESTEasy 3.15.x and therefore GitLab plugin.

@spacreau
Copy link

spacreau commented Mar 7, 2023

Same problem,
1.7.8 doesn't resolve

MarkEWaite added a commit to MarkEWaite/docker-lfs that referenced this issue Mar 7, 2023
jenkinsci/gitlab-plugin#1419 reports that
jersey2 api 2.39 broke compatibility with jersey2 api 2.38 and causes an
'IllegalArgumentException: RESTEASY003900'

jenkins-infra/update-center2#688 suspends jersey2
api plugin 2.39-1 from distribution.

Since the jersey2 api plugin 2.39-1 is suspended from distribution,
it should not be used in my standard environment.  I've not detected the
issues myself, but want the environment to use available plugins.

This reverts commit 12efef6.
@MarkEWaite
Copy link
Contributor

Same problem, 1.7.8 doesn't resolve

Correct. It was noted in an earlier comment that the current known workaround is to downgrade the Jenkins jersey2-api plugin from 2.39-1 to 2.38-1. If the jersey2-api plugin was upgraded from the Jenkins plugin manager, then there will be a downgrade option available in the plugin manager. If the jersey2-api plugin was upgraded with the plugin installation manager tool, then the plugins definition (plugins.txt or plugins.yaml) needs to be changed to use 2.38-1 instead of 2.39-1.

The jersey2-api plugin 2.39-1 has been suspended from distribution (thanks to @basil) so that users will no longer be able to install that version.

@jonl-percsolutions-com
Copy link

Same problem, 1.7.8 doesn't resolve

Correct. It was noted in an earlier comment that the current known workaround is to downgrade the Jenkins jersey2-api plugin from 2.39-1 to 2.38-1. If the jersey2-api plugin was upgraded from the Jenkins plugin manager, then there will be a downgrade option available in the plugin manager. If the jersey2-api plugin was upgraded with the plugin installation manager tool, then the plugins definition (plugins.txt or plugins.yaml) needs to be changed to use 2.38-1 instead of 2.39-1.

We install and upgrade all plugins from the manager. We have the 1.7.8 version of Gitlab API install. However, the downgrade option is not available for jersey2-api, it is greyed out. Any idea why that would be?

@MCMicS
Copy link

MCMicS commented Mar 7, 2023

@jonl-percsolutions-com
It could be disabled if it if used by other plugins as dependency (like Jira, gitlab and so on)

I would suggest to download the hpi file for 2.38-1 and upload it manually to replace your current version. Or if you have access to the jenkins instance restore the previous hpi file (name with .bak)

Url to Deploy: https://updates.jenkins.io/download/plugins/jersey2-api/2.38-1/jersey2-api.hpi

@jonl-percsolutions-com
Copy link

It appears that nothing else depends on it other than gitlab-plugin. I ran a script in the console that lists all plugins and dependencies and version. If I'm not missing anything, then I will report a bug.

plugins-dep.txt

@MCMicS
Copy link

MCMicS commented Mar 7, 2023

can you deploy it manually?
https://yourJenkins/manage/pluginManager/advanced

disabe plugin (and rollback) is not possible and shown in tooltip.
grafik

@Kissaki
Copy link

Kissaki commented Mar 8, 2023

The plugin release revocation is intransparent and non-obvious. (I would have said horrendously misleading, but I may have misunderstood which version displayed shows what - which is another non-obvious, bad UI issue making the whole revokation UX worse.)

I had to manually track this issue down and rename the files in /var/lib/jenkins/plugins to use the correct version.

@MCMicS You can check for the files jersey2-api.jpi and jersey2-api.bak in /var/lib/jenkins/plugins. If you download them you can open them as zip files and inspect META-INF/MANIFEST.MF as a text file for their version.

Then you drop the v2.39 file and use (rename) the v2.38 file to jersey2-api.jpi and restart Jenkins. Then it should load that one. You don't need a .bak one.

@ite-klass
Copy link

The v1.7.8 release does not mention jersey-api. What's the relationship between v1.7.8 and jersey-api?

It mentions resteasy-client - does that depend on or is defined in jersey-api? (I don't see an installed plugin called resteasy-client in Jenkins.)

@MarkEWaite
Copy link
Contributor

The v1.7.8 release does not mention jersey-api. What's the relationship between v1.7.8 and jersey-api?

It mentions resteasy-client - does that depend on or is defined in jersey-api? (I don't see an installed plugin called resteasy-client in Jenkins.)

The GitLab plugin depends on the Jersey 2 API plugin. A reference to the Jersey 2 API plugin is inserted into the GitLab plugin when the GitLab plugin is compiled. The Jersey 2 API plugin must be installed in Jenkins in order to run the GitLab plugin. See the brief description of API plugins for more information.

The GitLab plugin depends on the RESTEasy client API jar file. A copy of the RESTEasy client API jar file is inserted into the GitLab plugin when the GitLab plugin is compiled. The RESTEasy client API is not widely used in Jenkins. Converting it to an API plugin would not help Jenkins plugin maintainers enough to be worth the effort.

The RESTEasy client API jar file uses the Jersey 2 API in its implementation. The RESTEasy client API depends on the Jersey 2 API. My hope was that the update from RESTEasy client API 3.15.3.Final to 3.15.6.Final might resolve the issue. That hope was incorrect. As shown by @MCMicS, the problem is in the Jersey 2 API 2.39.

@MarkEWaite
Copy link
Contributor

The plugin release revocation is intransparent and non-obvious. (I would have said horrendously misleading, but I may have misunderstood which version displayed shows what - which is another non-obvious, bad UI issue making the whole revocation UX worse.)

Yes, suspending a plugin does not have a UI to support it. Thankfully, it is very rare that we suspend distribution of a plugin. Suspending distribution of a plugin prevents download but does not remove the plugin from existing installations. It requires additional steps from users if they want to remove or replace the suspended plugin.

@seb-pax
Copy link

seb-pax commented Mar 13, 2023

Deploy Jersey in release 2.38 solve the problem in the gitlab plugin.
Thank you all of you for your investigation and discussion

@basil
Copy link
Member

basil commented Mar 31, 2023

This ticket should now be closed, as this issue has been resolved.

I would like to thank @MCMicS for contributing the minimal reproducible example (MRE) at Mark's request. Not only was I able to use this to add a test case to jersey2-api-plugin, but also this was helpful to the Jersey developers in eclipse-ee4j/jersey#5275 and enabled a Jersey fix to be released last week via eclipse-ee4j/jersey#5284 in Jersey 2.39.1, successfully adopted by the Jenkins project in jersey2-api-plugin 2.39.1-1.

A rising tide lifts all boats. When one open source project benefits, we all benefit.

@MarkEWaite
Copy link
Contributor

Thanks to all involved!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug For changelog: Minor bug. Will be listed after features
Projects
None yet
Development

No branches or pull requests