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

BR - S3 Endpoint is not set when get bucket informations #42033

Closed
Lajule opened this issue Mar 8, 2023 · 2 comments · Fixed by #41889
Closed

BR - S3 Endpoint is not set when get bucket informations #42033

Lajule opened this issue Mar 8, 2023 · 2 comments · Fixed by #41889
Labels
affects-6.5 component/br This issue is related to BR of TiDB. severity/moderate type/bug The issue is confirmed as a bug.

Comments

@Lajule
Copy link

Lajule commented Mar 8, 2023

Bug Report

Hi,

We get following error when we try to backup our TiDB on s3 :

Error: s3 bucket and region are not matched, bucket=ringover-eu-2023, input region=fr-par, real region=us-east-1

After checking the code, i think it's because the endpoint is not set when calling GetBucketRegionWithClient here : https://github.com/pingcap/tidb/blob/master/br/pkg/storage/s3.go#L374

My guess is that you need a WithEndpoint when creating aws.Config there : https://github.com/pingcap/tidb/blob/master/br/pkg/storage/s3.go#L357

You can check this comment in AWS SDK : https://github.com/aws/aws-sdk-go/blob/main/service/s3/s3manager/bucket_region.go#L91

Use BR to backup DB

Try to backup with BR and specify a endpoint :

tiup br backup full --pd "$PDIP:$PDPORT" --s3.endpoint "https://s3.fr-par.scw.cloud/" -s "s3://bucket1/TEST1" --s3.region "fr-par" --send-credentials-to-tikv=true --ca "$CAFILE" --key "$KEYFILE" --cert "$CERTFILE"

This is the cli we use, the "bucket1" exists and the region fr-par is the good one, you can see the result of an aws cli call :

$ aws s3api get-bucket-location --bucket bucket1 --profile scw { "LocationConstraint": "fr-par" }

Backup is on S3

The backup fails

We get following :
Error: s3 bucket and region are not matched, bucket=ringover-eu-2023, input region=fr-par, real region=us-east-1

The region returned is not the same than the provided in cli because the endpoint is not set

TiDB 6.5

Everything works well before 6.5

regards

@Lajule Lajule added the type/bug The issue is confirmed as a bug. label Mar 8, 2023
@Lajule Lajule closed this as completed Mar 8, 2023
@Lajule Lajule reopened this Mar 10, 2023
@Lajule
Copy link
Author

Lajule commented Mar 16, 2023

We found the issue, we are sending a PR
regards,

@dveeden
Copy link
Contributor

dveeden commented Mar 22, 2023

Let's keep the issue open until the PR has been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-6.5 component/br This issue is related to BR of TiDB. severity/moderate type/bug The issue is confirmed as a bug.
Projects
None yet
3 participants