question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[cdk-pipelines] Every asset update mutates the pipeline

See original GitHub issue

The UpdatePipepline stage fails although the SelfMutate action has completed successfully and causes the pipeline to start over again. This leads to the pipeline getting caught in an infinite loop.

Reproduction Steps

I have a CDK app with a PipelineStack containing a CdkPipeline (with two Cdk.Stages). I committed my CDK code to git, and then run cdk deploy PipelineStack --profile ... (all environments were bootstrapped before).

Error Log

After creating the pipeline, the first pipeline execution is being triggered by a CreatePipeline event. Source and Build stage succeed, the SelfMutate action succeeds, but the UpdatePipeline stage fails. The next execution gets triggered by a StartPipelineExecution event (probably triggered by the pipeline itself?).

Screenshot 2020-07-15 at 14 43 38

I don’t know where to find more detailed error messages of what causes the stage to fail. Please point me to the releavnt locations and I will provide more information.

Environment

  • CLI Version : 1.51.0 (build 8c2d53c)
  • Framework Version: 1.51.0 (build 8c2d53c)
  • Node.js Version: v12.18.0
  • OS : aws/codebuild/standard:4.0
  • Language (Version): TypeScript (3.9.5)

Other

Other users have reported the same issue on Gitter, but no resolution has been provided so far.


This is 🐛 Bug Report

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:13
  • Comments:19 (12 by maintainers)

github_iconTop GitHub Comments

4reactions
eladbcommented, Jul 21, 2020

Would it be possible to generate a token from the source path and use that as name for the publishing action, e.g. path.join(__dirname, ‘…/web/dist’) --> TOKEN 123 --> PublishAssets123. So hash changes would not require pipeline mutations. Though I’m not sure how the publish action would know which asset it should deploy in this case …

If we only use the path to calculate the hash, the asset won’t be invalidated when it changes and will never be updated.


As I mentioned, I think we need to figure out a way to avoid pipeline updates when assets are changed and the way to do that would probably be to define publishing actions that are not coupled directly with the asset hash but rather with the number of assets in the app. If a new asset is added, the pipeline will be updated (another publish action is needed) but if assets are only updated, the pipeline won’t need to change because we will already have a publishing action for each asset, and only the ones that changes will actually upload data (the rest will succeed with no-op).

2reactions
rix0rrrcommented, Feb 11, 2022

Alright. I plan to change that, but it is what it is for now

Read more comments on GitHub >

github_iconTop Results From Across the Web

aws-cdk/pipelines module - AWS Documentation - Amazon.com
CDK Pipelines is an opinionated construct library. ... calling pipeline.addStage() for each of them. ... This requires a pipeline self-mutation to update.
Read more >
CDK Pipelines: Beyond the Basics - AWS in Plain English
How to build a pipeline that deploys two stacks (backend and frontend) to AWS cloud using CDK. This post assumes some basic CDK...
Read more >
DEPLOY YOUR APPLICATION TO AWS USING CDK ...
CDK Pipelines are a high level construct from CDK that allows you to create pipelines that self mutate, following best practices like ...
Read more >
aws-cdk.pipelines - PyPI
The pipeline is self-mutating, which means that if you add new ... If you use assets for files or Docker images, every asset...
Read more >
Creating CDK Pipelines with Github Source and Codestar ...
One of the key components in any application development process is a deployment pipeline that helps push code changes from a repository to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found