coinbase / terraform-landscape

Improve Terraform's plan output to be easier to read and understand
Apache License 2.0
1.59k stars 116 forks source link

"Terraform Landscape: a parsing error occured. Falling back to original Terraform output..." #114

Closed rquadling closed 4 years ago

rquadling commented 4 years ago

I initially had the errors regarding the ruby changes (_1 things). Added the RUBYOPT="-W0" prefix for landscape to suppress them and then got the error Terraform Landscape: a parsing error occured. Falling back to original Terraform output... (with the spelling as shown).

Running with --trace, I get ...

Traceback (most recent call last):
    13: from /usr/local/Cellar/terraform_landscape/0.3.3/libexec/bin/landscape:23:in `<main>'
    12: from /usr/local/Cellar/terraform_landscape/0.3.3/libexec/bin/landscape:23:in `load'
    11: from /usr/local/Cellar/terraform_landscape/0.3.3/libexec/gems/terraform_landscape-0.3.3/bin/landscape:7:in `<top (required)>'
    10: from /usr/local/Cellar/terraform_landscape/0.3.3/libexec/gems/terraform_landscape-0.3.3/lib/terraform_landscape/cli.rb:25:in `run'
     9: from /usr/local/Cellar/terraform_landscape/0.3.3/libexec/gems/commander-4.4.7/lib/commander/delegates.rb:15:in `run!'
     8: from /usr/local/Cellar/terraform_landscape/0.3.3/libexec/gems/commander-4.4.7/lib/commander/runner.rb:68:in `run!'
     7: from /usr/local/Cellar/terraform_landscape/0.3.3/libexec/gems/commander-4.4.7/lib/commander/runner.rb:446:in `run_active_command'
     6: from /usr/local/Cellar/terraform_landscape/0.3.3/libexec/gems/commander-4.4.7/lib/commander/command.rb:153:in `run'
     5: from /usr/local/Cellar/terraform_landscape/0.3.3/libexec/gems/commander-4.4.7/lib/commander/command.rb:182:in `call'
     4: from /usr/local/Cellar/terraform_landscape/0.3.3/libexec/gems/terraform_landscape-0.3.3/lib/terraform_landscape/cli.rb:34:in `block (2 levels) in define_commands'
     3: from /usr/local/Cellar/terraform_landscape/0.3.3/libexec/gems/terraform_landscape-0.3.3/lib/terraform_landscape/cli.rb:53:in `print'
     2: from /usr/local/Cellar/terraform_landscape/0.3.3/libexec/gems/terraform_landscape-0.3.3/lib/terraform_landscape/printer.rb:42:in `process_stream'
     1: from /usr/local/Cellar/terraform_landscape/0.3.3/libexec/gems/terraform_landscape-0.3.3/lib/terraform_landscape/printer.rb:99:in `process_string'
/usr/local/Cellar/terraform_landscape/0.3.3/libexec/gems/terraform_landscape-0.3.3/lib/terraform_landscape/terraform_plan.rb:40:in `from_output': Expected one of [\\s], [ ], '~', '-/+', '-', '+', '<=' at line 3, column 3 (byte 5) after  (TerraformLandscape::TerraformPlan::ParseError)

So, dropping the --trace and taking into account that the report above says line 3, column 3, this line in the untraced plan is :

Terraform Landscape: a parsing error occured. Falling back to original Terraform output...
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

module.bastion_instance.random_string.awscli_output_temp_file_name: Refreshing state... [id=n75VMsI0uBE8aJQa]
module.bastion.data.template_file.userdata: Refreshing state...
module.api_app_cms_asg.module.current_desired_capacity.random_string.awscli_output_temp_file_name: Refreshing state... [id=7geBb0mEmxXcIasA]
...

Also tried with -no-color for the terraform plan ... no difference.

Using tfenv in general, but this project is using ...

Terraform v0.12.26
+ provider.aws v2.66.0
+ provider.cloudflare v2.7.0
+ provider.external v1.2.0
+ provider.local v1.4.0
+ provider.random v2.2.1
+ provider.template v2.1.2
rquadling commented 4 years ago

And just read that it looks like Terraform v0.12.* is not supported. Please can you consider adding this restriction to the README. Would save some time.

sds commented 4 years ago

Thanks for the feedback! Agreed, we should make this clearer.

Added in 46a754d7a8e6c704203ee1cb10624bdff0b90974.