-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Upgrade of tfstate version on first remote fetch of 0.7.0 leads to CacheRefreshConflict #6732
Comments
I think the fix might be to this line in
Perhaps only assign to Version if |
Yep, we use S3 buckets for our state files and always clear out the local .terraform directory before we run TF, this is a problem for us to go to 0.7. |
Thoughts on this? It should only increment the serial number when we are upgrading a state.
|
That makes sense to me though I don't know why the Serial != 0 check, and I'm not a Terraform developer. |
Yeah we may not need that, my assumption was that if its a serial 0, its a new state file and wouldn't need to be bumped. I haven't tested the condition. |
@jen20 this is a problem for anyone using remote states and upgrading to 0.7 AFAIK |
It looks like this was addressed in #7402 |
Indeed it was! Feel free to follow up if you're seeing this issue on RC3 or later. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Terraform Version
This bug occurs when upgrading from a version of Terraform such as 0.6.15 to
current master (eg, 592162c).
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
No configuration file is necessary.
Steps to Reproduce
In an empty directory, with old and new versions of Terraform available:
"version 1" state file to S3.
"version 1" state file but rewrites it to say "version 2" without changing the
serial, which causes an error.
Expected Behavior
Running
terraform remote config
in an empty directory (no local tfstate file)with a "version 1" tfstate file in S3 should not lead to an error.
Actual Behavior
It does lead to an error, because the version is converted to 2 on download
without changing the serial, which leads to a CacheRefreshConflict.
Debug Output
Debug output included above because it is short.
Workaround
-pull=false
makes this command succeed and it does not appear to preventfurther commands from working.
The text was updated successfully, but these errors were encountered: