Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting missing credentials error, even though I am passing in s3 object #3

Open
sferoze opened this issue Sep 3, 2016 · 2 comments

Comments

@sferoze
Copy link

sferoze commented Sep 3, 2016

Here is my error:

{ [TimeoutError: Missing credentials in config]
I20160903-14:46:41.268(-4)?   message: 'Missing credentials in config',
I20160903-14:46:41.268(-4)?   code: 'CredentialsError',
I20160903-14:46:41.269(-4)?   time: Sat Sep 03 2016 14:46:41 GMT-0400 (EDT),
I20160903-14:46:41.269(-4)?   originalError: 
I20160903-14:46:41.269(-4)?    { message: 'Could not load credentials from any providers',
I20160903-14:46:41.269(-4)?      code: 'CredentialsError',
I20160903-14:46:41.269(-4)?      time: Sat Sep 03 2016 14:46:41 GMT-0400 (EDT),
I20160903-14:46:41.269(-4)?      originalError: 
I20160903-14:46:41.270(-4)?       { message: 'Connection timed out after 1000ms',
I20160903-14:46:41.270(-4)?         code: 'TimeoutError',
I20160903-14:46:41.270(-4)?         time: Sat Sep 03 2016 14:46:41 GMT-0400 (EDT) } } }

Here is my code

AWS.config.update
      accessKeyId: Meteor.settings.AWSAccessKeyId
      secretAccessKey: Meteor.settings.AWSSecretAccessKey
      region: 'US Standard'

    s3 = new AWS.S3()
    s3Sizer = new S3Sizer({"s3": s3})

s3Sizer.getFolderSize 'bucket.name', directory, (err, size) ->
      if err
        console.log(err)
      else
        console.log(size)

I use the same s3 object to delete files from the bucket and it works fine. How come with your package I keep getting this error and it does not work at all.

@sferoze
Copy link
Author

sferoze commented Sep 3, 2016

So I could not pass in the initialized s3 object but it did work when I initialized it like this

s3Sizer = new S3Sizer({accessKeyId: Meteor.settings.AWSAccessKeyId, secretAccessKey: Meteor.settings.AWSSecretAccessKey})

@ashutoshshubam
Copy link

is it fix now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants