Boto エラー SignatureDoesNotMatch
こんにちは、とびさんです。
以前作成した、botoを使用したAWSのIAM管理のコードがあるんですが、
最近実行したらエラーになりました。
※ネットに載ってなかったぽいので、メモ。
★エラー内容
BotoServerError: 403 Forbidden <ErrorResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/"> <Error> <Type>Sender</Type> <Code>SignatureDoesNotMatch</Code> <Message>Signature expired: 20161204T020459Z is now earlier than 20161204T022432Z (20161204T023932Z - 15 min.)</Message> </Error> <RequestId>e332d356-b9ca-11e6-9b24-91612b9e7f00</RequestId> </ErrorResponse>
"SignatureDoesNotMatch"から、シグネチャーをずっと疑ってて
シグネチャー変更したり、ユーザを追加したりしても変わらず。
よくよくエラーコードみると、15min。
うーん、、、まさかと思って、サーバ時間を確認したところ30分くらいずれてました。
試しに、dateコマンドで修正し実行したところ、正常動作に戻りました。
ntp入れ忘れてたorz
なので、以下の要領でntpをyumで入れて設定し完了。
ntpインストール
# yum install -y ntpd
設定ファイル編集
# vi /etc/ntp.conf ★以下、コメントアウト server 0.centos.pool.ntp.org iburst server 1.centos.pool.ntp.org iburst server 2.centos.pool.ntp.org iburst server 3.centos.pool.ntp.org iburst ★以下、追記 server -4 ntp.nict.jp server -4 ntp1.jst.mfeed.ad.jp server -4 ntp2.jst.mfeed.ad.jp server -4 ntp3.jst.mfeed.ad.jp
ntpd起動
# systemctl start ntpd
ntpd自動起動設定
# systemctl enable ntpd
ntp確認
# ntpq -p
そんじゃ