普通网友 2012-06-23 22:48
浏览 48

使用带有DynamoDB的php SDK会产生“STS_Exception”,但在S3中可以正常工作

Server setup:

CentOS 6.2 64bit Ngingx 1.2.1 PHP 5.3 + PHP FPM

I installed the SDK as a package through PEAR. I setup config.inc.php. I'm including the sdk with require_once 'AWSSDKforPHP/sdk.class.php';

I also setup my DynamoDB and have a table with some sample items.

If I do something like $dynamodb = new AmazonDynamoDB(); I get the following error in the browser:

Fatal error: Uncaught exception 'STS_Exception' with message 'Temporary credentials from the AWS Security Token Service could not be retrieved using the provided long term credentials. It's possible that the provided long term credentials were invalid.' in /usr/share/pear/AWSSDKforPHP/sdk.class.php:763 Stack trace: #0 [internal function]: CFRuntime->cache_sts_credentials(Object(CacheFile), Array) #1 /usr/share/pear/AWSSDKforPHP/lib/cachecore/cachecore.class.php(136): call_user_func_array(Array, Array) #2 /usr/share/pear/AWSSDKforPHP/services/dynamodb.class.php(287): CacheCore->response_manager(Array, Array) #3 /var/www/picobama.com/public/canvas.php(14): AmazonDynamoDB->__construct(Array) #4 {main} thrown in /usr/share/pear/AWSSDKforPHP/sdk.class.php on line 763

However, if I initiate the S3 or EC2 class, there are no errors.

I even created a new key/secret combination to use in my config.inc.php thinking there might be something wrong with the default one, but didn't work.

I'm new to the SDK, I don't know what else to try, I would very much appreciate any help.

  • 写回答

1条回答 默认 最新

  • dongyi2534 2012-06-27 22:23
    关注

    Apparently there was a discrepancy between my server's time and the Amazon's server's time, which caused there to be an authentication error.

    Fixed easily by installing/configuring NTP (Network Time Protocol).

    See the url below for instructions in CentOS:
    http://www.cyberciti.biz/faq/howto-install-ntp-to-synchronize-server-clock/

    评论

报告相同问题?

悬赏问题

  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类