mock-aws-s3 icon indicating copy to clipboard operation
mock-aws-s3 copied to clipboard

no such file or directory, scandir...

Open Kostanos opened this issue 6 years ago • 4 comments

I get the error if I want to getList of empty bucket:

s3 = AWSMock.S3({Bucket: 'my-bucket'});
s3.listObjects({Bucket: 'my-bucket', Prefix: 'new-one/'}, (data)=>{
        console.log(data);
      });

Error: ENOENT: no such file or directory, scandir '/tmp/buckets//my-bucket'

Kostanos avatar May 24 '18 21:05 Kostanos

Hi,

Maybe to late but your error is double slash between "/tmp/buckets/" and "my-bucket" When you remove one slash, it should access to /tmp/bucket/ folder on your computer :)

mathieuedet avatar Apr 03 '20 07:04 mathieuedet

Maybe related, I get a similiar error when listing with a prefix that does not exist on disk

ENOENT: no such file or directory, scandir '/tmp/buckets/XHKKDXE82PH8KP/test'

/tmp/buckets/XHKKDXE82PH8KP exists, but test doesnt

thejuan avatar May 08 '20 00:05 thejuan

I may have been removing the buckets dir, i make sure its there in setup now

thejuan avatar May 08 '20 01:05 thejuan

This is because your bucket doesn't exist. You have to upload at least one file or call createBucket() before you can run listObjects()

zxlin avatar Jan 22 '21 16:01 zxlin