php AWS 开发工具包错误 - 签名尚未生效
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18703486/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
AWS SDK Error - Signature not yet current
提问by xmarcos
I'm using the aws-sdk-php
, the SesClient specifically, i've deployed an app in a customer server (hosted in DreamHost) and I'm getting this error:
我正在使用aws-sdk-php
SesClient,我已经在客户服务器(托管在 DreamHost 中)中部署了一个应用程序,但出现此错误:
Signature not yet current: 20130909T170846Z is still later than 20130909T170823Z (20130909T170323Z + 5 min.)
I'm guessing the server time is misconfigured, I'm trying to reach DH support to check on that, i bet that will take a while.
我猜服务器时间配置错误,我正在尝试联系 DH 支持以检查这一点,我敢打赌这需要一段时间。
Any other ideas? The app has been deployed many times before and i've never seen this error.
还有其他想法吗?该应用程序之前已部署多次,我从未见过此错误。
采纳答案by Martin Navarro
It seems that it's just a system date misconfiguration, check this
似乎只是系统日期配置错误,检查这个
https://forums.aws.amazon.com/thread.jspa?threadID=103764#
https://forums.aws.amazon.com/thread.jspa?threadID=103764#
That guy had the same issue.
那个人也有同样的问题。
回答by Kamrul
I had the similar issue. I was running my CI server from an Ubuntu EC2 instance and that has the time out of sync. I synchronised the time with NTP suing
我有类似的问题。我正在从 Ubuntu EC2 实例运行我的 CI 服务器,但时间不同步。我将时间与 NTP 同步
sudo ntpdate ntp.ubuntu.com
It started working fine.
它开始工作正常。
回答by Bish
I had the same issue recently. I did the following
我最近遇到了同样的问题。我做了以下
sudo ntpd -q -g
The -g
option is needed if your clock is way out of sync. It forces ntpd
to continue till it's in sync.
-g
如果您的时钟不同步,则需要该选项。它强制ntpd
继续直到同步。
回答by Michelle Glauser
I just encountered the same problem with a Django app deployed to AWS. The site error was really vague, but the error log that was emailed to me said, "JSONResponseError: JSONResponseError: 403 Forbidden {'message': 'Signature not yet current: 20150224T185106Z is still later than 20150224T185033Z (20150224T184533Z + 5 min.)'}" after a file path that pointed to Boto and Elastic Transcoder. Do the following on the server:
我刚刚在部署到 AWS 的 Django 应用程序中遇到了同样的问题。网站错误真的很模糊,但通过电子邮件发送给我的错误日志说,“JSONResponseError: JSONResponseError: 403 Forbidden {'message': 'Signature not yet current: 20150224T185106Z is still later than 20150224T185033Z (201502523Z)'+ }" 在指向 Boto 和 Elastic Transcoder 的文件路径之后。在服务器上执行以下操作:
ntpq -p
will tell you if you have ntp installed- If you don't have ntp, do
sudo apt-get install ntp
sudo service ntp stop
sudo ntpdate -s us.pool.ntp.org
will align your server's time with atomic clocks in the U.S. (this will need to be adjusted to your country)sudo service ntp start
ntpq -p
会告诉你是否安装了ntp- 如果你没有ntp,做
sudo apt-get install ntp
sudo service ntp stop
sudo ntpdate -s us.pool.ntp.org
将使您的服务器时间与美国的原子钟保持一致(这需要根据您所在的国家/地区进行调整)sudo service ntp start
Good luck! You can read more here: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/set-time.html#configure_ntp
祝你好运!您可以在此处阅读更多信息:http: //docs.aws.amazon.com/AWSEC2/latest/UserGuide/set-time.html#configure_ntp
回答by Duvan
Just need to be sure the time of you server is 5 minutes accuracy from current time. check the AM or PM time.
只需要确保您服务器的时间与当前时间相差 5 分钟。检查 AM 或 PM 时间。
回答by rai.skumar
I faced similar issue and after some investigation, found the root cause.
我遇到了类似的问题,经过一番调查,找到了根本原因。
Reason was that, my AWS instance/server timezone and my local system timezone from where i was making RESTful call were different. AWS assumes that request is also being made from the same timezone (it just ignore gap of 5 mins, not more than that). I was able to validate this by making test call from the AWS console and checking details in the logs (giving below Java snippet)
原因是,我的 AWS 实例/服务器时区和我进行 RESTful 调用的本地系统时区不同。AWS 假设请求也是从同一时区发出的(它只是忽略 5 分钟的间隔,不超过 5 分钟)。我能够通过从 AWS 控制台进行测试调用并检查日志中的详细信息来验证这一点(在 Java 代码段下面给出)
private String getDateString() {
Calendar cal = Calendar.getInstance();
DateFormat dfm = new SimpleDateFormat("yyyyMMdd'T'HHmmss'Z'");
dfm.setTimeZone(TimeZone.getTimeZone("UTC")); //server timezone
return dfm.format(cal.getTime());
}
回答by Suraj Nair
回答by Bhanuka Rathnayaka
For windows , check your time
and timezone
is correct. Time of your PC must be 5 minutes
accuracy from current time.
对于 windows ,请检查您的time
和timezone
是否正确。您的 PC 时间必须5 minutes
与当前时间准确。