Firebase存储:以编程方式从/ tmp /中删除文件>> [

问题描述 投票:0回答:1
我破坏了Firebase云功能,并意外地创建了存储在gs://myapp.appspot.com//tmp/中的190万张图像。该双斜杠是准确的-服务器正在写入/tmp/,我想这是上面提到的路径的结果。

我现在想删除那些文件(它们都是废话)。我尝试像这样使用Python包装器:

export GOOGLE_APPLICATION_CREDENTIALS="../secrets/service-account.json"

然后:

from google.cloud import storage storage_client = storage.Client() bucket = storage_client.get_bucket('tmp') blobs = bucket.list_blobs(bucket='tmp', prefix='') for blob in blobs: print(' * deleting', blob) blob.delete()

但是抛出:

google.api_core.exceptions.Forbidden: 403 GET https://storage.googleapis.com/storage/v1/b/tmp?projection=noAcl: [email protected] does not have storage.buckets.get access to tmp.

有人知道如何允许管理员凭据从/tmp/中删除吗?任何指针都将非常有用!

我破坏了Firebase云功能,并意外地创建了190万张存储在gs://myapp.appspot.com//tmp/中的图像。斜杠是正确的-服务器正在写入/ tmp /,我猜是...

python firebase google-cloud-storage firebase-storage
1个回答
1
投票
我能够使用gsutil命令重现此问题:
© www.soinside.com 2019 - 2024. All rights reserved.