【问题标题】:AmazonError: The request signature we calculated does not match the signature you providedAmazonError:我们计算的请求签名与您提供的签名不匹配
【发布时间】:2018-07-27 07:33:35
【问题描述】:

我正在尝试连接到 aws 服务器,但我从 dynamo DB connect 收到此错误。

代码是这样的。

vuaws.dbclient().getItem('users', usrname, opts, function(err, data) {
      if (err || !data) {
        vulog.error('ddb: error in finding user \n',err);
      } else {
        vulog.debug('user got from db: ');

DB客户端就是这样一个函数。

  dbclient: function() {
    return dynode;
  },

参数是这个。

users admin@gmail.com { ConsistentRead: true,
  AttributesToGet: [ 'role', 'password' ] }

我收到的完整错误是这样的。

{ AmazonError: The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
    at IncomingMessage.<anonymous> (/home/evbooth/Desktop/hirekwick/node_modules/dynode/lib/dynode/request.js:57:19)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickDomainCallback (internal/process/next_tick.js:218:9)
  type: 'InvalidSignatureException',
  serviceName: 'com.amazon.coral.service',
  message: 'The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.',
  statusCode: 400,
  action: 'GetItem',
  retry: [Getter] }

在 vuaws.js 中的 dynamodb 就是这样定义的。

  dynode.auth(vuconst.dynodeauth);
    vulog.info('dynode.attached');
    var dynamodb = new AWS.DynamoDB();
    vulog.info('dynamodb connected:');

vuconst.dynodeauth

是这样的。

dynodeauth: {
    "accessKeyId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "secretAccessKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "region": "us-west-2"
  },

有什么帮助吗?

【问题讨论】:

  • 那么....你检查过密钥和签名方法了吗?
  • @James 是的,我创建了没有 + 或 / 的密钥,然后我也交叉检查了服务器时间
  • 好的,你能展示一下你是如何配置vuaws的吗?
  • @James 问题已编辑
  • 就这样吗?您没有在其他任何地方传递任何凭据或任何东西?

标签: node.js database amazon-web-services amazon-dynamodb


【解决方案1】:

当我在 aws-cli 和我的程序中使用其他凭据时,我曾经遇到过这个错误。只需从 aws-cli 注销即可。

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2022-01-18
  • 2021-10-15
  • 2014-02-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-07-23
  • 2017-12-20
相关资源
最近更新 更多