-
Notifications
You must be signed in to change notification settings - Fork 4k
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
cdk-cli deploy: fail: docker push to ecr unexpected status from PUT request 400 Bad Request #33264
Comments
Was it working prior to 2.177.0 but failing in 2.177.0 ? 400 bad request generally indicates bad requests and it could be many different causes. Are you able to simply push a local image to your ECR using your current AWS identity from local? What's happening in CDK is essentially using $CDK_DOCKER or Let me know if you are able to manually push an random image to ecr? |
Hi @pahud thanks for the response, I reverted to version 2.173.1 and it still fails with 400 bad request on ecr push. I was able to docker login with I then tried to cdk deploy and it failed again with 400 Bad Request. What I did notice was this. When i check my docker AWS credentials with I checked the JWT in the "Secret" property of that credential JSON in jwt.io. when i manually login with ecr, the jwt was valid in jwt.io. But the JWT from "Secret" that gets set when I run cdk deploy comes back as an invalid JWT in jwt.io as it ends in "==". Not sure if this maybe causing issues. |
I ended up deleting docker desktop and installing docker and colima and it's working fine with colima with both buildkit enabled and disabled. |
+1 to this with Docker Desktop on MacOS 15.2, CDK 2.177.0 (build b396961). Same error comes up with |
Thank you for the report. @james-g-stream and @wbeardall. While we'll investigate this issue, can you help us check is it only happening in 2.177.0 ? What about 2.176 or even earlier versions? |
@pahud i tried it on 2.173.1 and still happening only for docker desktop |
Possibly related to these issues, I'm looking into it: #30258 (comment) Need to turn off containerd or set |
@kaizencc yes they are related. In our cases, we get the 400 error for each image asset when cdk tries to push attestations and images, which sometimes results in 0mb images. (The behavior seems indeterministic. Sometimes attestation wins and sometimes the actual image wins. They share the same image tag and the first one is pushed but the second one throws an error because of ecr tag immutability, it seems.) Then if we retry cdk deploy, it continues to deploy with those invalid images, because cdk does not have to push any images due to cache, which finally results in ecs or lambda deployment errors. |
Describe the bug
when trying to run cdk deploy with an ecs.ContainerImage.fromAsset() I'm getting a fail: docker push to ecr unexpected status from PUT request 400 Bad Request. I've uninstalled and reinstalled docker, deleted the image asset it references from ecr and nothing seems to be working. cdk version 2.177.0 (build b396961)
Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
ckd successfully push the docker image to ecr
Current Behavior
the docker push is returning 400 bad request and failing cdk deploy
Reproduction Steps
yarn cdk deploy
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.177.0 (build b396961)
Framework Version
No response
Node.js Version
v20.15.0
OS
macOS 14.5
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: