问题
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?
回答1:
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.
来源:https://stackoverflow.com/questions/53329023/allaccessdisabled-all-access-to-this-object-has-been-disabled-error-being-thr