Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: BR 无法备份到阿里云OSS

[TiDB Usage Environment] Production Environment / Test / Poc
[TiDB Version] 7.5.0
[BR Version] 7.5.0, 7.5.1, even 8.0 have the same error
[Reproduction Path]
- Create an Alibaba Cloud ECS instance (able to connect to the TiDB cluster) and install the BR command;
- Create a RAM role in the Alibaba Cloud console (e.g., ops-backup-runner) and grant this role the AliyunOSSFullAccess and AliyunSTSAssumeRoleAccess permissions.
- Assign the above role (ops-backup-runner) to the ECS instance created in step one.
- Create an OSS bucket in the Alibaba Cloud console;
- Execute the following command to back up data to the OSS bucket:
br backup full \
--pd "192.168.6.15:2379,192.168.6.16:2379,192.168.6.12:2379" \
--s3.endpoint "https://oss-cn-hangzhu.aliyuncs.com" \
--s3.provider "alibaba" \
--s3.region "oss-cn-hangzhu" \
--log-level debug \
--storage "s3://${you-bucket-name}/tidb/test"
[Encountered Problem: Problem Phenomenon and Impact]
BR cannot complete the backup. According to the error message, Alibaba Cloud returns an error page: OpenAPI自助诊断-阿里云OpenAPI开发者门户, which shows:
You are using an STS type AccessKey ID but did not initiate the request using STS authentication.
You used an STS type AccessKey ID but did not include the SecurityToken field in the request to indicate that you are using STS authentication.
Detailed error log is as follows:
[2024/04/04 18:05:18.071 +08:00] [ERROR] [main.go:60] ["br failed"] [error="error happen in store 2 at 192.168.6.18:20160: Io(Custom { kind: Other, error: \"failed to put object rusoto error Request ID: None Body: <?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<Error>\\n <Code>InvalidAccessKeyId</Code>\\n <Message>The OSS Access Key Id you provided does not exist in our records. The Security Token may be lost to specify that it is a STS Access Id.</Message>\\n <RequestId>660E7B5CF947FB36323C0335</RequestId>\\n <HostId>17study-ops-backup.oss-cn-hangzhou.aliyuncs.com</HostId>\\n <AWSAccessKeyId>STS.NUqcKhq7qeE7i4nKLu9KeaJbx</AWSAccessKeyId>\\n <EC>0002-00000003</EC>\\n <RecommendDoc>https://api.aliyun.com/troubleshoot?q=0002-00000003</RecommendDoc>\\n</Error>\\n\" }): [BR:KV:ErrKVStorage]tikv storage occur I/O error"] [errorVerbose="[BR:KV:ErrKVStorage]tikv storage occur I/O error\nerror happen in store 2 at 192.168.6.18:20160: Io(Custom { kind: Other, error: \"failed to put object rusoto error Request ID: None Body: <?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<Error>\\n <Code>InvalidAccessKeyId</Code>\\n <Message>The OSS Access Key Id you provided does not exist in our records. The Security Token may be lost to specify that it is a STS Access Id.</Message>\\n <RequestId>660E7B5CF947FB36323C0335</RequestId>\\n <HostId>17study-ops-backup.oss-cn-hangzhou.aliyuncs.com</HostId>\\n <AWSAccessKeyId>STS.NUqcKhq7qeE7i4nKLu9KeaJbx</AWSAccessKeyId>\\n <EC>0002-00000003</EC>\\n <RecommendDoc>https://api.aliyun.com/troubleshoot?q=0002-00000003</RecommendDoc>\\n</Error>\\n\" })\ngithub.com/pingcap/tidb/br/pkg/backup.(*pushDown).pushBackup\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/br/br/pkg/backup/push.go:218\ngithub.com/pingcap/tidb/br/pkg/backup.(*Client).BackupRange\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/br/br/pkg/backup/client.go:962\ngithub.com/pingcap/tidb/br/pkg/backup.(*Client).BackupRanges.func2\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/br/br/pkg/backup/client.go:876\ngithub.com/pingcap/tidb/br/pkg/utils.(*WorkerPool).ApplyOnErrorGroup.func1\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/br/br/pkg/utils/worker.go:76\ngolang.org/x/sync/errgroup.(*Group).Go.func1\n\t/go/pkg/mod/golang.org/x/sync@v0.3.0/errgroup/errgroup.go:75\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1650"] [stack="main.main\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/br/br/cmd/br/main.go:60\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:267"
[Resource Configuration] Enter TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachments: Screenshots/Logs/Monitoring]