AmazonError:我们计算的请求签名与您提供的签名不匹配



我正试图连接到aws服务器,但我从dynamo DB连接中收到了这个错误。

代码是这样的。

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;
},

param是这样的。

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"
},

有什么帮助吗?

我曾在程序中使用aws-cli和other中的其他凭据时出现过此错误。只需从aws-cli注销即可。

相关内容

最新更新