【发布时间】:2021-10-08 23:13:13
【问题描述】:
gsutil -m rm gs://{our_bucket}/{dir}/{subdir}/*
...
Removing gs://our_bucket/dir/subdir/staging-000000000102.json...
Removing gs://our_bucket/dir/subdir/staging-000000000101.json...
CommandException: 103 files/objects could not be removed.
该命令能够找到包含 103 个 .JSON 文件的目录,并根据输出的 Removing gs://...“尝试”删除它们。我们收到CommandException: 103 files/objects could not be removed. 的原因是什么?
- 这适用于我的本地计算机
- 这适用于我们在本地运行的 docker 容器
- 这在我们需要它工作的 GCP 计算引擎上的 docker 容器中不起作用。
也许这是一个权限问题,计算引擎无权删除我们 GCS 中的文件?
编辑:我们在 Airflow 项目的 /config 文件夹中有一个服务帐户 JSON,并且该服务帐户共享给具有 Storage Admin 权限的 IAM 用户。也许 /config 文件夹中的 JSON 不足以为整个 GCP 计算引擎分配权限?我特别困惑,因为这个服务器是能够从我们的 BQ 数据库中查询,并写入 GCS,但不能从 GCS 中删除...
【问题讨论】:
-
第一步是确定实例拥有的权限(角色)。使用这些详细信息编辑您的问题。
-
@JohnHanley 查看编辑。我开始认为服务帐户 JSON 在服务器上的某处 是不够的……我们还需要做其他事情来为服务器分配权限吗?
-
当我尝试使用
gsutil cp而不是rm时,我确实收到了AccessDeniedException: 403 Insufficient Permission错误
标签: permissions google-cloud-storage gsutil google-cloud-sdk