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

credentialsbinding does not work with "build periodically"

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Duplicate
    • Labels:
    • Environment:
    • Similar Issues:

      Description

      Hello,

      Here is the jenkins job:

      pipeline {
          agent any
          
          stages {
              stage('shared-msac-demo') {
                  steps {
                      build(
                          job: 'full_cycle', 
                          parameters: [
                              string(name: 'stage', value: 'PROD'),
                              string(name: 'env_type', value: 'shared-msac-demo'),
                              credentials(name: 'opentlc_credentials', value: 'xxxxID'),
                              credentials(name: 'imap_credentials', value: 'xxxxID'),
                              credentials(name: 'ssh_credentials', value: 'xxxxID')
                          ]
                      )
                  }
              }
          }
      }

      This job works when i trigger the build using the "Build Now" button.

      But when run using the "Build periodically" option, a sub-job, called by the full_cycle job, fails with the following:

      FATAL: ${OPENTLC_CREDENTIALS}
      org.jenkinsci.plugins.credentialsbinding.impl.CredentialNotFoundException: ${OPENTLC_CREDENTIALS}
          at org.jenkinsci.plugins.credentialsbinding.MultiBinding.getCredentials(MultiBinding.java:153)
          at org.jenkinsci.plugins.credentialsbinding.impl.UsernamePasswordMultiBinding.bind(UsernamePasswordMultiBinding.java:76)
          at org.jenkinsci.plugins.credentialsbinding.impl.SecretBuildWrapper.setUp(SecretBuildWrapper.java:88)
          at hudson.model.Build$BuildExecution.doRun(Build.java:157)
          at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
          at hudson.model.Run.execute(Run.java:1724)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          at hudson.model.ResourceController.execute(ResourceController.java:97)
          at hudson.model.Executor.run(Executor.java:429)
      Finished: FAILURE

       

      I checked the parameters passed to that sub-job, and OPENTLC_CREDENTIALS is properly set, see attachment.

      I also tested Credentials bindings plugin 1.13: same issue.

       

        Attachments

          Issue Links

            Activity

            Hide
            fridim Guillaume Coré added a comment -

            potential duplicate of JENKINS-32402

            Show
            fridim Guillaume Coré added a comment - potential duplicate of JENKINS-32402

              People

              • Assignee:
                Unassigned
                Reporter:
                fridim Guillaume Coré
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: