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

Failed to marshal state to json: unsupported attribute #29

Closed
marcleblanc2 opened this issue Aug 21, 2023 · 2 comments
Closed

Failed to marshal state to json: unsupported attribute #29

marcleblanc2 opened this issue Aug 21, 2023 · 2 comments
Labels
question Further information is requested

Comments

@marcleblanc2
Copy link

marcleblanc2 commented Aug 21, 2023

What happens:

Executing tftui results in early exit during startup.

The TUI loads, and shows:
Executing Terraform init
Executing Terraform show
image

Then exits, with the message
unsupported attribute "http_protocol_ipv6"
and prints my Terraform state

This was on Terraform CLI v1.3.5, I upgraded it to v1.5.5, tftui still exits after Executing Terraform show, the error message is a little longer:
Failed to marshal state to json: unsupported attribute "http_protocol_ipv6"
but it doesn't print my Terraform state
I checked my Terraform state, and this appears to be an attribute of an aws_instance, under metadata_options

I tried switching to another Terraform repo, tftui exits early there too, this time with:
Failed to marshal state to json: unsupported attribute "secondary_allocation_ids"
I checked my Terraform state, and this appears to be an attribute of an aws_nat_gateway

Versions:
tftui v0.4.2
Installed via pip install tftui
macOS 13.5 (22G74)
M1 Max
Python 3.11.2
Terraform CLI v1.3.5 and v1.5.5
My Terraform state is stored remotely on Terraform Cloud, but tftui / terraform CLI is able to read the state

What I'd like to happen:

  • Graceful handling of unsupported attributes

Steps to Reproduce:

  • Run tftui
@idoavrah
Copy link
Owner

Those two error messages are originated in the terraform command itself.
Looks like a known bug, you first need to fix the state. Also, consider upgrading your terraform cli version.

hashicorp/terraform-provider-aws#31637

@idoavrah idoavrah added the question Further information is requested label Oct 22, 2023
@marcleblanc2
Copy link
Author

Thank you for your help @idoavrah!

The cause of the issue for me is that the AWS Terraform Provider and Terraform CLI on my laptop were a few versions behind the provider and binary used on Terraform Cloud (latest), so I had to run:

brew upgrade terraform
terraform init -upgrade

I also ran a refresh-only Terraform apply via the TFC web UI, I'm not sure if that was required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants