6
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AWS SDK for PHP で出たエラー

Last updated at Posted at 2016-04-19

vagrant上からaws sdk for PHPを使ってアクセスしていた時の事。いきなり以下のようなエラーログがでてきてlistObjectsがエラーとなる事象に

2016-04-19 14:46:58] Server.CRITICAL: Aws\S3\Exception\S3Exception: Error executing "ListObjects" on "https://s3-ap-northeast-1.amazonaws.com/hoge-assets?prefix=kakikubo&encoding-type=url"; AWS HTTP error: Client error response [url] https://s3-ap-northeast-
1.amazonaws.com/assets?prefix=kakikubo&encoding-type=url [status code] 403 [reason phrase] Forbidden RequestTimeTooSkewed (client): The difference between the request time and the current time is too large. - <?xml version="1.0" encoding="UTF-8"?> <Error><Code>RequestTimeTooSkewed</Code><Message>The difference between the request time and the current time is too large.</Message><RequestTime>20160419T054656Z</RequestTime><ServerTime>2016-04-19T06:02:40Z</ServerTime><MaxAllowedSkewMilliseconds>900000</MaxAllowedSkewMilliseconds><RequestId>11E8E8CEEE006EDB</RequestId>

"Forbidden RequestTimeTooSkewed"って一瞬なんのことかと思いましたが、どうやら時刻が問題みたいでした。AWS SDKを叩いたクライアント側の時刻と、エンドポイント側の時刻がずれすぎなのが問題のようなので、

$ sudo ntpdate ntp.nict.jp
19 Apr 15:03:23 ntpdate[4495]: step time server 133.243.238.243 offset 941.644282 sec

とすれば解消しました。

眠いのでメモ書きしたかったのでした

6
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?