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

Docker Pipeline Plugin withRegistry and Authorize Plugin fails to get credentialsId

    • docker-workflow 1.18

      When using the Authorization Project plugin and using "Run as Specific User" or "Run as User Who Triggered Build" authorize strategy and the following pipeline code:

      node {
        // success
        withCredentials([usernameColonPassword(credentialsId: '$CredentialsID', variable: 'USERPASS')]) {
          println "${USERPASS}"
        }
      
        //failure
        docker.withRegistry('$Url:$Port', '$CredentialsID') {
          def dockerImage = docker.image('$dockerImageID)
          dockerImage.push('test')
        }
      }
      

      We get an error at the docker.withRegistry step:

      ERROR: Could not find credentials matching bonjwa-docker-artl
      

      Note that the previous step withCredentials is successful.

          [JENKINS-48437] Docker Pipeline Plugin withRegistry and Authorize Plugin fails to get credentialsId

          James Sweet created issue -
          James Sweet made changes -
          Description Original: When using the Authorization Project plugin and using "Run as Specific User" or "Run as User Who Triggered Build" authorize strategy and the following pipeline code:

          node {
          // success
          withCredentials([usernameColonPassword(credentialsId: '$CredentialsID', variable: 'USERPASS')]) {
          println "${USERPASS}"
          }

          //failure
          docker.withRegistry('$Url:$Port', '$CredentialsID') {
          def dockerImage = docker.image('e0523c97836a')
          dockerImage.push('test')
          }
          }

          We get an error at the docker.withRegistry step:
          ERROR: Could not find credentials matching bonjwa-docker-artl

          Note that the previous step withCredentials is successful.
          New: When using the Authorization Project plugin and using "Run as Specific User" or "Run as User Who Triggered Build" authorize strategy and the following pipeline code:

          node {
          // success
          withCredentials([usernameColonPassword(credentialsId: '$CredentialsID', variable: 'USERPASS')]) {
          println "${USERPASS}"
          }

          //failure
          docker.withRegistry('$Url:$Port', '$CredentialsID') {
          def dockerImage = docker.image('$dockerImageID)
          dockerImage.push('test')
          }
          }

          We get an error at the docker.withRegistry step:
          ERROR: Could not find credentials matching bonjwa-docker-artl

          Note that the previous step withCredentials is successful.
          Allan BURDAJEWICZ made changes -
          Remote Link New: This issue links to "docker-commons PR#68 (Web Link)" [ 20335 ]
          Allan BURDAJEWICZ made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Allan BURDAJEWICZ made changes -
          Assignee New: Allan BURDAJEWICZ [ allan_burdajewicz ]
          Jesse Glick made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Jesse Glick made changes -
          Description Original: When using the Authorization Project plugin and using "Run as Specific User" or "Run as User Who Triggered Build" authorize strategy and the following pipeline code:

          node {
          // success
          withCredentials([usernameColonPassword(credentialsId: '$CredentialsID', variable: 'USERPASS')]) {
          println "${USERPASS}"
          }

          //failure
          docker.withRegistry('$Url:$Port', '$CredentialsID') {
          def dockerImage = docker.image('$dockerImageID)
          dockerImage.push('test')
          }
          }

          We get an error at the docker.withRegistry step:
          ERROR: Could not find credentials matching bonjwa-docker-artl

          Note that the previous step withCredentials is successful.
          New: When using the Authorization Project plugin and using "Run as Specific User" or "Run as User Who Triggered Build" authorize strategy and the following pipeline code:

          {code}
          node {
            // success
            withCredentials([usernameColonPassword(credentialsId: '$CredentialsID', variable: 'USERPASS')]) {
              println "${USERPASS}"
            }

            //failure
            docker.withRegistry('$Url:$Port', '$CredentialsID') {
              def dockerImage = docker.image('$dockerImageID)
              dockerImage.push('test')
            }
          }
          {code}

          We get an error at the docker.withRegistry step:

          {code:none}
          ERROR: Could not find credentials matching bonjwa-docker-artl
          {code}

          Note that the previous step {{withCredentials}} is successful.
          James Dumay made changes -
          Remote Link New: This issue links to "CloudBees Internal CD-368 (Web Link)" [ 20641 ]
          Allan BURDAJEWICZ made changes -
          Remote Link New: This issue links to "docker-workflow#141 (Web Link)" [ 20707 ]
          Allan BURDAJEWICZ made changes -
          Remote Link Original: This issue links to "docker-workflow#141 (Web Link)" [ 20707 ]
          Allan BURDAJEWICZ made changes -
          Remote Link New: This issue links to "docker-workflow PR#141 (Web Link)" [ 20708 ]

            allan_burdajewicz Allan BURDAJEWICZ
            jtsweet James Sweet
            Votes:
            3 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: