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

Expects cdk.out/STACK_NAME.assets.template.json to exist after synth #42

Open
l0b0 opened this issue Aug 20, 2021 · 1 comment
Open

Comments

@l0b0
Copy link

l0b0 commented Aug 20, 2021

Running cfn-dia html --ci-mode results in the following error message:

$ cfn-dia html --ci-mode 
Bundling asset project/proccessing_lambda_function/Code/Stage...
node:fs:585
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, open 'cdk.out/STACK_NAME.assets.template.json'
    at Object.openSync (node:fs:585:3)
    at Object.readFileSync (node:fs:453:35)
    at fromCDK ([…]/node_modules/@mhlabs/cfn-diagram/shared/templateParser.js:95:30)
    at Object.get ([…]/node_modules/@mhlabs/cfn-diagram/shared/templateParser.js:31:16)
    at Command.<anonymous> ([…]/node_modules/@mhlabs/cfn-diagram/commands/html/index.js:29:34)
    at Command.listener [as _actionHandler] ([…]/node_modules/commander/index.js:922:31)
    at Command._parseCommand ([…]/node_modules/commander/index.js:1503:14)
    at Command._dispatchSubcommand ([…]/node_modules/commander/index.js:1443:18)
    at Command._parseCommand ([…]/node_modules/commander/index.js:1460:12)
    at Command.parse ([…]/node_modules/commander/index.js:1292:10) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: 'cdk.out/STACK_NAME.assets.template.json'
}

Context:

$ cfn-dia --vers
1.1.28
$ cdk --version
1.119.0 (build 2921d64)

Workaround: Specify --template-file=cdk.out/STACK_NAME.template.json and run the command twice after clearing out the CDK cache - it seems to ignore the specified template name the first time I run it:

$ rm -rf cdk.out
$ DATABASE_URI='postgresql+psycopg2://postgres@127.0.0.1:5432/bde' poetry run cfn-dia html --ci-mode --template-file=cdk.out/STACK_NAME.template.json
Bundling asset STACK_NAME/proccessing_lambda_function/Code/Stage...
node:fs:585
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, open 'cdk.out/STACK_NAME.assets.template.json'
    at Object.openSync (node:fs:585:3)
    at Object.readFileSync (node:fs:453:35)
    at fromCDK ([…]/node_modules/@mhlabs/cfn-diagram/shared/templateParser.js:95:30)
    at Object.get ([…]/node_modules/@mhlabs/cfn-diagram/shared/templateParser.js:31:16)
    at Command.<anonymous> ([…]/node_modules/@mhlabs/cfn-diagram/commands/html/index.js:29:34)
    at Command.listener [as _actionHandler] ([…]/node_modules/commander/index.js:922:31)
    at Command._parseCommand ([…]/node_modules/commander/index.js:1503:14)
    at Command._dispatchSubcommand ([…]/node_modules/commander/index.js:1443:18)
    at Command._parseCommand ([…]/node_modules/commander/index.js:1460:12)
    at Command.parse ([…]/node_modules/commander/index.js:1292:10) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: 'cdk.out/STACK_NAME.assets.template.json'
}
$ DATABASE_URI='postgresql+psycopg2://postgres@127.0.0.1:5432/bde' poetry run cfn-dia html --ci-mode --template-file=cdk.out/STACK_NAME.template.json
$ echo $?
0

Not sure if this should be reported separately.

@lewismc
Copy link

lewismc commented Apr 25, 2022

I'm getting the same result

cfn-dia --vers
1.1.33
cdk --version
2.21.1 (build a6ee543)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants