Closed legioner0 closed 1 year ago
@legioner0, can you confirm if the object in Ceph contains just the JSON body or the full payload shown below?
b4
{
"version": 4,
"terraform_version": "1.6.1",
"serial": 1,
"lineage": "dbe9de12-d1b8-5a7f-83e9-d619219cd6f8",
"outputs": {},
"resources": [],
"check_results": null
}
0
x-amz-checksum-sha256:xCIxJnT7YQ9mVY7ZDMAB2gJ8Hy6XkHCCsljQt/shx94=
If it contains the full payload, it looks like Ceph is not correctly handling aws-chunked
encoding, which is required for chunked transfers with AWS Signature v4. See https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-streaming.html for more information.
@gdavison, yes state file on s3-compatible bucket contains full payload with size and x-amz-checksum-sha256
line.
I suppose, that parameter skip_s3_checksum
(#34127) will fix problem.
Confirmed, skip_s3_checksum
fix the issue with S3-compatible service.
terraform {
required_version = ">= 1.6.3"
backend "s3" {
bucket = "<bucket>"
key = "<key>"
region = "<region>"
skip_region_validation = true
skip_credentials_validation = true
skip_requesting_account_id = true
skip_metadata_api_check = true
skip_s3_checksum = true
use_path_style = true
profile = "<profile>"
endpoints = {
s3 = "https://<custom s3 service endpoint>"
}
}
}
@legioner0 is it OK to close this issue?
yes, thanks
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.
Terraform Version
Terraform Configuration Files
Debug Output
export TF_LOG=trace ; terraform apply
(with empty state)export TF_LOG=trace ; terraform init
(second call after apply)Expected Behavior
correct state file on s3
Actual Behavior
terraform apply
save corrupted state file on S3 backend. As far as I can see: data before json - size of json, data after json - header with sha256 checksum.Steps to Reproduce
terraform init
terraform apply
terraform init
Additional Context
This environment uses S3-compatible service provider.
References
No response