ibm-cloud - IBM Cloud COS:使用 S3 API get-bucket-location 返回未找到存储桶
问题描述
我正在为 IBM Cloud COS 使用 S3 API,并且从 get-bucket-location 收到意外的 bucket not found 错误。
我的存储桶存在于 us-south 区域并显示 s3 ls 命令,但获取该区域失败。我正在使用 java AWS api,但可以使用 aws cli 重现它。
[08:07] jwilliams:~ $ aws --profile ibm --endpoint-url https://s3-api.us-geo.objectstorage.softlayer.net s3api get-bucket-location --bucket s3-wzd-dv-integrationtest-so-1
An error occurred (NoSuchBucket) when calling the GetBucketLocation operation: The specified bucket does not exist.
[08:07] jwilliams:~ $ aws --profile ibm --endpoint-url https://s3-api.us-geo.objectstorage.softlayer.net s3 ls
2018-12-05 10:06:00 s3-wzd-dv-integrationtest-ea-1
2018-12-05 10:04:51 s3-wzd-dv-integrationtest-so-1
2018-11-29 15:59:19 wzd-jw-bucket-1
2018-11-29 16:14:55 wzd-jw-bucket-2
解决方案
当您创建“区域”存储桶而不是“跨区域”时,会发生此类错误。您可以从 IBM Cloud 控制台验证存储桶的位置。Bucket -> Configuration 还会为您提供可以使用的公共 URL。
根据地区,试试这些:
aws --profile ibm --endpoint-url https://s3.us-east.objectstorage.softlayer.net s3 ls
aws --profile ibm --endpoint-url https://s3.us-south.objectstorage.softlayer.net s3 ls
推荐阅读
- hive - 该文件不属于 hive 并且加载数据也不作为 hive 运行
- powershell - 使用包含 $ 作为密码的变量
- node.js - Node-sass 没有与 TestCafe Docker Image 中使用的节点版本绑定
- python-3.x - 口译员包含什么?
- javascript - javascript - 减少巨大的数组列表以使其更具可读性
- python - 如何将巨大的html拆分为小文件
- php - 在数组循环中使用变量作为键的一部分 - PHP
- javascript - web3 ethereum subscribe 并不总是有效
- visual-studio-code - 你如何在 Visual Studio Code 中显示你所在的函数?
- java - 在 Java SDK 中订购 BigQuery 结果