Google Cloud S3 和 rclone:错误 400:启用统一存储桶级访问时无法为对象插入旧式 ACL

Google Cloud S3 和 rclone:错误 400:启用统一存储桶级访问时无法为对象插入旧式 ACL

我正在尝试配置rclone以访问 Google 云存储桶(恰好由 terra.bio 管理。我的rclone配置如下:

[terra]
type = google cloud storage
object_acl = private
bucket_acl = private
token = {"access_token":"XXXXX","token_type":"Bearer","refresh_token":"XXXXX","expiry":"XXXXXX"}

我已尝试设置authenticatedReadprivate但得到相同的结果。

我看到的错误信息是:

2022/08/13 18:24:44 Failed to copy: googleapi: Error 400: Cannot insert legacy ACL for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access, invalid

答案1

解决方案如下,感谢@John Hanley 的评论:https://github.com/rclone/rclone/issues/3644

以下任一方法均可解决该问题:

设置环境变量:

export RCLONE_GCS_BUCKET_POLICY_ONLY=true

或者使用 rclone 参数:

rclone --gcs-bucket-policy-only copy localfile gcp:bucket/path/

相关内容