Skip to content

decode backend hash as uint64#19688

Merged
jbardin merged 1 commit intomasterfrom
jbardin/backend-hash
Dec 18, 2018
Merged

decode backend hash as uint64#19688
jbardin merged 1 commit intomasterfrom
jbardin/backend-hash

Conversation

@jbardin
Copy link
Copy Markdown
Member

@jbardin jbardin commented Dec 18, 2018

Older versions of terraform could save the backend hash number in a
value larger than an int.

While we could conditionally decode the state into an intermediary data
structure for upgrade, or detect the specific decode error and modify
the json, it seems simpler to just decode into the most flexible value
for now, which is a uint64.

Fixes #19146

Older versions of terraform could save the backend hash number in a
value larger than an int.

While we could conditionally decode the state into an intermediary data
structure for upgrade, or detect the specific decode error and modify
the json, it seems simpler to just decode into the most flexible value
for now, which is a uint64.
@jbardin jbardin requested a review from a team December 18, 2018 23:03
Copy link
Copy Markdown
Contributor

@apparentlymart apparentlymart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

The hashes are going to change immediately after upgrade anyway due to the new way we store the config internally, so just being liberal in how we read it seems good enough, indeed.

@jbardin jbardin merged commit bbaa8af into master Dec 18, 2018
@jbardin jbardin deleted the jbardin/backend-hash branch December 18, 2018 23:38
minamijoyo added a commit to minamijoyo/terraform that referenced this pull request May 28, 2019
Fixes hashicorp#21478

In hashicorp#19688, `terraform.BackendState.Hash` was fixed.
We also need to fix `states/statefile.backendStateV2.Hash`
minamijoyo added a commit to minamijoyo/terraform that referenced this pull request May 29, 2019
Fixes hashicorp#21478

In hashicorp#19688, `terraform.BackendState.Hash` was fixed.
We also need to fix `states/statefile.backendStateV2.Hash`
@ghost
Copy link
Copy Markdown

ghost commented Mar 30, 2020

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.

@ghost ghost locked and limited conversation to collaborators Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Decoding state file failed: json: cannot unmarshal number" when in a working directory initialized by an earlier version

2 participants