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

code ELIFECYCLE exit when adding CnameRecord #4512

Closed
crucialfelix opened this issue Oct 15, 2019 · 2 comments
Closed

code ELIFECYCLE exit when adding CnameRecord #4512

crucialfelix opened this issue Oct 15, 2019 · 2 comments
Assignees
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. package/tools Related to AWS CDK Tools or CLI

Comments

@crucialfelix
Copy link

crucialfelix commented Oct 15, 2019

Having added a CnameRecord to a stack, cdk diff prints the diff correctly but then exits with an error:

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ns-cdk-devops@0.1.0 diff: `cdk diff -v`
npm ERR! Exit status 1

Reproduction Steps

HostedZone was created manually on AWS Console.

    const hostedZone = HostedZone.fromHostedZoneAttributes(this, "HostedZone", {
      hostedZoneId: "HOSTEDZONEID",
      zoneName: "nestseekers.com."
    });

    const recordName = "feeds.staging";

    // adding this results in crash:
    new CnameRecord(this, `CNAMEfeeds`, {
      zone: hostedZone,
      recordName: recordName,
      domainName: "nestseekers.com"
    });

Does not crash with just hostedZone.

Also crashed with HostedZone.fromLookup

Error Log

> cdk diff -v

CDK toolkit version: 1.12.0 (build 923055e)
Command line arguments: { _: [ 'diff' ],
  v: true,
  verbose: true,
  'ignore-errors': false,
  ignoreErrors: false,
  json: false,
  j: false,
  ec2creds: undefined,
  i: undefined,
  'version-reporting': undefined,
  versionReporting: undefined,
  'path-metadata': true,
  pathMetadata: true,
  'asset-metadata': true,
  assetMetadata: true,
  'role-arn': undefined,
  r: undefined,
  roleArn: undefined,
  staging: true,
  'no-color': false,
  noColor: false,
  'context-lines': 3,
  contextLines: 3,
  strict: false,
  '$0':
   '/Users/crucialfelix/code/nestseekers/ns-cdk-devops/node_modules/.bin/cdk' }
Determining whether we're on an EC2 instance.
Does not look like EC2 instance.
cdk.json: {
  "app": "npx ts-node bin/staging.ts"
}
cdk.context.json: {
  "availability-zones:account=1234567890123:region=us-east-1": [
    "us-east-1a",
    "us-east-1b",
    "us-east-1c",
    "us-east-1d",
    "us-east-1e",
    "us-east-1f"
  ],
  "hosted-zone:account=1234567890123:domainName=nestseekers.com:region=us-east-1": {
    "Id": "/hostedzone/HOSTEDZONEID",
    "Name": "nestseekers.com."
  }
}
merged settings: { versionReporting: true,
  pathMetadata: true,
  output: 'cdk.out',
  app: 'npx ts-node bin/staging.ts',
  context: {},
  tags: [],
  assetMetadata: true,
  toolkitBucket: {},
  staging: true }
Setting "CDK_DEFAULT_REGION" environment variable to us-east-1
Resolving default credentials
Retrieved account ID 1234567890123 from disk cache
Setting "CDK_DEFAULT_ACCOUNT" environment variable to 1234567890123
context: { 'availability-zones:account=1234567890123:region=us-east-1':
   [ 'us-east-1a',
     'us-east-1b',
     'us-east-1c',
     'us-east-1d',
     'us-east-1e',
     'us-east-1f' ],
  'hosted-zone:account=123456789011:domainName=nestseekers.com:region=us-east-1':
   { Id: '/hostedzone/HOSTEDZONEID', Name: 'nestseekers.com.' },
  'aws:cdk:enable-path-metadata': true,
  'aws:cdk:enable-asset-metadata': true }
outdir: cdk.out
env: { CDK_DEFAULT_REGION: 'us-east-1',
  CDK_DEFAULT_ACCOUNT: '1234567890123',
  CDK_CONTEXT_JSON:
   '{"availability-zones:account=1234567890123:region=us-east-1":["us-east-1a","us-east-1b","us-east-1c","us-east-1d","us-east-1e","us-east-1f"],"hosted-zone:account=1234567890123:domainName=nestseekers.com:region=us-east-1":{"Id":"/hostedzone/HOSTEDZONEID","Name":"nestseekers.com."},"aws:cdk:enable-path-metadata":true,"aws:cdk:enable-asset-metadata":true}',
  CDK_OUTDIR: 'cdk.out',
  CDK_CLI_ASM_VERSION: '1.10.0',
  CDK_CLI_VERSION: '1.12.0' }
0 info it worked if it ends with ok
1 verbose cli [ '/Users/crucialfelix/.nvm/versions/node/v10.15.1/bin/node',
1 verbose cli   '/Users/crucialfelix/.nvm/versions/node/v10.15.1/bin/npm',
1 verbose cli   'run',
1 verbose cli   'diff' ]
2 info using npm@6.8.0
3 info using node@v10.15.1
4 verbose run-script [ 'prediff', 'diff', 'postdiff' ]
5 info lifecycle ns-cdk-devops@0.1.0~prediff: ns-cdk-devops@0.1.0
6 info lifecycle ns-cdk-devops@0.1.0~diff: ns-cdk-devops@0.1.0
7 verbose lifecycle ns-cdk-devops@0.1.0~diff: unsafe-perm in lifecycle true
8 verbose lifecycle ns-cdk-devops@0.1.0~diff: PATH: /Users/crucialfelix/.nvm/versions/node/v10.15.1/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/crucialfelix/code/nestseekers/ns-cdk-devops/node_modules/.bin:/Users/crucialfelix/.nvm/versions/node/v10.15.1/bin:/Users/crucialfelix/.poetry/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/usr/X11/bin:/usr/local/git/bin:/usr/local/mysql/bin:/Users/crucialfelix/bin:/Users/crucialfelix/.go/bin:/usr/local/opt/go/libexec/bin:/Users/crucialfelix/.rvm/bin
9 verbose lifecycle ns-cdk-devops@0.1.0~diff: CWD: /Users/crucialfelix/code/nestseekers/ns-cdk-devops
10 silly lifecycle ns-cdk-devops@0.1.0~diff: Args: [ '-c', 'cdk diff -v' ]
11 silly lifecycle ns-cdk-devops@0.1.0~diff: Returned: code: 1  signal: null
12 info lifecycle ns-cdk-devops@0.1.0~diff: Failed to exec diff script
13 verbose stack Error: ns-cdk-devops@0.1.0 diff: `cdk diff -v`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/Users/crucialfelix/.nvm/versions/node/v10.15.1/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:189:13)
13 verbose stack     at ChildProcess.<anonymous> (/Users/crucialfelix/.nvm/versions/node/v10.15.1/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:189:13)
13 verbose stack     at maybeClose (internal/child_process.js:970:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid ns-cdk-devops@0.1.0
15 verbose cwd /Users/crucialfelix/code/nestseekers/ns-cdk-devops
16 verbose Darwin 18.7.0
17 verbose argv "/Users/crucialfelix/.nvm/versions/node/v10.15.1/bin/node" "/Users/crucialfelix/.nvm/versions/node/v10.15.1/bin/npm" "run" "diff"
18 verbose node v10.15.1
19 verbose npm  v6.8.0
20 error code ELIFECYCLE
21 error errno 1
22 error ns-cdk-devops@0.1.0 diff: `cdk diff -v`
22 error Exit status 1
23 error Failed at the ns-cdk-devops@0.1.0 diff script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Environment

  • CLI Version :

1.12.0

NOTE: Does not crash when using cdk 1.11.0 command line tool !

  • Framework Version:

1.12.0

  • OS :
    Mac
  • Language :
    Typescript

This is 🐛 Bug Report

@crucialfelix crucialfelix added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 15, 2019
@jogold
Copy link
Contributor

jogold commented Oct 15, 2019

@crucialfelix Aren't you experiencing #2111?

Duplicate of #2111?

@SomayaB SomayaB added the package/tools Related to AWS CDK Tools or CLI label Oct 15, 2019
@crucialfelix
Copy link
Author

Ok that makes sense now. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. package/tools Related to AWS CDK Tools or CLI
Projects
None yet
Development

No branches or pull requests

4 participants