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

JDK11 ea - Windows CPU process time metrics exception

    • Icon: Improvement Improvement
    • Resolution: Duplicate
    • Icon: Minor Minor
    • metrics-plugin
    • WIndows 10
      Java 11 early access 28
      Jenkins jar 2.138.1

      While executing Windows tests of Jenkins 2.138.1 using Java 11 early access build 28, the initial startup log reports:

      1) Error injecting constructor, java.lang.reflect.InaccessibleObjectException: Unable to make public long com.sun.management.internal.OperatingSystemImpl.getProcessCpuTime() accessible: module jdk.management does not "opens com.sun.management.internal" to unnamed module @12699cdc
        at jenkins.metrics.impl.VMMetricProviderImpl.<init>(VMMetricProviderImpl.java:61)
      
      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:432)
              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:394)
              at hudson.ExtensionFinder$GuiceFinder.find(ExtensionFinder.java:385)
              at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:493)
              at hudson.ExtensionList.load(ExtensionList.java:380)
              at hudson.ExtensionList.ensureLoaded(ExtensionList.java:318)
              at hudson.ExtensionList.iterator(ExtensionList.java:172)
              at jenkins.metrics.api.MetricProviderListener.onChange(MetricProviderListener.java:87)
              at jenkins.metrics.api.MetricProviderListener.attach(MetricProviderListener.java:77)
              at jenkins.metrics.api.Metrics.afterExtensionsAugmented(Metrics.java:294)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.base/java.lang.reflect.Method.invoke(Method.java:566)
              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:296)
              at jenkins.model.Jenkins$5.runTask(Jenkins.java:1066)
      

          [JENKINS-53688] JDK11 ea - Windows CPU process time metrics exception

          markewaite I strongly suspect this one is actually:

          FTR, I arrived here after googling and searching an existing for something I've seen already with Evergreen Java 11 flavor, and just now in a local test:

          nov. 29, 2018 10:59:35 PM hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1 errorWARNING: Failed to instantiate Key[type=jenkins.metrics.impl.VMMetricProviderImpl, annotation=[none]]; skipping this component
          com.google.inject.ProvisionException: Unable to provision, see the following errors:
          
          1) Error injecting constructor, java.lang.reflect.InaccessibleObjectException: Unable to make public long com.sun.management.internal.OperatingSystemImpl.getProcessCpuTime() accessible: module jdk.management does not "opens com.sun.manage
          ment.internal" to unnamed module @41b1dccd
            at jenkins.metrics.impl.VMMetricProviderImpl.<init>(VMMetricProviderImpl.java:61)
          
          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:440)        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:402)
                  at hudson.ExtensionFinder$GuiceFinder.find(ExtensionFinder.java:393)
                  at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:494)
                  at hudson.ExtensionList.load(ExtensionList.java:380)
                  at hudson.ExtensionList.ensureLoaded(ExtensionList.java:318)
                  at hudson.ExtensionList.iterator(ExtensionList.java:172)
                  at jenkins.metrics.api.Metrics.afterExtensionsAugmented(Metrics.java:335)
                  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                  at java.base/java.lang.reflect.Method.invoke(Method.java:566)
                  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:296)
                  at jenkins.model.Jenkins$5.runTask(Jenkins.java:1069)
                  at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)
                  at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)        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:834)
          Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make public long com.sun.management.internal.OperatingSystemImpl.getProcessCpuTime() accessible: module jdk.management does not "opens com.sun.management.internal" to unnamed module @41b1dccd
                  at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:340)
                  at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:280)        at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:198)
                  at java.base/java.lang.reflect.Method.setAccessible(Method.java:192)
                  at jenkins.metrics.impl.VMMetricProviderImpl$CpuUsageGauge.<init>(VMMetricProviderImpl.java:226)        at jenkins.metrics.impl.VMMetricProviderImpl.<init>(VMMetricProviderImpl.java:71)
                  at jenkins.metrics.impl.VMMetricProviderImpl$$FastClassByGuice$$bd4f8b03.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.access$000(ConstructorInjector.java:32)
                  at com.google.inject.internal.ConstructorInjector$1.call(ConstructorInjector.java:89)        at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
                  at hudson.ExtensionFinder$GuiceFinder$SezpozModule.onProvision(ExtensionFinder.java:567)
                  at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:126)
                  at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
                  at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:87)
                  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)
                  ... 26 more
          

          Baptiste Mathus added a comment - markewaite I strongly suspect this one is actually: a duplicate of JENKINS-52017 (which should IMO be reopened, but I'm interested about what you think before I proceed) an issue on the metrics-plugin component instead of core caused by https://github.com/jenkinsci/metrics-plugin/blob/d9b0eb3c576dd1aeff3bff113ca9cd0253aef40f/src/main/java/jenkins/metrics/impl/VMMetricProviderImpl.java#L226 FTR, I arrived here after googling and searching an existing for something I've seen already with Evergreen Java 11 flavor, and just now in a local test: nov. 29, 2018 10:59:35 PM hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1 errorWARNING: Failed to instantiate Key[type=jenkins.metrics.impl.VMMetricProviderImpl, annotation=[none]]; skipping this component com.google.inject.ProvisionException: Unable to provision, see the following errors: 1) Error injecting constructor, java.lang.reflect.InaccessibleObjectException: Unable to make public long com.sun.management.internal.OperatingSystemImpl.getProcessCpuTime() accessible: module jdk.management does not "opens com.sun.manage ment.internal" to unnamed module @41b1dccd at jenkins.metrics.impl.VMMetricProviderImpl.<init>(VMMetricProviderImpl.java:61) 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:440) 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:402) at hudson.ExtensionFinder$GuiceFinder.find(ExtensionFinder.java:393) at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:494) at hudson.ExtensionList.load(ExtensionList.java:380) at hudson.ExtensionList.ensureLoaded(ExtensionList.java:318) at hudson.ExtensionList.iterator(ExtensionList.java:172) at jenkins.metrics.api.Metrics.afterExtensionsAugmented(Metrics.java:335) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) 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:296) at jenkins.model.Jenkins$5.runTask(Jenkins.java:1069) at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214) at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117) 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:834) Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make public long com.sun.management.internal.OperatingSystemImpl.getProcessCpuTime() accessible: module jdk.management does not "opens com.sun.management.internal" to unnamed module @41b1dccd at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:340) at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:280) at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:198) at java.base/java.lang.reflect.Method.setAccessible(Method.java:192) at jenkins.metrics.impl.VMMetricProviderImpl$CpuUsageGauge.<init>(VMMetricProviderImpl.java:226) at jenkins.metrics.impl.VMMetricProviderImpl.<init>(VMMetricProviderImpl.java:71) at jenkins.metrics.impl.VMMetricProviderImpl$$FastClassByGuice$$bd4f8b03.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.access$000(ConstructorInjector.java:32) at com.google.inject.internal.ConstructorInjector$1.call(ConstructorInjector.java:89) at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115) at hudson.ExtensionFinder$GuiceFinder$SezpozModule.onProvision(ExtensionFinder.java:567) at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:126) at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68) at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:87) 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) ... 26 more

          Mark Waite added a comment -

          It makes sense to me to close this report as a duplicate of JENKINS-52017 and fix it there. The setAccessible call that you identified certainly seems like the issue to me.

          Mark Waite added a comment - It makes sense to me to close this report as a duplicate of JENKINS-52017 and fix it there. The setAccessible call that you identified certainly seems like the issue to me.

            Unassigned Unassigned
            markewaite Mark Waite
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: