Skip to content

[Bug]: XAmzContentSHA256Mismatch with S3 backend #1834

Closed
@pablopla

Description

@pablopla

Terraform Version

Terraform v1.11.3 on linux_amd64

Linode Provider Version

version = "2.36.0"

Effected Terraform Resources

backend "s3"

Terraform Config Files

terraform {
  backend "s3" {
    access_key = "..."
    secret_key = "...
    endpoints = {
      s3 = "https://eu-central-1.linodeobjects.com"
    }
    region =  "eu-central-1"
    bucket  = "terraform-bucket"
    key  = "production.tfstate"
    skip_credentials_validation = true
    skip_region_validation = true
    skip_metadata_api_check = true
    skip_requesting_account_id = true
    skip_s3_checksum = true
  }
}

Debug Output

No response

Panic Output

No response

Expected Behavior

State is saved to Linode Object Storage.

Actual Behavior

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed.

│ Error: Failed to save state

│ Error saving state: failed to upload state: operation error S3: PutObject, https response error StatusCode: 400, RequestID: ..., HostID:
│ ..., api error XAmzContentSHA256Mismatch: UnknownError


│ Error: Failed to persist state to backend

│ The error shown above has prevented Terraform from writing the updated state to the configured backend. To allow for recovery, the state has been written to the file "errored.tfstate" in the current
│ working directory.

│ Running "terraform apply" again at this point will create a forked state, making it harder to recover.

│ To retry writing this state, use the following command:
│ terraform state push errored.tfstate

Steps to Reproduce

Use S3 backend as explained in the LInode docs.
Run:

terraform init
terraform apply

Last known terraform version that worked is v1.10.3 and linode provider v2.31.1.

Might be because of a new github.com/aws/aws-sdk-go-v2/service/s3 version
Related:
https://docs.aws.amazon.com/sdkref/latest/guide/feature-dataintegrity.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugissues that report a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions