Sam-Meech-Ward/image-upload-s3

Cant seem to resolve this issue. Followed everything your tutorial provided and was working fine but now its giving this error ,hoping to learn a solution from you of this.

Opened this issue · 3 comments

Error: connect ENETUNREACH 169.254.169.254:80
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) {
message: 'Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1',
errno: -4062,
code: 'CredentialsError',
syscall: 'connect',
address: '169.254.169.254',
port: 80,
time: 2021-08-29T18:57:20.318Z,
originalError: {
message: 'Could not load credentials from any providers',
errno: -4062,
code: 'CredentialsError',
syscall: 'connect',
address: '169.254.169.254',
port: 80,
time: 2021-08-29T18:57:20.318Z,
originalError: {
message: 'EC2 Metadata roleName request returned error',
errno: -4062,
code: 'ENETUNREACH',
syscall: 'connect',
address: '169.254.169.254',
port: 80,
time: 2021-08-29T18:57:20.317Z,
originalError: [Object]
}
}
}

I am also having this issue.

Finally i figured it out.
Use aws.config.update({
accessKeyId: process.env.AWSAccessKeyId,
secretAccessKey: process.env.AWSSecretKey,
region: process.env.AWSRegion,
});
Instead of giving params directly in s3 constructor, it will work fine.

i am still getting this error
will you please tell me how can I fix it