-
Notifications
You must be signed in to change notification settings - Fork 21
terraform plan
fails with unexpected EOF
when reading remote state
#4
Comments
Update2: I do not know what happened/changed, but as I tried today I was able to do Update3: The panic happened again, found out it is unrelated to this issue. My problem seems to be fixed in hashicorp/terraform-provider-aws@3a38399. |
Hi all, |
Hey @mikhailponomaryov , the previous user reported that hashicorp/terraform-provider-aws#899 has addressed their issue. That patch should be included in the Terraform AWS Provider since version 0.1.2, do you know what version you're on? |
@catsby, Thanks a lot. |
@catsby The error happened with |
I see the same issue going from TF 10.7 -> 10.8. I have tried various version of the aws provider all resulting in the same |
This happens on a remote state file. If you run plan directly in the project that created the remote state it works fine. It is just the remote state call.
|
FYI running terraform refresh fixed this issue. Sigh. |
I constantly face this issue when updating resources. After getting unexpected EOF, the resource that was refreshing somehow is removed from the state, and then on the next apply is trying to create again, which completely breaks the workflow, because the resource actually exist. |
I got I tried to add a comma separated list to Although the UI accepts comma separated list like Just deleted the rule and everything started to work again. |
OMG, I have to take my words back. The EOF issue was because of a panic in our custom provider! I figured it out setting |
For anyone else running into the error |
We also get The bad output configuration:
Fix was to have the integer quoted as a string like this:
The state file the incorrect configuration looks like this:
It should be
Note the the output posted to the console when applying the state will be shown without quotes in both cases.
|
This issue was originally opened by @bluedragonx as hashicorp/terraform#15696. It was migrated here as a result of the provider split. The original body of the issue is below.
Terraform Version
Terraform Configuration Files
Debug Output
https://gist.github.com/BlueDragonX/dbce26f86fabb841c26e27b6e66d0e82
Expected Behavior
I expect the
terraform plan
to run successfully.Actual Behavior
I get this instead:
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform plan
Important Factoids
I've done some digging in the code to see why exactly this is happening. The important bit in the debug log is
panic: Unknown: <invalid reflect.Value>
which comes from builtin/providers/terraform/flatten.go. Based on the stack trace this implies that one of the output's values was parsed incorrectly. Given that output.Value is an interface and Terraform calls json.Unmarshal to build that, I'm concerned that we're running up against some sort of bug.Here are the outputs for each of the modules in the state file (mildly redacted):
I'm not sure why that would be parsed by
json.Unmarshal
incorrectly but I'm going to experiment to see why.What I really don't get is why this has worked fine for me previously using the same version but is breaking now. I've deployed this same state in other envirnments and it works.
The text was updated successfully, but these errors were encountered: