LoginSignup
1
1

AWS CLI で RequestTimeTooSkewed が出たら

Last updated at Posted at 2023-11-24

結論

AWS CLI で RequestTimeTooSkewed が出たら ntpdate で時刻を修正する

手順

下記を実行する

sudo apt install ntpdate
sudo ntpdate ntp.nict.jp

著者の環境

  • Windows11 + WSL2(Ubuntu 22.04)
  • AWS-CLI2

起こったこと

ある日 aws s3 sync をしようとしたら下記のメッセージとともにエラー終了した。

An error occurred (RequestTimeTooSkewed) when calling the ListObjectsV2 operation: The difference between the request time and the current time is too large.

date コマンドでUbuntuが認識している現在時刻を確認すると、実時刻から20分ほど遅れていた。

調べると hwclock というコマンドでハードウェアクロックとシステム時計を同期できるらしいが、自分の環境では hwclock が使用できなかった。
(書いている途中に、もう一度エラーメッセージを見るために実行すると Permission denied だったので sudo をつけたら実行できた。)

システム時計が実時刻とずれているのが原因らしいとわかったので、同期する方法を調べて ntpdate を試したら直った。

1
1
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
1
1