开发者社区> 问答> 正文

关于创建存储空间报错


下面是创建存储空间中报的异常,
这里BucketInfo info = ossClient.getBucketInfo(bucketName);报的异常,下面是异常信息,大家看下。


com.aliyun.oss.OSSException: The bucket you visit is not belong to you.
[ErrorCode]: AccessDenied
[RequestId]: 5BEBEFBECE65897ED51E07C7
[HostId]: crowd.oss-cn-beijing.aliyuncs.com
[ResponseError]:
<?xml version="1.0" encoding="UTF-8"?>
<Error>
  <Code>AccessDenied</Code>
  <Message>The bucket you visit is not belong to you.</Message>
  <RequestId>5BEBEFBECE65897ED51E07C7</RequestId>
  <HostId>crowd.oss-cn-beijing.aliyuncs.com</HostId>
</Error>


    at com.aliyun.oss.common.utils.ExceptionFactory.createOSSException(ExceptionFactory.java:99)
    at com.aliyun.oss.internal.OSSErrorResponseHandler.handle(OSSErrorResponseHandler.java:69)
    at com.aliyun.oss.common.comm.ServiceClient.handleResponse(ServiceClient.java:248)
    at com.aliyun.oss.common.comm.ServiceClient.sendRequestImpl(ServiceClient.java:130)
    at com.aliyun.oss.common.comm.ServiceClient.sendRequest(ServiceClient.java:68)
    at com.aliyun.oss.internal.OSSOperation.send(OSSOperation.java:94)
    at com.aliyun.oss.internal.OSSOperation.doOperation(OSSOperation.java:149)
    at com.aliyun.oss.internal.OSSOperation.doOperation(OSSOperation.java:113)
    at com.aliyun.oss.internal.OSSBucketOperation.getBucketInfo(OSSBucketOperation.java:1212)
    at com.aliyun.oss.OSSClient.getBucketInfo(OSSClient.java:1203)
    at com.aliyun.oss.OSSClient.getBucketInfo(OSSClient.java:1197)
    at com.aliyun.oss.demo.HelloOSS.main(HelloOSS.java:93)

展开
收起
孤狼雷 2018-11-14 18:05:29 2440 0
1 条回答
写回答
取消 提交回答
  • 后端开发者,阿里云用户
    The bucket you visit is not belong to you.

    您访问的这个存储空间不属于您。

    检查这几个参数是否正确:


    $accessKeyId = "<yourAccessKeyId>";
    $accessKeySecret = "<yourAccessKeySecret>";
    // Endpoint以杭州为例,其它Region请按实际情况填写。
    $endpoint = "http://oss-cn-hangzhou.aliyuncs.com";
    // 存储空间名称。
    $bucket= "<yourBucketName>";




    2018-11-15 09:07:16
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
ECS块储存产品全面解析 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载