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

Your Authorization Token is invalid.

XMLWordPrintable

    • 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. 

       

       

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

              Created:
              Updated:
              Resolved: