aws / aws/aws-toolkit-azure-devops

error parsing HTTP 403 response body: unexpected end of JSON input: "" when push image to ecr

Open
#311 7 comments 2 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
258
Forks
114
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
I can not upload my image from azure devops to aws ecr

**To reproduce**

2019-11-28T18:34:36.0850956Z ##[section]Starting: Push Image: latest
2019-11-28T18:34:36.0854117Z ==============================================================================
2019-11-28T18:34:36.0854220Z Task : Amazon ECR Push
2019-11-28T18:34:36.0854276Z Description : Push a Docker image to an Amazon Elastic Container Registry on AWS
2019-11-28T18:34:36.0854352Z Version : 1.5.0
2019-11-28T18:34:36.0854400Z Author : Amazon Web Services
2019-11-28T18:34:36.0854537Z Help : Please refer to [Amazon Elastic Container Registry](https://docs.aws.amazon.com/AmazonECR/latest/userguide/) documentation for working with this service.

More information on this task can be found in the [task reference](https://docs.aws.amazon.com/vsts/latest/userguide/ecr-pushimage.html).

####Task Permissions
This task requires permissions to call the following AWS service APIs (depending on selected task options, not all APIs may be used):
* ecr:DescribeRepositories
* ecr:CreateRepository
* ecr:GetAuthorizationToken
2019-11-28T18:34:36.0854910Z ==============================================================================
2019-11-28T18:34:36.4034903Z Configuring credentials for task
2019-11-28T18:34:36.4040620Z 91a5d750-74c1-47c1-9738-38125f5bf13a exists true
2019-11-28T18:34:36.4042384Z ...configuring AWS credentials from service endpoint '91a5d750-74c1-47c1-9738-38125f5bf13a'
2019-11-28T18:34:36.4042487Z ...endpoint defines standard access/secret key credentials
2019-11-28T18:34:36.4065167Z Configuring region for task
2019-11-28T18:34:36.4068292Z ...configured to use region us-east-1, defined in task.
2019-11-28T18:34:36.4159990Z Pushing image 'brasil317-odin-svc:latest'
2019-11-28T18:34:36.4164294Z Obtaining authentication token for ECR login
2019-11-28T18:34:37.2408133Z Testing existence of repository 'brasil317-odin-svc'
2019-11-28T18:34:37.7461702Z Adding tag '999999999999.dkr.ecr.us-east-1.amazonaws.com/brasil317-odin-svc:latest' to image 'brasil317-odin-svc:latest'
2019-11-28T18:34:37.7463673Z Invoking '/opt/hostedtoolcache/docker-stable/17.9.0-ce/x64/docker' with command 'tag'
2019-11-28T18:34:37.7479916Z [command]/opt/hostedtoolcache/docker-stable/17.9.0-ce/x64/docker tag brasil317-odin-svc:latest 999999999999.dkr.ecr.us-east-1.amazonaws.com/brasil317-odin-svc:latest
2019-11-28T18:34:37.7720571Z Invoking '/opt/hostedtoolcache/docker-stable/17.9.0-ce/x64/docker' with command 'login'
2019-11-28T18:34:39.0661318Z Pushing image '999999999999.dkr.ecr.us-east-1.amazonaws.com/brasil317-odin-svc:latest' to Elastic Container Registry
2019-11-28T18:34:39.0662011Z Invoking '/opt/hostedtoolcache/docker-stable/17.9.0-ce/x64/docker' with command 'push'
2019-11-28T18:34:39.0687661Z [command]/opt/hostedtoolcache/docker-stable/17.9.0-ce/x64/docker push 999999999999.dkr.ecr.us-east-1.amazonaws.com/brasil317-odin-svc:latest
2019-11-28T18:34:39.0952156Z The push refers to repository [999999999999.dkr.ecr.us-east-1.amazonaws.com/brasil317-odin-svc]
2019-11-28T18:34:39.5776826Z 8fb7077905f4: Preparing
2019-11-28T18:34:39.5778400Z 5534385be237: Preparing
2019-11-28T18:34:39.5778547Z 0dadcf4d9cca: Preparing
2019-11-28T18:34:39.5778664Z 7aec04de5457: Preparing
2019-11-28T18:34:39.5779016Z a74cc5d23d85: Preparing
2019-11-28T18:34:39.5779350Z 975d2c9c8b2c: Preparing
2019-11-28T18:34:39.5779530Z 4cc0dcd1fc04: Preparing
2019-11-28T18:34:39.5779694Z ff069951ece4: Preparing
2019-11-28T18:34:39.5779915Z ade02cbbac9a: Preparing
2019-11-28T18:34:39.5780072Z e36299e0cdf7: Preparing
2019-11-28T18:34:39.5780361Z 1be02b18dfe7: Preparing
2019-11-28T18:34:39.5780520Z 831c5620387f: Preparing
2019-11-28T18:34:39.5780735Z ff069951ece4: Waiting
2019-11-28T18:34:39.5780897Z ade02cbbac9a: Waiting
2019-11-28T18:34:39.5781337Z e36299e0cdf7: Waiting
2019-11-28T18:34:39.5781499Z 1be02b18dfe7: Waiting
2019-11-28T18:34:39.5781709Z 831c5620387f: Waiting
2019-11-28T18:34:39.5781866Z 975d2c9c8b2c: Waiting
2019-11-28T18:34:39.5782021Z 4cc0dcd1fc04: Waiting
2019-11-28T18:34:42.1361943Z error parsing HTTP 403 response body: unexpected end of JSON input: ""
2019-11-28T18:34:42.1473731Z ##[error]Error: The process '/opt/hostedtoolcache/docker-stable/17.9.0-ce/x64/docker' failed with exit code 1
2019-11-28T18:34:42.1485598Z ##[section]Finishing: Push Image: latest

**Expected behavior**
should work upload image to ecr

**Screenshots**
![image](https://user-images.githubusercontent.com/3118165/69827553-9654fa80-11f6-11ea-9957-e0f45beab996.png)

![image](https://user-images.githubusercontent.com/3118165/69827447-44ac7000-11f6-11ea-82d1-cac305876cd9.png)
![image](https://user-images.githubusercontent.com/3118165/69827462-4fff9b80-11f6-11ea-8b0d-3a493aa1b5b8.png)
![image](https://user-images.githubusercontent.com/3118165/69827512-70c7f100-11f6-11ea-866f-a3512cf14f16.png)

**Your Environment**
Azure Devops with latest version

**Additional context**

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the Amazon ECR Push task in Azure DevOps with the Docker image and command shown in the log, then inspect the task entry point that invokes Docker push. Compare the HTTP 403 response handling with the reported empty body. Done means the task reports a useful failure or successfully pushes the image to ECR.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, azure, docker
Domain
ci-cd, cloud, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.