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

cdktf deploy fails with "Unexpected token c in JSON at position 1" #1729

Closed
mbaranovski opened this issue Apr 19, 2022 · 5 comments
Closed
Labels
bug Something isn't working

Comments

@mbaranovski
Copy link

mbaranovski commented Apr 19, 2022

Community 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.

@mbaranovski mbaranovski added bug Something isn't working new Un-triaged issue labels Apr 19, 2022
@DanielMSchmidt
Copy link
Contributor

It looks to me like terraform version -json did not run successfully in CI, could you try to add a CI step before cdktf synth that runs this command to see if the command itself works?

@mbaranovski
Copy link
Author

Hi @DanielMSchmidt, the step you requested executes correctly:
image

@ansgarm
Copy link
Member

ansgarm commented Apr 19, 2022

Hi @mbaranovski,

are you using the setup-terraform Github Action?
If yes, maybe you're running into this issue: #1020

@mbaranovski
Copy link
Author

That was the case! Thanks @ansgarm & @DanielMSchmidt

@DanielMSchmidt DanielMSchmidt removed the new Un-triaged issue label Jun 14, 2022
@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants