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

tfexec Terraform.Output method returns error when command is successful #470

Open
Ravikc opened this issue Jul 16, 2024 · 1 comment
Open
Assignees

Comments

@Ravikc
Copy link

Ravikc commented Jul 16, 2024

I am using terraform-exec with HCP terraform to manage some infra. When running terraform output command, logs show that there was a connection error and it's trying to re-establish the connection, eventually the command logs the correct output, but Terraform.Output method returns an error.

Expected behaviour: error returned by Terraform.Output should be nil.

Error returned by the library:
invalid character 'T' looking for beginning of value

Logs:

time=2024-07-11T13:06:33.111Z level=INFO msg="[INFO] running Terraform command: /home/terraform/app/terraform output -no-color -json"

There was an error connecting to HCP Terraform. Please do not exit
Terraform to prevent data loss! Trying to restore the connection...

Still trying to restore the connection... (3s elapsed)
Still trying to restore the connection... (5s elapsed)
Still trying to restore the connection... (8s elapsed)
Still trying to restore the connection... (12s elapsed)
Still trying to restore the connection... (17s elapsed)
{
  "ubuntu1_public_dns": {
    "sensitive": false,
    "type": "string",
    "value": "<some-value-here>"
  },
  "ubuntu_public_dns": {
    "sensitive": false,
    "type": "string",
    "value": "<some-value-here>"
  }
}

It's probably failing when trying to convert the command's output into map[string]OutputMeta

@Ravikc Ravikc changed the title Method returns error when command is successful tfexec Terraform.Output method returns error when command is successful Jul 16, 2024
@Ravikc
Copy link
Author

Ravikc commented Jul 16, 2024

@kmoe could you please help confirming if this is indeed an issue in the library or I might be doing something wrong.

@kmoe kmoe self-assigned this Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants