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

aws-cdk: Asset publishing failure does not stop stack deployments (which results in a runtime failure in CloudFormation) #26048

Closed
iancaffey opened this issue Jun 20, 2023 · 2 comments · Fixed by #26060
Labels
@aws-cdk/aws-cloudformation Related to AWS CloudFormation bug This issue is a bug. effort/medium Medium work item – several days of effort needs-review p1

Comments

@iancaffey
Copy link

Describe the bug

Failures encountered while publishing assets (e.g. failures when executing the source.executable in a DockerImageAsset) do not stop the CLI from continuing with the stack deployment.

This results in a CloudFormation deployment that eventually fails, due to not being able to find the asset (as it was never published).

Expected Behavior

cdk deploy should not proceed with stack deployments unless all stack assets have published successfully.

Current Behavior

CDK deploy continues normally with the deployment.

For example (these logs are heavily redacted, but hopefully demonstrate the point clearly),

[18:29:06] {stack name}:  build: Building Docker image using command '{docker exe}'
...
//docker executable runs, emitting all its output logs, which clear show failures, and the process exits with a non-zero code (4)
[18:31:06] Reading existing template for stack {stack name}
...
//prompts the user, if making any changes, like any normal deployment
...
{stack id} ({stack name}): deploying... [1/1]

Reproduction Steps

It'd take awhile for me to setup a self-contained replica of the current scenario.

Might be easy to force with a "fake" DockerImageAsset in a simple CDK stack where the asset's source executable just exits immediately with a non-zero exit code.

Possible Solution

Don't continue with the deployment, if any assets fail to publish.

Additional Information/Context

No response

CDK CLI Version

2.83.1 (build 006b542)

Framework Version

No response

Node.js Version

18

OS

Mac OSX

Language

Typescript

Language Version

TypeScript 4.9.5

Other information

No response

@iancaffey iancaffey added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jun 20, 2023
@github-actions github-actions bot added the @aws-cdk/aws-cloudformation Related to AWS CloudFormation label Jun 20, 2023
@pahud pahud added p1 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Jun 20, 2023
@pahud
Copy link
Contributor

pahud commented Jun 20, 2023

related to #25827

I am bumping this to p1 as there's no workaround.

@mergify mergify bot closed this as completed in #26060 Jun 21, 2023
mergify bot pushed a commit that referenced this issue Jun 21, 2023
…#26060)

Fixes #26048, fixes #25827.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-cloudformation Related to AWS CloudFormation bug This issue is a bug. effort/medium Medium work item – several days of effort needs-review p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants