outscale/terraform-provider-outscale

Terraform >= 1.6 : Unsupported state file format

tybobab opened this issue · 2 comments

Hello,
When I want to use terraform >=1.6 with an OOS backend, the TFSTATE is in a bad file format.

Terraform Version

terraform 1.6.6
terraform 1.7.4
terraform 1.8.1
terraform 1.8.2

Terraform Configuration Files

terraform init -backend-config=bucket=[bucket_name] -backend-config=key=[tfstate_object_name] -backend-config=endpoint=https://oos.cloudgouv-eu-west-1.outscale.com/ -backend-config=skip_requesting_account_id=true
terraform apply --auto-approve

Debug Output

N/A

Crash Output

Error: Failed to load state: 2 problems:

  • Unsupported state file format: The state file could not be parsed as JSON: syntax error at byte offset 7.
  • Unsupported state file format: The state file does not have a "version" attribute, which is required to identify the format version.

Expected Behavior

The TFSTATE is in a good json file format and I can get the output.

Actual Behavior

The TFSTATE is malformed:

5985 { "version": 4, "terraform_version": "1.8.1", "serial": 1, "lineage": "38b19159-d77c-7ac5-6408-b7fff86e863d", "outputs": { .... }, "resources": [ .... ], "check_results": n

The TFSTATE begin with numbers instead of {
The TFSTATE end with no } and the value of check_results must be "null" instead of "n"

Steps to Reproduce

Use terraform >=1.6 and backend OOS

Hello,
It seems this problem is affecting all s3 providers that are not AWS:
hashicorp/terraform#34054
an easy solution is to add skip_s3_checksum = true.

Thank you, it's work