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?
If the object that you can't copy between buckets is owned by another account, then the object owner can do one of the following: The object owner can grant the bucket owner full control of the object. After the bucket owner owns the object, the bucket policy applies to the object.
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
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 you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With