You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What gave me the hint to try spelling out the JSON in code is aws/aws-sdk-js#2534.
Why does this happen and are there any workarounds to specifying JSON files for credentials? Is this a fault with this dynamodb package or should I air my woes in aws/aws-sdk-js? I could work with the hardcoded credentials for now but later on reading from JSON files would be really preferred.
UPDATE:
Upgrading aws-sdk to 2.497.0 or downgrading to 2.186.0 helps with the config loading part. But then the same error crops up when I try to insert anything to DynamoDB:
constdynamo=require("dynamodb");constJoi=require("@hapi/joi");// This bit is okdynamo.AWS.config.loadFromPath("/home/me/.aws/credentials.json");varTestTable=dynamo.define("test-table",{hashKey: "name",schema: {"name": Joi.string(),"age": Joi.number().integer()}});console.log("Creating tables...");dynamo.createTables((err)=>{if(err){console.log("Error creating tables: ",err);}else{console.log("Tables have been created.");}});console.log("done creating tables.");// aaannnnddd POOF!TestTable.create({"name": "Chad","age": 26});
But I see that version 2.496.0 is installed, as required by this library. However this library specifies "^2.186.x" for the version of aws-sdk it needs. Perhaps this bug is reason enough to change this? Either,
a. strictly peg it to a 2.186.something release (maybe ~2.186.0 would be acceptable)
b. specify ~2.497.0, or a strict 2.497.0
skytreader
changed the title
EHOSTUNREACH when providing credentials via JSON file
EHOSTUNREACH when providing credentials via JSON file or creating data
Jul 23, 2019
Package version: 1.2.0
node version: 10.16.0
Take this code:
Running this with
node index.js
results toBut hardcoding the credentials like as follows:
has no problems.
What gave me the hint to try spelling out the JSON in code is aws/aws-sdk-js#2534.
Why does this happen and are there any workarounds to specifying JSON files for credentials? Is this a fault with this dynamodb package or should I air my woes in aws/aws-sdk-js? I could work with the hardcoded credentials for now but later on reading from JSON files would be really preferred.
UPDATE:
Upgrading aws-sdk to 2.497.0 or downgrading to 2.186.0 helps with the config loading part. But then the same error crops up when I try to insert anything to DynamoDB:
The exact error being
The text was updated successfully, but these errors were encountered: