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

Calling SoftwareTrustManagerSetup() causes java.lang.IllegalStateException: Jenkins.instance is missing

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • None

      Following the instructions at https://docs.digicert.com/en/software-trust-manager/ci-cd-integrations/plugins/jenkins-plugin-for-keypair-signing.html

       

      When the pipeline runs:

        stage('Set Up Software Trust Manager') { 
          steps { 
            SoftwareTrustManagerSetup() 
          }
        }
      

      It throws an exception:

      hudson.remoting.ProxyException: java.lang.IllegalStateException: Jenkins.instance is missing. Read the documentation of Jenkins.getInstanceOrNull to see what you are doing wrong.
      at jenkins.model.Jenkins.get(Jenkins.java:824)
      at io.jenkins.plugins.digicert.AgentInfo.getCredential(AgentInfo.java:45)
      at io.jenkins.plugins.digicert.AgentInfo.getValue(AgentInfo.java:51)
      at io.jenkins.plugins.digicert.AgentInfo.call(AgentInfo.java:64)
      at io.jenkins.plugins.digicert.AgentInfo.call(AgentInfo.java:25)
      at hudson.remoting.UserRequest.perform(UserRequest.java:211)
      at hudson.remoting.UserRequest.perform(UserRequest.java:54)
      at hudson.remoting.Request$2.run(Request.java:377)
      at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
      at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
      at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:137)
      at java.base/java.lang.Thread.run(Thread.java:1583)

       

      Start of Jenkins file is:

       

      pipeline {
        agent {
          node {
            label 'windows'
          }
        }
        environment {
          SM_API_KEY = credentials('SM_API_KEY')
          SM_HOST = credentials('SM_HOST')
          SM_CLIENT_CERT_PASSWORD = credentials('SM_CLIENT_CERT_PASSWORD')
          SM_CLIENT_CERT_FILE = credentials('SM_CLIENT_CERT_FILE')
        }
        stages {
          stage('Set up Software Trust Manager') {
            steps {
              SoftwareTrustManagerSetup()
            }
          }
      

      I also tried moving this stage to later in the build, but get the same exception.

       

          [JENKINS-73368] Calling SoftwareTrustManagerSetup() causes java.lang.IllegalStateException: Jenkins.instance is missing

          Steven Green created issue -
          Steven Green made changes -
          Description Original: Following the instructions at [https://docs.digicert.com/en/software-trust-manager/ci-cd-integrations/plugins/jenkins-plugin-for-keypair-signing.html]

           

          When the pipeline runs:
                  stage('Set Up Software Trust Manager') { steps { SoftwareTrustManagerSetup() } }
          It throws an exception:
          hudson.remoting.ProxyException: java.lang.IllegalStateException: Jenkins.instance is missing. Read the documentation of Jenkins.getInstanceOrNull to see what you are doing wrong.
          at jenkins.model.Jenkins.get(Jenkins.java:824)
          at io.jenkins.plugins.digicert.AgentInfo.getCredential(AgentInfo.java:45)
          at io.jenkins.plugins.digicert.AgentInfo.getValue(AgentInfo.java:51)
          at io.jenkins.plugins.digicert.AgentInfo.call(AgentInfo.java:64)
          at io.jenkins.plugins.digicert.AgentInfo.call(AgentInfo.java:25)
          at hudson.remoting.UserRequest.perform(UserRequest.java:211)
          at hudson.remoting.UserRequest.perform(UserRequest.java:54)
          at hudson.remoting.Request$2.run(Request.java:377)
          at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
          at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
          at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
          at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
          at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:137)
          at java.base/java.lang.Thread.run(Thread.java:1583)
           

          Start of Jenkins file is:

           
          {noformat}
          pipeline {
            agent {
              node {
                label 'windows'
              }
            }
            environment {
              SM_API_KEY = credentials('SM_API_KEY')
              SM_HOST = credentials('SM_HOST')
              SM_CLIENT_CERT_PASSWORD = credentials('SM_CLIENT_CERT_PASSWORD')
              SM_CLIENT_CERT_FILE = credentials('SM_CLIENT_CERT_FILE')
            }
            stages {
              stage('Set up Software Trust Manager') {
                steps {
                  SoftwareTrustManagerSetup()
                }
              }
          {noformat}
          I also tried moving this stage to later in the build, but get the same exception.

           
          New: Following the instructions at [https://docs.digicert.com/en/software-trust-manager/ci-cd-integrations/plugins/jenkins-plugin-for-keypair-signing.html]

           

          When the pipeline runs:
          {code:java}
            stage('Set Up Software Trust Manager') {
              steps {
                SoftwareTrustManagerSetup()
              }
            }
          {code}
          It throws an exception:
          {noformat}
          hudson.remoting.ProxyException: java.lang.IllegalStateException: Jenkins.instance is missing. Read the documentation of Jenkins.getInstanceOrNull to see what you are doing wrong.
          at jenkins.model.Jenkins.get(Jenkins.java:824)
          at io.jenkins.plugins.digicert.AgentInfo.getCredential(AgentInfo.java:45)
          at io.jenkins.plugins.digicert.AgentInfo.getValue(AgentInfo.java:51)
          at io.jenkins.plugins.digicert.AgentInfo.call(AgentInfo.java:64)
          at io.jenkins.plugins.digicert.AgentInfo.call(AgentInfo.java:25)
          at hudson.remoting.UserRequest.perform(UserRequest.java:211)
          at hudson.remoting.UserRequest.perform(UserRequest.java:54)
          at hudson.remoting.Request$2.run(Request.java:377)
          at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
          at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
          at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
          at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
          at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:137)
          at java.base/java.lang.Thread.run(Thread.java:1583){noformat}
           

          Start of Jenkins file is:

           
          {noformat}
          pipeline {
            agent {
              node {
                label 'windows'
              }
            }
            environment {
              SM_API_KEY = credentials('SM_API_KEY')
              SM_HOST = credentials('SM_HOST')
              SM_CLIENT_CERT_PASSWORD = credentials('SM_CLIENT_CERT_PASSWORD')
              SM_CLIENT_CERT_FILE = credentials('SM_CLIENT_CERT_FILE')
            }
            stages {
              stage('Set up Software Trust Manager') {
                steps {
                  SoftwareTrustManagerSetup()
                }
              }
          {noformat}
          I also tried moving this stage to later in the build, but get the same exception.

           
          vinay made changes -
          Released As New: https://github.com/jenkinsci/digicert-software-trust-code-sign-plugin/releases/tag/15.v57c7ff9398ea
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

            vmummadi vinay
            greenius Steven Green
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: