Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-47234

java.lang.SecurityException: Rejected: com.google.inject.ProvisionException when trying to start a job

      I am running Jenkins in a Master slave environment. After upgrading Jenkins to Version 2.81 i get the following exception:

      Parsing POMs
      ERROR: Processing failed due to a bug in the code. Please report this to the issue tracker ([https://jenkins.io/redirect/report-an-issue]).
      java.lang.SecurityException: Rejected: com.google.inject.ProvisionException
      at hudson.remoting.ClassFilter.check(ClassFilter.java:46)
      at hudson.remoting.MultiClassLoaderSerializer$Input.resolveClass(MultiClassLoaderSerializer.java:124)
      at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1613)
      at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1518)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1774)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993)
      at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:501)
      at java.lang.Throwable.readObject(Throwable.java:914)
      at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:483)
      at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1896)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993)
      at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:501)
      at java.lang.Throwable.readObject(Throwable.java:914)
      at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:483)
      at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1896)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993)
      at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:501)
      at java.lang.Throwable.readObject(Throwable.java:914)
      at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:483)
      at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1896)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
      at hudson.remoting.UserRequest.deserialize(UserRequest.java:272)
      at hudson.remoting.UserResponse.retrieve(UserRequest.java:305)
      at hudson.remoting.Channel.call(Channel.java:904)
      at hudson.FilePath.act(FilePath.java:987)
      at hudson.FilePath.act(FilePath.java:976)
      at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.parsePoms(MavenModuleSetBuild.java:986)
      at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:691)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:496)
      at hudson.model.Run.execute(Run.java:1724)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:419)

          [JENKINS-47234] java.lang.SecurityException: Rejected: com.google.inject.ProvisionException when trying to start a job

          Jens Müller created issue -
          Jens Müller made changes -
          Labels New: java8 linux remoting
          Jens Müller made changes -
          Environment New: 2.81

          Daniel Beck added a comment -

          What version of the Maven Plugin is this?

          CC oleg_nenashev

          Daniel Beck added a comment - What version of the Maven Plugin is this? CC oleg_nenashev
          Daniel Beck made changes -
          Component/s New: maven-plugin [ 16033 ]

          Oleg Nenashev added a comment -

          I also need agent log for this ticket

          Oleg Nenashev added a comment - I also need agent log for this ticket

          Jens Müller added a comment -

          The Version of the maven Integration plugin is 3.0-rc1

          Jens Müller added a comment - The Version of the maven Integration plugin is 3.0-rc1

          Jens Müller added a comment -

          Where can i find the agent log?

          Jens Müller added a comment - Where can i find the agent log?

          Jens Müller added a comment -

          I found the following exception in the Jenkins log on master:

          1) Error injecting constructor, java.lang.IncompatibleClassChangeError: hudson.security.LDAPSecurityRealm$CacheConfiguration and hudson.security.LDAPSecurityRealm$CacheConfiguration$DescriptorImpl disagree on InnerClasses attribute

          at hudson.security.LDAPSecurityRealm$CacheConfiguration$DescriptorImpl.<init>(LDAPSecurityRealm.java:2008)

          1 error

          at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:52)

          at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)

          at hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1.get(ExtensionFinder.java:424)

          at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)

          at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)

          at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)

          at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)

          at hudson.ExtensionFinder$GuiceFinder._find(ExtensionFinder.java:386)

          at hudson.ExtensionFinder$GuiceFinder.find(ExtensionFinder.java:377)

          at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:479)

          at hudson.ExtensionList.load(ExtensionList.java:365)

          at hudson.ExtensionList.ensureLoaded(ExtensionList.java:303)

          at hudson.ExtensionList.getComponents(ExtensionList.java:168)

          at hudson.DescriptorExtensionList.load(DescriptorExtensionList.java:191)

          at hudson.ExtensionList.ensureLoaded(ExtensionList.java:303)

          at hudson.ExtensionList.iterator(ExtensionList.java:157)

          at jenkins.branch.CustomOrganizationFolderDescriptor.doAddSpecificDescriptors(CustomOrganizationFolderDescriptor.java:166)

          at jenkins.branch.CustomOrganizationFolderDescriptor.addSpecificDescriptors(CustomOrganizationFolderDescriptor.java:145)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:483)

          at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:104)

          at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:175)

          at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)

          at jenkins.model.Jenkins$7.runTask(Jenkins.java:1073)

          at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)

          at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

          at java.lang.Thread.run(Thread.java:745)

          Caused by: java.lang.IncompatibleClassChangeError: hudson.security.LDAPSecurityRealm$CacheConfiguration and hudson.security.LDAPSecurityRealm$CacheConfiguration$DescriptorImpl disagree on InnerClasses attribute

          at java.lang.Class.getDeclaringClass0(Native Method)

          at java.lang.Class.getDeclaringClass(Class.java:1222)

          at java.lang.Class.getEnclosingClass(Class.java:1264)

          at hudson.model.Descriptor.<init>(Descriptor.java:272)

          at hudson.security.LDAPSecurityRealm$CacheConfiguration$DescriptorImpl.<init>(LDAPSecurityRealm.java:2008)

          at hudson.security.LDAPSecurityRealm$CacheConfiguration$DescriptorImpl$$FastClassByGuice$$eb0c5988.newInstance(<generated>)

          at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)

          at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:61)

          at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:105)

          at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)

          at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)

          at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)

          at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)

          at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)

          ... 30 more

          can this be the reason of the SecurityException? If yes, how can i solve this?

          Jens Müller added a comment - I found the following exception in the Jenkins log on master: 1) Error injecting constructor, java.lang.IncompatibleClassChangeError: hudson.security.LDAPSecurityRealm$CacheConfiguration and hudson.security.LDAPSecurityRealm$CacheConfiguration$DescriptorImpl disagree on InnerClasses attribute at hudson.security.LDAPSecurityRealm$CacheConfiguration$DescriptorImpl.<init>(LDAPSecurityRealm.java:2008) 1 error at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:52) at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145) at hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1.get(ExtensionFinder.java:424) at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41) at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016) at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092) at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012) at hudson.ExtensionFinder$GuiceFinder._find(ExtensionFinder.java:386) at hudson.ExtensionFinder$GuiceFinder.find(ExtensionFinder.java:377) at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:479) at hudson.ExtensionList.load(ExtensionList.java:365) at hudson.ExtensionList.ensureLoaded(ExtensionList.java:303) at hudson.ExtensionList.getComponents(ExtensionList.java:168) at hudson.DescriptorExtensionList.load(DescriptorExtensionList.java:191) at hudson.ExtensionList.ensureLoaded(ExtensionList.java:303) at hudson.ExtensionList.iterator(ExtensionList.java:157) at jenkins.branch.CustomOrganizationFolderDescriptor.doAddSpecificDescriptors(CustomOrganizationFolderDescriptor.java:166) at jenkins.branch.CustomOrganizationFolderDescriptor.addSpecificDescriptors(CustomOrganizationFolderDescriptor.java:145) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:104) at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:175) at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282) at jenkins.model.Jenkins$7.runTask(Jenkins.java:1073) at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210) at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.IncompatibleClassChangeError: hudson.security.LDAPSecurityRealm$CacheConfiguration and hudson.security.LDAPSecurityRealm$CacheConfiguration$DescriptorImpl disagree on InnerClasses attribute at java.lang.Class.getDeclaringClass0(Native Method) at java.lang.Class.getDeclaringClass(Class.java:1222) at java.lang.Class.getEnclosingClass(Class.java:1264) at hudson.model.Descriptor.<init>(Descriptor.java:272) at hudson.security.LDAPSecurityRealm$CacheConfiguration$DescriptorImpl.<init>(LDAPSecurityRealm.java:2008) at hudson.security.LDAPSecurityRealm$CacheConfiguration$DescriptorImpl$$FastClassByGuice$$eb0c5988.newInstance(<generated>) at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40) at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:61) at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:105) at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85) at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267) at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46) at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103) at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40) ... 30 more can this be the reason of the SecurityException? If yes, how can i solve this?

          Oleg Nenashev added a comment -

          jens_mueller Agent logs on agents are not being generated by default for some agent types. You can find some guidelines about enabling logging for Remoting here...

          Regarding the LDAP issue, I doubt it is a root cause. But it seems to be another symptom that something is wrong with Guice on the instance. Could you please provide full system log starting from startup and the list of installed plugins?

          Oleg Nenashev added a comment - jens_mueller Agent logs on agents are not being generated by default for some agent types. You can find some guidelines about enabling logging for Remoting here... https://speakerdeck.com/onenashev/day-of-jenkins-2017-dealing-with-agent-connectivity-issues?slide=52 https://support.cloudbees.com/hc/en-us/articles/115001369667-dedicated-SSH-agents-formerly-slaves-get-disconnected https://support.cloudbees.com/hc/en-us/articles/115001416548-dedicated-JNLP-agents-formerly-slaves-get-disconnected Regarding the LDAP issue, I doubt it is a root cause. But it seems to be another symptom that something is wrong with Guice on the instance. Could you please provide full system log starting from startup and the list of installed plugins?

            oleg_nenashev Oleg Nenashev
            jens_mueller Jens Müller
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: