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

Unable to find credential at Global Instance Level

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None

      I am trying to pass a Jenkins Credentials ID to an "httpRequest" Jenkins step and it works flawlessly a for standard "Username with password" type. However if I use "Conjur Secret Username" type I am getting an error:

       

      org.conjur.jenkins.exceptions.InvalidConjurSecretException: Unable to find credential at Global Instance Level
      at org.conjur.jenkins.conjursecrets.ConjurSecretCredentials.credentialWithID(ConjurSecretCredentials.java:96)
      at org.conjur.jenkins.conjursecrets.ConjurSecretCredentials.getSecretFromCredentialIDWithConfigAndContext(ConjurSecretCredentials.java:116)
      at org.conjur.jenkins.conjursecrets.ConjurSecretUsernameCredentialsImpl.getPassword(ConjurSecretUsernameCredentialsImpl.java:114)
      at jenkins.plugins.http_request.auth.CredentialBasicAuthentication.prepare(CredentialBasicAuthentication.java:63)
      at jenkins.plugins.http_request.auth.CredentialBasicAuthentication.prepare(CredentialBasicAuthentication.java:58)
      at jenkins.plugins.http_request.auth.CredentialBasicAuthentication.authenticate(CredentialBasicAuthentication.java:53)
      at jenkins.plugins.http_request.HttpRequestExecution.auth(HttpRequestExecution.java:384)
      at jenkins.plugins.http_request.HttpRequestExecution.authAndRequest(HttpRequestExecution.java:326)
      at jenkins.plugins.http_request.HttpRequestExecution.call(HttpRequestExecution.java:260)
      at jenkins.plugins.http_request.HttpRequestExecution.call(HttpRequestExecution.java:80)
      at hudson.remoting.LocalChannel.call(LocalChannel.java:46)
      at jenkins.plugins.http_request.HttpRequestStep$Execution.run(HttpRequestStep.java:380)
      at jenkins.plugins.http_request.HttpRequestStep$Execution.run(HttpRequestStep.java:358)
      at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
      at hudson.security.ACL.impersonate2(ACL.java:449)
      at hudson.security.ACL.impersonate(ACL.java:461)
      at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)
      Finished: FAILURE

       

      If I first do a dummy "withCredentials" call and then the "httpRequest" it starts working. It keeps working even if I remove the dummy call, until I restart the Jenkins instance.

      Please find a sample Jenkinsfile in the attachments.

        1. Jenkinsfile
          0.9 kB
          Stanislav Bebej

            cyberark_bizdev Edward Nunez
            stanislav_bebej Stanislav Bebej
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: