"AllAccessDisabled: All access to this object has been disabled" error being thrown when copying between S3 Buckets

Viewed 21642

I am getting this error:

AllAccessDisabled: All access to this object has been disabled

When performing the s3.copyObject function in my node Lambda function.

Is this error being thrown because of insufficient permissions on the source bucket, or because of insufficient permissions on the target bucket?

2 Answers

This error means you are trying to access a bucket that has been locked down by AWS so that nobody can access it, regardless of permissions -- all access has been disabled.

It can occur because a bill goes unpaid and probably for other reasons as well...

However... usually this means you've made a mistake in your code and are not accessing the bucket that you think you are.

s3.copyObject expects CopySource to be this:

'/' + source_bucket_name + '/' + object_key

If you overlook this and supply something like /uploads/funny/cat.png you're going to get exactly this error, because here, uploads is the bucket name and funny/cat.png is the object key... and the bucket named uploads happens to be a bucket that returns the AllAccessDisabled error... so the real error here is that you are accessing the wrong bucket.

If your bucket name does Not match with bucket name in your code, it will also throw an error 403 forbidden. Make sure you spell correctly

Related