terraform-provider-nutanix icon indicating copy to clipboard operation
terraform-provider-nutanix copied to clipboard

unmarshalling error response invalid character ‘O’ looking for beginning of value

Open hkusanic opened this issue 3 years ago • 2 comments

Description: This looks like Nutanix Terraform provider issue.

I am using following setup:

terraform {
    required_version = ">= 0.14"
      
    required_providers {
        nutanix = {
        source  = "nutanix/nutanix"        
        version = "~> 1.2"
        }
    }

    backend "local" {
       
    }
}

Error is always in the following form, but happens on different places in the terraform code: "unmarshalling error response invalid character ‘O’ looking for beginning of value"

This issue is occasionally breaking our release pipeline, but oddly enough if you re-run the pipeline it will start to work without any code change in the codebase or in the release pipeline.

Bellow you can find logs from the 3 consecutive runs from the Azure DevOps pipeline (run 1-3) with the Terraform apply task. Underneath, you can find Terraform files where error was reported

Again, after first two runs that failed, third one worked just fine without any errors. Mind you, same code, same artifacts, no changes.

What I've tried already: I used Terraform validate to fix all the warnings in regards to Terraform variable syntax.

I’ve also seen following thread in slack but suggested workarounds didn't work for me. https://app.slack.com/client/T0252CLM8/search/search-eba41109-7265-4d3e-9f86-5d690868278a/thread/C8E8RABB4-1549301669.049000 [app.slack.com]

Expected result: There are no errors

Logs: run1.txt run2.txt run3.txt

Terraform files: centos001_main.tf.txt centos001_win2019_main.tf.txt ubuntu001_main.tf.txt

hkusanic avatar Apr 01 '21 07:04 hkusanic

Can you run your code in TRACE mode (https://www.terraform.io/docs/internals/debugging.html) and provide these logs? Please make sure you remove all sensitive data from the output (authorization headers for example).

yannickstruyf3 avatar Apr 01 '21 09:04 yannickstruyf3

Hi @yannickstruyf3 Here is the example with TRACE mode.

Terraform plan - tasklog_12.log - in terraform plan we get unmarshalling error

These are the logs from the first run with unmarshalling error 1st run - tasklog_13_unmarshalling error.log

These are the logs from the second run without any errors (No changes to code or the release, just re-running it) 2nd run tasklog_13_no_error.log

Please let me know if you need anything else

hkusanic avatar Apr 23 '21 14:04 hkusanic