Skip to content
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

error setting up OVH S3 as terraform backend #7747

Open
Crocmagnon opened this issue Apr 12, 2025 · 1 comment
Open

error setting up OVH S3 as terraform backend #7747

Crocmagnon opened this issue Apr 12, 2025 · 1 comment

Comments

@Crocmagnon
Copy link

Hello,

I'm getting an error when setting OVH S3 as my terraform backend.
I followed this guide: https://help.ovhcloud.com/csm/en-public-cloud-compute-terraform-high-perf-object-storage-backend-state?id=kb_article_view&sysparm_article=KB0051345

Here is my config, copied from the guide.
I have proper access and secret keys, redacted here. It looks like it was able to fetch the state but it can't write it.

# backend.tf
terraform {
  backend "s3" {
    bucket = "terraform-state-gaugendre"
    key    = "terraform.tfstate"
    region = "gra"
    endpoints = {
      s3 = "https://s3.gra.io.cloud.ovh.net/"
    }
    skip_credentials_validation = true
    skip_region_validation      = true
    skip_requesting_account_id  = true
    skip_s3_checksum            = true

    access_key                  = "xx"
    secret_key                  = "xx"
  }
}
$ terraform init
Initializing the backend...
Do you want to copy existing state to the new backend?
  Pre-existing state was found while migrating the previous "local" backend to the
  newly configured "s3" backend. No existing state was found in the newly
  configured "s3" backend. Do you want to copy this state to the new "s3"
  backend? Enter "yes" to copy and "no" to start with an empty state.

  Enter a value: yes

╷
│ Error: Error copying state from the previous "local" backend to the newly configured
│ "s3" backend:
│     failed to upload state: operation error S3: PutObject, https response error StatusCode: 400, RequestID: txdd5953c297c4485db41d1-0067fa53d5, HostID: txdd5953c297c4485db41d1-0067fa53d5, api error InvalidArgument: Invalid Argument.
│ 
│ The state in the previous backend remains intact and unmodified. Please resolve
│ the error above and try again.
│ 
│ 
╵
$ terraform -version
Terraform v1.11.3
on darwin_arm64
+ provider registry.terraform.io/ovh/ovh v2.1.0

I tried to contact the support using the big shiny button but they told me that they don't offer support for this.

Image

I found #5430 discussing a similar issue but the workarounds mentioned seem already integrated in the guide.

@Crocmagnon Crocmagnon changed the title Error copying state from the previous "local" backend to the newly configured error setting up OVH S3 as terraform backend Apr 12, 2025
@Crocmagnon
Copy link
Author

Crocmagnon commented Apr 13, 2025

After seeing this warning on the "getting started with S3" guide, I decided to try to downgrade terraform to 1.10.5, which fixes the issue.

Image

Maybe a similar warning should be added to the S3 backend guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant