Nichole A. Miler
Nichole A. Miler

Reputation: 1371

AWS with nodejs failed, error of BucketAlreadyOwnedByYou

I use this npm https://github.com/RiptideElements/s3fs and got this error of

Unhandled rejection BucketAlreadyOwnedByYou: Your previous request to create the
 named bucket succeeded and you already own it.

In my app.js I do

var s3 = require('./config/db.js');
var fs = require('fs');
var S3FS = require('s3fs');

var s3_config = require('./config/s3_config');
var s3fsImpl = new S3FS(s3_config.bucket,{
  accessKeyId : s3_config.key,
  secretAccessKey : s3_config.secret
});
s3fsImpl.create();

Any thought or hint why I'm getting the error?

Upvotes: 0

Views: 311

Answers (1)

Mark B
Mark B

Reputation: 200446

From the documentation:

s3fs.create(options[, callback])

Creates a new bucket on S3.

You appear to be calling the method to create a new S3 bucket. Does the bucket already exist?

Upvotes: 1

Related Questions