从这段代码中我得到以下错误
require "vendor/autoload.php";
use Aws\Common\Aws;
use Aws\DynamoDb\DynamoDbClient;
use Aws\DynamoDb\Enum\ComparisonOperator;
use Aws\DynamoDb\Enum\KeyType;
use Aws\DynamoDb\Enum\Type;
$aws = Aws::factory(array(
'key' => '[clipped]',
'secret' => '[clipped]',
'region' => Region::US_WEST_1
));
$client = $aws->get("dynamodb");
$tableName = "ExampleTable";
$result = $client->createTable(array(
"TableName" => $tableName,
"AttributeDefinitions" => array(
array(
"AttributeName" => "Id",
"AttributeType" => Type::NUMBER
)
),
"KeySchema" => array(
array(
"AttributeName" => "Id",
"KeyType" => KeyType::HASH
)
),
"ProvisionedThroughput" => array(
"ReadCapacityUnits" => 5,
"WriteCapacityUnits" => 6
)
));
print_r($result->getPath('TableDescription'));
尝试将表添加到AWS的DynamoDB时,我收到以下错误。
PHP Fatal error: Uncaught Aws\\DynamoDb\\Exception\\DynamoDbException: AWS Error Code:
InvalidSignatureException,
Status Code: 400,
AWS Request ID: [clipped],
AWS Error Type: client,
AWS Error Message: Signature expired: 20130818T021159Z is now earlier than
20130818T021432Z (20130818T022932Z - 15 min.),
User-Agent: aws-sdk-php2/2.4.3 Guzzle/3.7.2 curl/7.21.6 PHP/5.3.6-13ubuntu3.9\n thrown in
/var/www/vendor/aws/aws-sdk-php/src/Aws/Common/Exception/NamespaceExceptionFactory.php on
line 91
到目前为止我已经:
答案 0 :(得分:86)
您的本地系统时间似乎不正确。我在AWS S3上遇到了类似的问题,我的系统时钟偏差了30分钟。
如果您正在运行ubuntu,请尝试更新系统时间:
sudo ntpdate ntp.ubuntu.com
答案 1 :(得分:2)
如果您已经安装了ntpdate,也可以重新启动日期服务以解决问题。
sudo service ntpdate stop
sudo service ntpdate start
答案 2 :(得分:1)
如果您在Mac上使用docker-machine
,则可以使用以下命令解决:
docker-machine ssh default 'sudo ntpclient -s -h pool.ntp.org'
答案 3 :(得分:1)
流浪者项目的快速说明:这通常由vagrant reload
解决。