Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: failed to solve: failed commit on ref : unexpected status: 400 Bad Request #200

Closed
luisdavim opened this issue May 10, 2022 · 3 comments · Fixed by #207
Closed

error: failed to solve: failed commit on ref : unexpected status: 400 Bad Request #200

luisdavim opened this issue May 10, 2022 · 3 comments · Fixed by #207
Assignees
Labels
bug Something isn't working

Comments

@luisdavim
Copy link

Orb version

We're on the latest v8.1.x

What happened

Some builds randomly fail when exporting the image:

14 exporting to image
#14 exporting layers
#14 exporting layers 21.7s done
#14 exporting manifest sha256:ff94075293eb9d52c8fd46706ca2e5feac52b0090fd89edab862c3d753a08733 0.0s done
#14 exporting config sha256:0d4473150c63c3e8c96150cc9c30c194c233688c3b22c215fc15a7a6e604985c 0.0s done
#14 pushing layers
#14 pushing layers 14.2s done
#14 pushing manifest for ********************************************/sendoso:1906cef5d55eade44b2fd056657efd5bcef6c83a@sha256:ff94075293eb9d52c8fd46706ca2e5feac52b0090fd89edab862c3d753a08733
#14 pushing manifest for ********************************************/sendoso:1906cef5d55eade44b2fd056657efd5bcef6c83a@sha256:ff94075293eb9d52c8fd46706ca2e5feac52b0090fd89edab862c3d753a08733 0.7s done
#14 ERROR: failed commit on ref "manifest-sha256:ff94075293eb9d52c8fd46706ca2e5feac52b0090fd89edab862c3d753a08733": unexpected status: 400 Bad Request
------
 > exporting to image:
------
error: failed to solve: failed commit on ref "manifest-sha256:ff94075293eb9d52c8fd46706ca2e5feac52b0090fd89edab862c3d753a08733": unexpected status: 400 Bad Request

Exited with code exit status 1

Expected behaviour

The image should be published successfully.

@luisdavim luisdavim added the bug Something isn't working label May 10, 2022
@luisdavim
Copy link
Author

I've done some digging and I think the issue is that we have immutable tags enabled on our ECR repos and we also set skip-when-tags-exist: true on the build and push step but that seems to be ignored and the task will still try to publish a build for a tag that already exists, causing the 400 error response from ECR.

@sidewaiise
Copy link

Had a similar error, where we got a 403 forbidden. Basically when we try to push the image to ECR, under conditions where an older version worked (6.3.x / 7.0.0), it now fails:

#14 exporting to image
#14 sha256:e8c613e07b0b7ff33893b694f7759a10d42e180f2b4dc349fb57dc6b71dcab00
#14 pushing layers 16.8s done
#14 pushing manifest for *************************************************/<repo_name>latest@sha256:1e7623aa9d2d4ba3d1cce8bbc52ef74555b9d3d590688a6b5a6d9161339e02ec
#14 pushing manifest for *************************************************/<repo_name>:latest@sha256:1e7623aa9d2d4ba3d1cce8bbc52ef74555b9d3d590688a6b5a6d9161339e02ec 0.2s done
#14 ERROR: unexpected status: 403 Forbidden
------
 > exporting to image:
------
error: failed to solve: rpc error: code = Unknown desc = unexpected status: 403 Forbidden

Exited with code exit status 1

sapslaj added a commit to sapslaj/aws-ecr-orb that referenced this issue Jun 8, 2022
The issue is that a `contains` query in the CLI command to populate
`docker_tag_exists_in_ecr`, outputs `true` or `false` and not `1` or
`0`, which the test compares against. Changing this to check for `true`
means fixes the issue and correctly increments `number_of_tags_in_ecr`
which will later skip the build.

fixes CircleCI-Public#200
@siddharthsathe
Copy link

Downgrading to 7.0.0 pushes images to ECR successfully. Same doesn't work with 8.1.2. Thanks @sidewaiise for mentioning the version number.

brivu pushed a commit that referenced this issue Oct 20, 2022
The issue is that a `contains` query in the CLI command to populate
`docker_tag_exists_in_ecr`, outputs `true` or `false` and not `1` or
`0`, which the test compares against. Changing this to check for `true`
means fixes the issue and correctly increments `number_of_tags_in_ecr`
which will later skip the build.

fixes #200
@brivu brivu closed this as completed in 1486188 Oct 22, 2022
@brivu brivu self-assigned this Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants