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

安稳与你 提交于 2019-12-20 01:01:45

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!