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

Disabling Jenkins CLI by updating groovy script throwing long error messages , for fixing SECURITY-3314-3315

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Blocker Blocker
    • cli
    • None

      • We have tried using the workaround given in page "https://github.com/jenkinsci-cert/SECURITY-3314-3315/blob/main/disable-cli.groovy".
      • We have added this as part of init.groovy and we start the jenkins server using the command "java -jar /usr/share/java/jenkins.war --httpPort=8080" 
      • The below are the error messages coming:
        • Feb 19, 2024 1:40:17 PM INFO hudson.WebAppMain contextInitializedJenkins home directory: /var/lib/jenkins/.jenkins found at: $user.home/.jenkins
          Feb 19, 2024 1:40:17 PM INFO org.eclipse.jetty.server.handler.ContextHandler doStartStarted w.@5d8445d7{Jenkins v2.445,/,file:///var/lib/jenkins/.jenkins/war/,AVAILABLE}

          {/var/lib/jenkins/.jenkins/war}

          Feb 19, 2024 1:40:17 PM INFO org.eclipse.jetty.server.AbstractConnector doStartStarted ServerConnector@5cdd8682{HTTP/1.1, (http/1.1)}

          {0.0.0.0:8080}

          Feb 19, 2024 1:40:17 PM INFO org.eclipse.jetty.util.ssl.SslContextFactory loadx509=X509@5bbc9f97(1,h=[localhost ],a=[/127.0.0.1, ],w=[]) for Server@133e019b[provider=null,keyStore=null,trustStore=null]
          Feb 19, 2024 1:40:17 PM INFO org.eclipse.jetty.server.AbstractConnector doStartStarted ServerConnector@55ca8de8{SSL, (ssl, http/1.1)}

          {0.0.0.0:8443}

          Feb 19, 2024 1:40:17 PM INFO org.eclipse.jetty.server.Server doStartStarted Server@17c386de{STARTING}[10.0.20,sto=0] @2179ms
          Feb 19, 2024 1:40:17 PM INFO winstone.Logger logInternalWinstone Servlet Engine running: controlPort=disabled
          Feb 19, 2024 1:40:17 PM INFO jenkins.InitReactorRunner$1 onAttainedStarted initialization
          Feb 19, 2024 1:40:18 PM INFO jenkins.InitReactorRunner$1 onAttainedListed all plugins
          Feb 19, 2024 1:40:22 PM INFO jenkins.InitReactorRunner$1 onAttainedPrepared all plugins
          Feb 19, 2024 1:40:22 PM INFO jenkins.InitReactorRunner$1 onAttainedStarted all plugins
          Feb 19, 2024 1:40:22 PM INFO jenkins.InitReactorRunner$1 onAttainedAugmented all extensions
          Feb 19, 2024 1:40:23 PM INFO jenkins.InitReactorRunner$1 onAttainedSystem config loaded
          Feb 19, 2024 1:40:23 PM INFO jenkins.InitReactorRunner$1 onAttainedSystem config adapted
          Feb 19, 2024 1:40:24 PM INFO jenkins.InitReactorRunner$1 onAttainedLoaded all jobs
          Feb 19, 2024 1:40:24 PM INFO jenkins.InitReactorRunner$1 onAttainedConfiguration for all jobs updated
          Feb 19, 2024 1:40:24 PM INFO jenkins.util.groovy.GroovyHookScript executeExecuting /var/lib/jenkins/.jenkins/init.groovy
          Feb 19, 2024 1:40:24 PM INFO hudson.util.Retrier startAttempt #1 to do the action check updates server
          Feb 19, 2024 1:40:24 PM INFO hudson.util.Retrier startThe attempt #1 to do the action check updates server failed with an allowed exception: java.net.SocketException: Network is unreachable at java.base/sun.nio.ch.Net.pollConnect(Native Method) at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:672) at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:554) at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:602) at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327) at java.base/java.net.Socket.connect(Socket.java:633) at java.base/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:304) at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:178) at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:534) at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:639) at java.base/sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:266) at java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:380) at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:193) at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1242) at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1128) at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:179) at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1665) at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1589) at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224) at hudson.model.DownloadService.loadJSON(DownloadService.java:122) at hudson.model.UpdateSite.updateDirectlyNow(UpdateSite.java:218) at hudson.model.UpdateSite.updateDirectlyNow(UpdateSite.java:213) at hudson.PluginManager.checkUpdatesServer(PluginManager.java:2091) at hudson.util.Retrier.start(Retrier.java:62) at hudson.PluginManager.doCheckUpdatesServer(PluginManager.java:2062) at jenkins.DailyCheck.execute(DailyCheck.java:93) at hudson.model.AsyncPeriodicWork.lambda$doRun$0(AsyncPeriodicWork.java:102) at java.base/java.lang.Thread.run(Thread.java:842)
          Feb 19, 2024 1:40:24 PM INFO hudson.util.Retrier startCalling the listener of the allowed exception 'Network is unreachable' at the attempt #1 to do the action check updates server
          Feb 19, 2024 1:40:24 PM INFO hudson.util.Retrier startAttempted the action check updates server for 1 time(s) with no success
          Feb 19, 2024 1:40:24 PM SEVERE hudson.PluginManager doCheckUpdatesServerError checking update sites for 1 attempt(s). Last exception was: SocketException: Network is unreachable
          Feb 19, 2024 1:40:27 PM WARNING hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1 errorFailed to instantiate Key[type=io.jenkins.blueocean.rest.impl.pipeline.scm.ScmContainer, annotation=[none]]; skipping this component java.lang.NullPointerException: Cannot invoke "org.kohsuke.stapler.StaplerRequest.findAncestor(java.lang.Class)" because the return value of "org.kohsuke.stapler.Stapler.getCurrentRequest()" is null at io.jenkins.blueocean.rest.impl.pipeline.scm.ScmContainer.<init>(ScmContainer.java:28) at io.jenkins.blueocean.rest.impl.pipeline.scm.ScmContainer$$FastClassByGuice$$44c30b34.GUICE$TRAMPOLINE(<generated>) at io.jenkins.blueocean.rest.impl.pipeline.scm.ScmContainer$$FastClassByGuice$$44c30b34.apply(<generated>) at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:82) at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:114) at com.google.inject.internal.ConstructorInjector.access$000(ConstructorInjector.java:33) at com.google.inject.internal.ConstructorInjector$1.call(ConstructorInjector.java:98) at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:109) at hudson.ExtensionFinder$GuiceFinder$SezpozModule.onProvision(ExtensionFinder.java:610) at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:117) at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:66) at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:93) at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:300) at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40) Caused: com.google.inject.ProvisionException: Unable to provision, see the following errors: 1) [Guice/ErrorInjectingConstructor]: NullPointerException: Cannot invoke "org.kohsuke.stapler.StaplerRequest.findAncestor(java.lang.Class)" because the return value of "org.kohsuke.stapler.Stapler.getCurrentRequest()" is null at ScmContainer.<init>(ScmContainer.java:27) Learn more: https://github.com/google/guice/wiki/ERROR_INJECTING_CONSTRUCTOR 1 error ====================== Full classname legend: ====================== ScmContainer: "io.jenkins.blueocean.rest.impl.pipeline.scm.ScmContainer" ======================== End of classname legend: ======================== at com.google.inject.internal.InternalProvisionException.toProvisionException(InternalProvisionException.java:251) at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:43) at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:169) at hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1.get(ExtensionFinder.java:445) at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:45) at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1148) at hudson.ExtensionFinder$GuiceFinder._find(ExtensionFinder.java:403) at hudson.ExtensionFinder$GuiceFinder.find(ExtensionFinder.java:394) at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:335) at hudson.ExtensionList.load(ExtensionList.java:384) at hudson.ExtensionList.ensureLoaded(ExtensionList.java:320) at hudson.ExtensionList.iterator(ExtensionList.java:172) at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2110) at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2151) at org.codehaus.groovy.runtime.dgm$163.invoke(Unknown Source) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128) at init$_run_closure4.doCall(init.groovy:135) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:264) 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.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128) at init.run(init.groovy:144) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:574) at jenkins.util.groovy.GroovyHookScript.execute(GroovyHookScript.java:139) at jenkins.util.groovy.GroovyHookScript.execute(GroovyHookScript.java:128) at jenkins.util.groovy.GroovyHookScript.run(GroovyHookScript.java:102) at hudson.init.impl.GroovyInitScript.init(GroovyInitScript.java:42) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:109) at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:185) at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:305) at jenkins.model.Jenkins$5.runTask(Jenkins.java:1170) at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:221) at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:120) at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:842)
          Feb 19, 2024 1:40:28 PM WARNING hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1 errorFailed to instantiate Key[type=io.jenkins.blueocean.rest.impl.pipeline.scm.ScmContainer, annotation=[none]]; skipping this component java.lang.NullPointerException: Cannot invoke "org.kohsuke.stapler.StaplerRequest.findAncestor(java.lang.Class)" because the return value of "org.kohsuke.stapler.Stapler.getCurrentRequest()" is null at io.jenkins.blueocean.rest.impl.pipeline.scm.ScmContainer.<init>(ScmContainer.java:28) at io.jenkins.blueocean.rest.impl.pipeline.scm.ScmContainer$$FastClassByGuice$$44c30b34.GUICE$TRAMPOLINE(<generated>) at io.jenkins.blueocean.rest.impl.pipeline.scm.ScmContainer$$FastClassByGuice$$44c30b34.apply(<generated>) at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:82) at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:114) at com.google.inject.internal.ConstructorInjector.access$000(ConstructorInjector.java:33) at com.google.inject.internal.ConstructorInjector$1.call(ConstructorInjector.java:98) at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:109) at hudson.ExtensionFinder$GuiceFinder$SezpozModule.onProvision(ExtensionFinder.java:610) at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:117) at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:66) at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:93) at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:300) at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40) Caused: com.google.inject.ProvisionException: Unable to provision, see the following errors: 1) [Guice/ErrorInjectingConstructor]: NullPointerException: Cannot invoke "org.kohsuke.stapler.StaplerRequest.findAncestor(java.lang.Class)" because the return value of "org.kohsuke.stapler.Stapler.getCurrentRequest()" is null at ScmContainer.<init>(ScmContainer.java:27) Learn more: https://github.com/google/guice/wiki/ERROR_INJECTING_CONSTRUCTOR 1 error ====================== Full classname legend: ====================== ScmContainer: "io.jenkins.blueocean.rest.impl.pipeline.scm.ScmContainer" ======================== End of classname legend: ======================== at com.google.inject.internal.InternalProvisionException.toProvisionException(InternalProvisionException.java:251) at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:43) at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:169) at hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1.get(ExtensionFinder.java:445) at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:45) at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1148) at hudson.ExtensionFinder$GuiceFinder._find(ExtensionFinder.java:403) at hudson.ExtensionFinder$GuiceFinder.find(ExtensionFinder.java:394) at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:335) at hudson.ExtensionList.load(ExtensionList.java:384) at hudson.ExtensionList.ensureLoaded(ExtensionList.java:320) at hudson.ExtensionList.iterator(ExtensionList.java:172) at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2110) at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2151) at org.codehaus.groovy.runtime.dgm$163.invoke(Unknown Source) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128) at init$_run_closure4.doCall(init.groovy:135) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:264) 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.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128) at init.run(init.groovy:149) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:574) at jenkins.util.groovy.GroovyHookScript.execute(GroovyHookScript.java:139) at jenkins.util.groovy.GroovyHookScript.execute(GroovyHookScript.java:128) at jenkins.util.groovy.GroovyHookScript.run(GroovyHookScript.java:102) at hudson.init.impl.GroovyInitScript.init(GroovyInitScript.java:42) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:109) at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:185) at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:305) at jenkins.model.Jenkins$5.runTask(Jenkins.java:1170) at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:221) at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:120) at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:842)
          Feb 19, 2024 1:40:30 PM INFO jenkins.InitReactorRunner$1 onAttainedCompleted initialization
          Feb 19, 2024 1:40:30 PM INFO hudson.lifecycle.Lifecycle onReadyJenkins is fully up and running
          Feb 20, 2024 7:04:57 AM WARNING hudson.init.impl.InstallUncaughtExceptionHandler handleExceptionnull java.io.IOException: Close SendCallback@3a6bc10c[PROCESSING][i=HTTP/1.1\{s=200,h=10,cl=59582},cb=org.eclipse.jetty.server.HttpChannel$SendCallback@50888c7c] in state PROCESSING at org.eclipse.jetty.util.IteratingCallback.close(IteratingCallback.java:444) at org.eclipse.jetty.server.HttpConnection.onClose(HttpConnection.java:556) at org.eclipse.jetty.io.ssl.SslConnection.onClose(SslConnection.java:347) at org.eclipse.jetty.io.SelectorManager.connectionClosed(SelectorManager.java:347) at org.eclipse.jetty.io.ManagedSelector$DestroyEndPoint.run(ManagedSelector.java:1115) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:969) at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1194) at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1149) at java.base/java.lang.Thread.run(Thread.java:842)
          Feb 20, 2024 7:05:15 AM WARNING org.jenkinsci.plugins.workflow.support.steps.input.POSTHyperlinkNote You need to define the root URL of Jenkins
          Feb 20, 2024 7:05:27 AM WARNING org.jenkinsci.plugins.workflow.support.steps.input.POSTHyperlinkNote You need to define the root URL of Jenkins

            Unassigned Unassigned
            harsha_vardhan_987 Harsha
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: