简体   繁体   English

公共 GC 存储访问失败,匿名调用者没有 storage.objects.get 访问权限

[英]public GC storage access fails with Anonymous caller does not have storage.objects.get access

I'm trying to access Sentinel2 public data as described here: https://cloud.google.com/storage/docs/public-datasets我正在尝试按照此处所述访问 Sentinel2 公共数据: https://cloud.google.com/storage/docs/public-datasets

That document says: "By contrast, accessing public data with a Cloud Storage API link does not require authentication."该文件说:“相比之下,使用 Cloud Storage API 链接访问公共数据不需要身份验证。”

However I'm getting the following error: "com.google.cloud.storage.StorageException: Anonymous caller does not have storage.objects.get access to the Google Cloud Storage object."但是我收到以下错误:“com.google.cloud.storage.StorageException:匿名调用者没有 storage.objects.get 访问 Google Cloud Storage object。” I'm using Java API:我正在使用 Java API:

storage = StorageOptions.getDefaultInstance().getService()存储 = StorageOptions.getDefaultInstance().getService()

blob = storage.get(BlobId.of("bucketName", "objectName")) blob = storage.get(BlobId.of("bucketName", "objectName"))

Does anyone know how to download those files using Java API?有谁知道如何使用 Java API 下载这些文件? Thanks!谢谢!

The object needs to be publicly readable in order to access it anonymously, and that error indicates the object you're trying to read is not publicly readable. object 需要公开可读才能匿名访问,该错误表明您尝试阅读的 object 不可公开阅读。

The Sentinel-2 bucket, gcp-public-data-sentinel-2 , does not allow unauthenticated, anonymous listing (although you should be able to browse it while logged in as any account). Sentinel-2 存储桶gcp-public-data-sentinel-2不允许未经身份验证的匿名列表(尽管您应该能够在以任何帐户登录时浏览它)。 Instead, the object index.csv.gz inside the bucket contains a listing of the contents which you may access.相反,存储桶内的 object index.csv.gz包含您可以访问的内容列表。 Individual objects can be downloaded anonymously and have a fairly lengthy file path, for example:单个对象可以匿名下载并具有相当长的文件路径,例如:

https://storage.googleapis.com/gcp-public-data-sentinel-2/tiles/04/E/CR/S2B_MSIL1C_20190301T202209_N0207_R042_T04ECR_20190301T212521.SAFE/GRANULE/L1C_T04ECR_A010364_20190301T202210/IMG_DATA/T04ECR_20190301T202209_B01.jp2 https://storage.googleapis.com/gcp-public-data-sentinel-2/tiles/04/E/CR/S2B_MSIL1C_20190301T202209_N0207_R042_T04ECR_20190301T212521.SAFE/GRANULE/L1C_T04ECR_A010364_20190301T202210/IMG_DATA/T04ECR_20190301T202209_B01.jp2

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 StorageException:匿名调用者没有 storage.objects.get 访问权限 - StorageException: Anonymous caller does not have storage.objects.get access 如何处理匿名调用者没有 storage.objects.get 访问 Google Cloud Storage object - How to handle Anonymous caller does not have storage.objects.get access to the Google Cloud Storage object 服务帐户没有对 Google Cloud Storage 的 storage.objects.get 访问权限 - service account does not have storage.objects.get access for Google Cloud Storage 错误:(gcloud.builds.submit)错误 403:<service account> 没有 storage.objects.get 访问谷歌云存储 object</service> - ERROR: (gcloud.builds.submit) Error 403: <SERVICE ACCOUNT> does not have storage.objects.get access to the Google Cloud Storage object 我获得存储权限的服务帐户没有对 Google Cloud Storage 存储桶的 storage.objects.list 访问权限 - My service account which was given storage permissions does not have storage.objects.list access to the Google Cloud Storage bucket Firebase Admin Storage:调用者没有权限 - Firebase Admin Storage: The caller does not have permission 谷歌云存储公共访问 - Google Cloud Storage Public Access Firebase 存储:用户无权访问 - Firebase Storage: User does not have permission to access Firebase 存储异常:用户无权访问此 object - Firebase Storage Exception: User does not have permission to access this object 云存储 - 禁用公共访问保护,但失败 - Cloud Storage - Disabled Public Access Prevention, but Failed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM