cdktf deploy fails with "Unexpected token c in JSON at position 1"
See original GitHub issueCommunity Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave “+1” or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
cdktf & Language Versions
"@cdktf/provider-aws": "^7.0.20",
"cdktf": "^0.10.1",
"cdktf-cli": "^0.10.1",
Terraform v1.1.8
Affected Resource(s)
Debug Output
Before cdktf
plan is executed:
Debug Information:
Terraform CDK version: 0.10.1
Terraform version: Unknown: Error loading terraform version SyntaxError: Unexpected token c in JSON at position 1
After the plan JSON is generated:
[2022-04-19T14:44:36.026] [DEBUG] default - ::debug::Terraform exited with code 0.
Unexpected token c in JSON at position 1
[2022-04-19T14:44:36.029] [DEBUG] default - [my-stack]: errored
Expected Behavior
Stack deploys
Actual Behavior
The cdktf
plan generates the JSON correctly and exists with exit code 0. However after that whatever comes next after plan (I assume it’s apply
) fails with error: Unexpected token c in JSON at position 1
with no stack trace.
Steps to Reproduce
Important Factoids
Fails on GH Actions, works locally.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Unexpected token error with cdk deploy on an existing stack ...
Describe the bug Hi I've an existing stack project written in Java. So far I've been deploying it using cdk deploy command and...
Read more >SyntaxError: Unexpected token C in JSON at position 0
I was facing the exactly issue. Just change: error.json(). to. JSON.parse(JSON.stringify(error)).
Read more >Guide to fix “unexpected token o in json at position 1” error
The “unexpected token o in json at position 1” appears because of parsing an already parsed object. Read this article to learn more...
Read more >How to fix Unexpected Token in JSON error (for ... - YouTube
Not a programmer? Read this! ** - If you get this error in an app you didn't make, and/or you're not a web...
Read more >Unexpected token o in json at position 1 error – How to fix it
Unexpected token o in json at position 1 error – How to fix itFollow me on Instagram: https://www.instagram.com/noeldemoses/Visit my channel ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @mbaranovski,
are you using the
setup-terraform
Github Action? If yes, maybe you’re running into this issue: https://github.com/hashicorp/terraform-cdk/issues/1020That was the case! Thanks @ansgarm & @DanielMSchmidt