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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 18:02:57  来源:igfitidea点击:

AWS SDK Error - Signature not yet current

phpamazon-web-servicesdreamhost

提问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-phpSesClient,我已经在客户服务器(托管在 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 -goption is needed if your clock is way out of sync. It forces ntpdto 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 的文件路径之后。在服务器上执行以下操作:

  1. ntpq -pwill tell you if you have ntp installed
  2. If you don't have ntp, do sudo apt-get install ntp
  3. sudo service ntp stop
  4. sudo ntpdate -s us.pool.ntp.orgwill align your server's time with atomic clocks in the U.S. (this will need to be adjusted to your country)
  5. sudo service ntp start
  1. ntpq -p会告诉你是否安装了ntp
  2. 如果你没有ntp,做 sudo apt-get install ntp
  3. sudo service ntp stop
  4. sudo ntpdate -s us.pool.ntp.org将使您的服务器时间与美国的原子钟保持一致(这需要根据您所在的国家/地区进行调整)
  5. 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

If you are using windows, just set the current time and time zone automatically. It will resolve the issue.

如果您使用的是 Windows,只需自动设置当前时间和时区。它将解决问题。

enter image description here

在此处输入图片说明

回答by Bhanuka Rathnayaka

For windows , check your timeand timezoneis correct. Time of your PC must be 5 minutesaccuracy from current time.

对于 windows ,请检查您的timetimezone是否正确。您的 PC 时间必须5 minutes与当前时间准确。