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.

self mutating cdk pipeline fails after updating cdk version from 1.85.0 to 1.92.0

See original GitHub issue

❓ General Issue

[Container] 2021/03/11 11:26:36 Phase context status code: Message: [Container] 2021/03/11 11:26:36 Entering phase INSTALL [Container] 2021/03/11 11:26:36 Phase complete: INSTALL State: SUCCEEDED [Container] 2021/03/11 11:26:36 Phase context status code: Message: [Container] 2021/03/11 11:26:36 Entering phase PRE_BUILD [Container] 2021/03/11 11:26:36 Running command npm ci npm ERR! @aws-cdk/yaml-cfn not accessible from aws-cdk

npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2021-03-11T11_26_41_322Z-debug.log

[Container] 2021/03/11 11:26:41 Command did not exit successfully npm ci exit status 1 [Container] 2021/03/11 11:26:41 Phase complete: PRE_BUILD State: FAILED [Container] 2021/03/11 11:26:41 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: npm ci. Reason: exit status 1

self-mutating cdk pipeline which was working before is failing with above error in build stage synth action after upgrading cdk version to v1.92.0

The Question

Environment

  • CDK CLI Version: 1.92
  • Module Version:
  • Node.js Version: 12.16.1
  • OS: Windows 10
  • Language (Version): Typescript

Other information

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
Shamailcommented, Mar 18, 2021

@dhirajkhodade My issue was due to the default codebuild image using npm v6.x instead of npm v7.x, which i’m using locally and which produces a lockfileVersion:2 instead of lockfileVersion:1 package-lock.json file. So when codebuild pulls the code from my repo, it’s getting a package-lock.json that isn’t compatible with npm v6.x but it tries to use it anyway without throwing a mismatch error.

Potential solutions:

  • Down grade npm locally to v6.x., then rm -rf package-lock.json && npm i to generate and commit a lockfileVersion:1 lock file
  • Create/use an image that has npm v7.x and point the environment build image to your image repository like so:
         synthAction: SimpleSynthAction.standardNpmSynth({
           ...
           environment: {
             buildImage: codebuild.LinuxBuildImage.fromEcrRepository(...),
           },
         })
0reactions
github-actions[bot]commented, Mar 19, 2021

⚠️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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

aws-cdk/pipelines module - AWS Documentation - Amazon.com
This requires a pipeline self-mutation to update. To avoid this, put your build instructions in a separate script, for example build.sh , and...
Read more >
AWS CDK Pipeline - Brian Pfeil
code for article pfeilbr/aws-cdk-pipeline-playground ... self mutating cdk pipeline fails after updating cdk version from 1.85.0 to 1.92.0 ...
Read more >
aws-cdk.pipelines - PyPI
Continuous Delivery of CDK applications. ... Newer version available (1.184.0) ... The pipeline is self-mutating, which means that if you add new ...
Read more >
aws-cdk | Yarn - Package Manager
Important: This documentation covers modern versions of Yarn. For 1.x docs, see classic.yarnpkg.com. Yarn.
Read more >
github - UpdatePipeline (SelfMutate) stage gone missing from ...
To fix this you need to enable self mutation and deploy the pipeline stack manually from you machine to update.
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