-
Notifications
You must be signed in to change notification settings - Fork 456
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
Convert function cdktf-cli always errors with Maximum call stack size exceeded #1247
Comments
Hi @nandac! A workaround would be to run the I will also create a PR with a fix, but that would need to be released first (or merged if you want to use the pre-release build). |
…unning convert `path.resolve(rootPath, ..)` will return rootPath if there's no more parent directory. This caused an infinite loop ending in `RangeError: Maximum call stack size exceeded`. Resolves #1247
…unning convert `path.resolve(rootPath, ..)` will return rootPath if there's no more parent directory. This caused an infinite loop ending in `RangeError: Maximum call stack size exceeded`. Resolves #1247
…unning convert `path.resolve(rootPath, ..)` will return rootPath if there's no more parent directory. This caused an infinite loop ending in `RangeError: Maximum call stack size exceeded`. Resolves #1247
Thank you so much for your reply.
I will try out what you have suggested.
Many thanks.
…On Thu, Nov 4, 2021, 03:06 Ansgar Mertens ***@***.***> wrote:
Hi @nandac <https://github.com/nandac>!
Thank you for the reproduction steps, I could reproduce the issue. It
seems that findFileAboveCwd does not properly break the recursion if no
cdktf.json file could be found.
A workaround would be to run the convert command in a directory that
contains a cdktf.json file. It is only used to determine the Terraform
providers used
<https://github.com/hashicorp/terraform-cdk/blob/2b681d4ec6705355d9ab3fb7e07ea3433ba215ea/packages/cdktf-cli/bin/cmds/convert.ts#L85>
– so it won't affect the output from convert if no providers are specified
in the cdktf.json.
I will also create a PR with a fix, but that would need to be released
first (or merged if you want to use the pre-release build).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1247 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGSJ4MGELTE7T5RJJINLULUKJLL5ANCNFSM5HJT4EVQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
I'm going to lock this issue because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If you've found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Community Note
cdktf & Language Versions
cdktf-cli version: 0.7.0
Terraform version: 0.15.5
Python version: 3.9
Affected Resource(s)
cdktf convert
command fails with the errorMaximum call stack size exceeded
whatever the file used maybe. Downgrading the CLI to 0.6.4 did not help. Upgrading to the latest development version also did not help.Debug Output
https://gist.github.com/nandac/7f7522a6e0de22ea01f6f5428943c7df
Expected Behavior
Converted CDKTF content should either be available in the file provided or printed to stdout.
Actual Behavior
Errors out with
Maximum call stack size exceeded
with output provided in the gist.Steps to Reproduce
Assuming
versions.tf
contains the following content:On the console I tried:
cat versions.tf | cdktf convert --provider hashicorp/aws --language python
Important Factoids
References
The text was updated successfully, but these errors were encountered: