jason-johnson / azure-pipelines-tasks-terraform

Azure Pipelines extension for Terraform
MIT License
124 stars 52 forks source link

Version 0.7.7 - Unexpected token %0A in JSON at position 65536 #265

Closed toshshaw closed 2 years ago

toshshaw commented 2 years ago

Describe the bug After 0.7.7 Release I am getting error Unexpected token %0A in JSON at position 65536

To Reproduce Steps to reproduce the behavior:

  1. YAML Pipeline using task TerraformCLI@0 with command show
  2. Execute pipeline
  3. See error

Expected behavior To not error

Screenshots image

Pipeline Logs

[debug]exec tool: /opt/hostedtoolcache/terraform/1.1.7/x64/terraform

[debug]arguments:

[debug] show

[debug] -json

[debug] /home/vsts/work/1/a/tfplan-prd

[debug]Exit code 0 received from tool '/opt/hostedtoolcache/terraform/1.1.7/x64/terraform'

[debug]STDIO streams have closed for tool '/opt/hostedtoolcache/terraform/1.1.7/x64/terraform'

[debug]inputTargetPlanOrStateFilePath=/home/vsts/work/1/a/tfplan-prd

[debug]inputTargetPlanOrStateFilePath=/home/vsts/work/1/a/tfplan-prd

[debug]allowTelemetryCollection=false

[error]SyntaxError: Unexpected token

in JSON at position 65536

[debug]Processed: ##vso[task.issue type=error;]SyntaxError: Unexpected token %0A in JSON at position 65536

[debug]allowTelemetryCollection=false

[debug]command=show

[debug]command=show

[debug]secureVarsFile=undefined

[debug]command=show

Agent Configuration

Additional context This was working correctly on version 0.7.6

pnowaktty commented 2 years ago

I can confirm same bug present for task version 0.7.7 and Terraform 1.1.5

Current workaround I tested and worked was to hardcode minor version as such TerraformCLI@0.7.6

rdeveen commented 2 years ago

We are experience the same. Can confirm that using v0.7.6 indeed worked well.

charleszipp commented 2 years ago

for this and #61 I am going to stop accepting any updates for the destroy detection because this has been completely unpredictable do to its dependence on specific structure of the plan and state files. I cant realistically cover all scenarios for everyone. If we accept a change that fixes one issue it breaks the feature for 5 others.

I am going to revert the change for #61 and #258. Beyond that, this feature will be locked down and deprecated at that state.

charleszipp commented 2 years ago

258 has been reverted. The removal of that change has been released with 0.7.8