• Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • amazon-ecr-plugin
    • None
    • version 1.6

      I've been trying to use this plugin to push a simple image to my ECR registry with no success. I've verified my credentials numerous times and tried everything I could think of. 

       
      node {
      
        stage 'Build Image'
        def app_name = readFile('app_name')   
        def app_version = readFile('app_version')   
        def app_revision = readFile('app_revision')
        docker.build("${app_name}")
      
        stage 'Push Image'
        docker.withRegistry('https://400585646753.dkr.ecr.us-west-2.amazonaws.com', 'ecr:us-east-2:test-creds') {
          docker.image("${app_name}").push("${app_version}_${app_revision}")
        }
      }

      This always fails with:

      + docker push 400585646753.dkr.ecr.us-west-2.amazonaws.com/test_app:v1.0_1.0
      The push refers to a repository [400585646753.dkr.ecr.us-west-2.amazonaws.com/test_app]
      08c2295a7fa5: Preparing
      denied: Your Authorization Token is invalid.
      

      I've tried enabling the ALL level on the com.cloudbees.jenkins.plugins.amazonecr logger in order to make sure it's using the right ACCESS_KEY and SECRET_KEY however, for some reason the logger never reaches the inside of this if statment. This is very strange since in the logs I can see this stack trace which has the same if statement expression. I'm also positive it reaches that far down the code because I see the "Success" output printed here. I've attached the log to this thread. 

      Any help would greatly appreciated. 

       

       

          [JENKINS-45851] Your Authorization Token is invalid.

          Florin Stingaciu created issue -
          Florin Stingaciu made changes -
          Description Original: I've been trying to use this plugin to push a simple image to my ECR registry with no success. I've verified my credentials numerous times and tried everything I could think of. 

          {code:java}
           
          node {

            stage 'Build Image'
            def app_name = readFile('app_name')  
            def app_version = readFile('app_version')  
            def app_revision = readFile('app_revision')
            docker.build("${app_name}")

            stage 'Push Image'
            docker.withRegistry('https://400585646753.dkr.ecr.us-west-2.amazonaws.com', 'ecr:us-east-2:test-creds') {
            docker.image("${app_name}").push("${app_version}_${app_revision}")
            }
          }{code}
          This always fails with:


          {code:java}
          + docker push 400585646753.dkr.ecr.us-west-2.amazonaws.com/test_app:v1.0_1.0
          The push refers to a repository [400585646753.dkr.ecr.us-west-2.amazonaws.com/test_app]
          08c2295a7fa5: Preparing
          denied: Your Authorization Token is invalid.
          {code}
          I've tried enabling the ALL level on the com.cloudbees.jenkins.plugins.amazonecr logger in order to make sure it's using the right ACCESS_KEY and SECRET_KEY however, for some reason the logger never reaches the inside of this [if statement|[https://github.com/jenkinsci/amazon-ecr-plugin/blob/master/src/main/java/com/cloudbees/jenkins/plugins/amazonecr/AmazonECSRegistryCredential.java#L138].] This is very strange since in the logs I can see [this stack trace|#L123] which has the same if statement expression. I'm also positive it reachest that far down the code because I see the Success output printed [here|https://github.com/jenkinsci/amazon-ecr-plugin/blob/master/src/main/java/com/cloudbees/jenkins/plugins/amazonecr/AmazonECSRegistryCredential.java#L137]. I've attached the log to this thread. 

          Any help would greatly appreciated. 

           

           
          New: I've been trying to use this plugin to push a simple image to my ECR registry with no success. I've verified my credentials numerous times and tried everything I could think of. 
          {code:java}
           
          node {

            stage 'Build Image'
            def app_name = readFile('app_name')  
            def app_version = readFile('app_version')  
            def app_revision = readFile('app_revision')
            docker.build("${app_name}")

            stage 'Push Image'
            docker.withRegistry('https://400585646753.dkr.ecr.us-west-2.amazonaws.com', 'ecr:us-east-2:test-creds') {
            docker.image("${app_name}").push("${app_version}_${app_revision}")
            }
          }{code}
          This always fails with:
          {code:java}
          + docker push 400585646753.dkr.ecr.us-west-2.amazonaws.com/test_app:v1.0_1.0
          The push refers to a repository [400585646753.dkr.ecr.us-west-2.amazonaws.com/test_app]
          08c2295a7fa5: Preparing
          denied: Your Authorization Token is invalid.
          {code}
          I've tried enabling the ALL level on the com.cloudbees.jenkins.plugins.amazonecr logger in order to make sure it's using the right ACCESS_KEY and SECRET_KEY however, for some reason the logger never reaches the inside of this [if statment|https://github.com/jenkinsci/amazon-ecr-plugin/blob/master/src/main/java/com/cloudbees/jenkins/plugins/amazonecr/AmazonECSRegistryCredential.java#L138]. This is very strange since in the logs I can see [this stack trace|#L123] which has the same if statement expression. I'm also positive it reaches that far down the code because I see the "Success" output printed [here|https://github.com/jenkinsci/amazon-ecr-plugin/blob/master/src/main/java/com/cloudbees/jenkins/plugins/amazonecr/AmazonECSRegistryCredential.java#L137]. I've attached the log to this thread. 

          Any help would greatly appreciated. 

           

           
          Ivan Fernandez Calvo made changes -
          Link New: This issue is duplicated by JENKINS-44143 [ JENKINS-44143 ]
          Ivan Fernandez Calvo made changes -
          Resolution New: Duplicate [ 3 ]
          Status Original: Open [ 1 ] New: Closed [ 6 ]
          Ivan Fernandez Calvo made changes -
          Link New: This issue is related to JENKINS-39952 [ JENKINS-39952 ]
          Ivan Fernandez Calvo made changes -
          Link New: This issue is related to JENKINS-38018 [ JENKINS-38018 ]

            ifernandezcalvo Ivan Fernandez Calvo
            stingaci Florin Stingaciu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: