我正在以编程方式创建和设置带有boto的s3存储桶。
我可以创建存储桶,对象..并在对象上写...
我想为存储桶配置生命周期,但是当我运行下面的代码时,出现此异常:
boto.exception.S3ResponseError:S3ResponseError:403禁止使用代码SignatureDoesNotMatch。
lifecycle = Lifecycle()
lifecycle.add_rule(
'rulename',
prefix='/',
status='Enabled',
expiration=Expiration(days=1)
)
bucket = s3.get_bucket('mybucket')
此调试结果可以帮助回答。
回复:'HTTP / 1.1 403 Forbidden \ r \ n'
标题:x-amz-request-id:tx000000000000000000027-0059db8d59-39289-默认
标题:内容长度:196
标题:接受范围:字节
标题:内容类型:application / xml
标题:日期:2017年10月9日星期一14:53:13 GMT
追踪(最近通话):
文件“ pyth.py”,第28行,在
bucket.configure_lifecycle(lifecycle)
文件“ /usr/lib/python2.7/site-packages/boto/s3/bucket.py”,第1366行,位于
configure_lifecycle
response.status, response.reason, body)
boto.exception.S3ResponseError:S3ResponseError:403禁止
SignatureDoesNotMatch
tx000000000000000000027-0059db8d59-39289-默认
39289-默认-默认
bucket.configure_lifecycle(lifecycle)
经过一些研究,我可以说这个错误是由不支持生命周期策略的实际ceph版本(10.2.7 Jowel)引起的>>
$ ceph --version
ceph版本10.2.7-27.el7cp(e0d2d4f2fac9d95a26486121257255260bbec8d5)