开发者社区> 问答> 正文

使用阿里云oss存储时发现nginx会报错


2015/10/23 15:39:48 [error] 28807#0: *51658425 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught exception 'Aliyun\OSS\Exceptions\OSSException' with message 'The specified key does not exist.' in /opt/lelink/service/Aliyun/src/Aliyun/OSS/Utilities/OSSExceptionFactory.php:16
Stack trace:
#0 /opt/lelink/service/Aliyun/src/Aliyun/OSS/ResponseHandlers/OSSErrorResponseHandler.php(29): Aliyun\OSS\Utilities\OSSExceptionFactory->createFromError(Object(Aliyun\OSS\Models\OSSError))
#1 /opt/lelink/service/Aliyun/src/Aliyun/Common/Communication/OpenServiceClient.php(40): Aliyun\OSS\ResponseHandlers\OSSErrorResponseHandler->handle(Object(Aliyun\Common\Communication\HttpResponse))
#2 /opt/lelink/service/Aliyun/src/Aliyun/Common/Communication/RetryableServiceClient.php(32): Aliyun\Common\Communication\OpenServiceClient->sendRequest(Object(Aliyun\Common\Communication\HttpRequest), Object(Aliyun\Common\Communication\ExecutionContext))
#3 /opt/lelink/service/Aliyun/src/Aliyun/Common/Communication/RetryableServiceClient.php(27): Aliyun\Common\Communication\RetryableServiceClient-"


nginx会不停的报这个错误,请教一下,这个问题影响使用么?该怎么解决这个问题?

展开
收起
且听风吟lyg 2015-10-23 15:57:22 8591 0
3 条回答
写回答
取消 提交回答
  • 这个出错是比如读一个OSS不存在的Object
    OSS会返回404, 类似如下这样的错误信息,
    <Error>
      <Code>NoSuchKey</Code>
      <Message>The specified key does not exist.</Message>
      <RequestId>562DA574921522DC3F08AC93</RequestId>
      <HostId>oss.aliyuncs.com</HostId>
      <Key>test.txxxxxxxxxxxxx</Key>
    </Error>

    PHP SDK V2封装了一层,抛出了异常。
    如果不想看到这个错误,那就在调用的外层catch住这个异常,并且做下处理。
    2015-10-26 12:06:39
    赞同 展开评论 打赏
  • 回1楼啊里新人的帖子
    谢谢。nginx不停 刷这个日志,找开发说阿里云的不会出错,不是代码的问题
    2015-10-23 18:35:50
    赞同 展开评论 打赏
  • 这块不是很熟,帮你顶一下吧
    2015-10-23 16:16:44
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
阿里云产品十一月刊来啦! 立即下载
阿里云产品安全基线白皮书 立即下载
云原生产业大会:阿里云精彩内容集锦 立即下载