【发布时间】: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