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
terraform output not display the outputs #35105
Comments
Thanks for filing the issue. I'm not able to replicate the behavior using v1.8 or the current main branch, so there must be something unique to your setup
Can you maybe supply a more complete example of the steps you are using? Are you possibly using a different state location for different operations? Thanks! |
Well, this is so weird.
I literally altered nothing. It worked this morning, stopped working, and started again. I know that sounds like I must have altered something, but 100% I did not. I ran the command, it failed, I ran again, it worked. Never ever had an issue with this until today - where it lasted for maybe 3hrs, then worked again. Any possibility that the state being read from TFC was somehow causing issues for those few hours? |
Thanks for the follow up. I'm not hearing about anything unusual from the TFC side, so it's hard to say what might have happened here. I'll keep an eye out for anything unusual, and let us know if you do find a way to replicate the issue! Thanks! |
The issue is happening again. Exactly the same as yesterday. I am running applies and then
The statefile shows this (cropped the output as it just contains a list of IPs which we class as sensitive (company owned IPs)): As before, I can see the outputs in the statefile, and I can "pull" the statefile and run Definitely something wrong here - to me it seems some very weird issue when the statefile is sitting in terraform cloud (or at least running from a statefile on my local machine it works fine). I switched on |
If you are storing the state in the We can look into the CLI portion some more here, but TFC support may be better able to troubleshoot if there is any server-side problem causing this. |
Thanks. I will find out how to raise this as a TFC issue. |
To report an issue with HCP Terraform or Terraform Enterprise: please email [email protected] or open a new request. |
I have opened a ticket with HCP Terraform. |
@scott-doyland-burrows The underlying issue in HCP Terraform was that the current outputs are empty for an appreciable amount of time between when the latest state is saved and ready to be used by the next terraform plan, and when the latest state is processed and outputs extracted and saved in association with it. This was patched yesterday in HCP Terraform in a way that is backwards compatible with terraform. Now, during this interim period, the platform will detect that the current state is still being processed and will return a 5XX error which forces terraform to retry the request. The error message is slightly misleading (see screenshot below) because it mentions potential data loss, but nevertheless can be interrupted without consequence. Future versions of terraform will display a more accurate and graceful error message. |
Thanks for the update. It was more like minutes, sometimes hours of delay, so I do wonder if the issue I reported was the same as the one that has been fixed. I will be running terraform a few times over the next few days, so will see. |
Terraform Version
Terraform Configuration Files
Relevant parts are:
In a root module:
In a submodule:
Debug Output
I run terraform apply and then a terraform output and see this:
Expected Behavior
The outputs should be displayed
Actual Behavior
terraform says there are no outputs.
Steps to Reproduce
terraform apply
terraform output
Additional Context
I can see the state file has the outputs:
References
No response
The text was updated successfully, but these errors were encountered: