-
Notifications
You must be signed in to change notification settings - Fork 118
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
State migration for old attribute "body" is missing. #165
Comments
I'm looking into this. Will try to create a PR today. |
Hi @pascal-hofmann sorry you ran into trouble here. Could you possibly post a complete example of the terraform code you are using along with the version of the Are you trying to use the |
This is the issue. data resources are also persisted to state. When the schema changes, a state upgrader is required. I'm currently working on a PR. I'm just getting used to the new framework instead of sdk. |
@bendbennett I think currently the framework does not support state upgraders for data sources. :( @bflad Do you have an idea, how to handle this case? In the meantime I think I'll pin the provider version to 2. (I don't want to fix the state manually, because we have a lot of these data sources in a lot of states.) |
I was able to create a minimal test case for this. It only happens if the deprecated If you then upgrade to 3.0.0, it will fail with:
Workaround: Switch to using Test case:
I'll close this issue. |
This feels like a redux of this recent core issue hashicorp/terraform#30823 and pull request hashicorp/terraform#30830 -- it seems valuable to raise an issue upstream to see if Terraform core can actually ignore data source prior state in this situation, if its being consulted for plan generation. |
By the way, there is no concept of state upgrades for data sources. There is only the |
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. |
Terraform CLI and Provider Versions
terraform 1.2.5
provider 3.0.0
Terraform Configuration
Expected Behavior
Proper migration of old state.
Actual Behavior
… could not be decoded from the state: unsupported attribute "body". :(
Steps to Reproduce
Create state with old module, update to new module and try to apply again.
How much impact is this issue causing?
High
Logs
No response
Additional Information
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: