-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
[Bug]: Failed to marshal plan to json, unsupported attribute "override_json" #31637
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
Maybe related to this change? #22906 |
For some reason, Example: {
"version": 4,
"terraform_version": "1.3.9",
"serial": 13,
"lineage": "fe5ffc8a-776c-9548-36c5-0b43c266ccb1",
"outputs": {},
"resources": [
{
"mode": "data",
"type": "aws_iam_policy_document",
"name": "assume_role",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"id": "1642520416",
"json": "",
"override_json": null,
"override_policy_documents": null,
"policy_id": null,
"source_json": null,
"source_policy_documents": null,
"statement": [],
"version": "2012-10-17"
},
"sensitive_attributes": []
}
]
},
{
"mode": "data",
"type": "aws_iam_policy_document",
"name": "iam_access",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"id": "4064693197",
"json": "",
"override_json": null,
"override_policy_documents": null,
"policy_id": null,
"source_json": null,
"source_policy_documents": null,
"statement": [],
"version": "2012-10-17"
},
"sensitive_attributes": []
}
]
},
... |
The same issue happens with {
"mode": "data",
"type": "aws_iam_policy_document",
"name": "assume_role",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"id": "....",
"json": ....,
"override_json": null, // Deprecated field!!!!
"override_policy_documents": null,
"policy_id": null,
"source_json": null, // Deprecated field!!!!
"source_policy_documents": null, |
Workaround: to fix the state without state manipulations, you need change resources which had the For example:
|
I have the same issue in TF 1.5.0 with AWS Provider 5.4.0 For me the workaround doesn't work because many of the aws_iam_policy_document data are managed by modules meaning a simple change of SID is not always possible This is a sever issue and has already impacted a production workspace which seems now nigh on unrecoverable baring some drastic state manipulation 🫰 Any speedy progress would be greatly appreciated! |
I encountered this while trying to delete from state in Terraform Cloud. As a workaround, I had to first checkout the |
Hi Team, |
In my case I have managed to make it work by:
|
Seeing this very consistently when doing a |
I just got this issue `Failed generating plan JSON Failed to marshal plan to json: error marshaling prior state: unsupported attribute "override_json" I have external modules, so Im not able to perform simple SID change. Is there any other way to fix this? |
Look like i fixed my issue with running plan+apply on 4.x provider with changed SID in all "aws_iam_policy_document" resources that I handle, get it back on 5.x and it worked! |
This functionality has been released in v5.41.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
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 Core Version
1.4.6
AWS Provider Version
5.0.1
Affected Resource(s)
Converting a saved plan file into json using
terraform show -json
results in this errorFailed to marshal plan to json: error marshaling prior state: unsupported attribute "override_json"
Downgrading to anything less than 5.0.0, and the same command works
Expected Behavior
Plan is converted to json and displayed on the screen
Actual Behavior
I get the error:
Failed to marshal plan to json: error marshaling prior state: unsupported attribute "override_json"
Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
Since terraform is not showing which TF code lines are causing this panic, it's not possible to show a snippet of the configs
Steps to Reproduce
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: