Đây là mã của tôi để thử tải lên tài liệu để tìm kiếm đám mâyFail tải tài liệu lên AWS cloudsearch sử dụng boto.cloudsearch2
from boto.cloudsearch2.layer2 import Layer2
conn_config = {
'region': 'us-east-1',
'aws_access_key_id': os.getenv('AWS_ACCESS'),
'aws_secret_access_key': os.getenv('AWS_SECRET'),
'debug': 2
}
conn = Layer2(**conn_config)
domain = conn.lookup(my_domain)
doc_service = domain.get_document_service()
doc_service.add(my_id, my_fields)
doc_service.commit()
Đây là lỗi tôi nhận:
Traceback (most recent call last):
line 32, in <module> doc.commit()
File "/Library/Python/2.7/site-packages/boto/cloudsearch2/document.py", line 205, in commit return CommitResponse(r, self, sdf)
File "/Library/Python/2.7/site-packages/boto/cloudsearch2/document.py", line 250, in __init__
self.adds = self.content['adds']
KeyError: 'adds'
đó là tôi tin rằng là một lỗi gây hiểu lầm. Khi tôi thêm dòng này vào init() của /Library/Python/2.7/site-packages/boto/cloudsearch2/document.py
print self.content
vấn đề thực sự dường như xuất hiện như:
{u'status': u'error', u'message': u'User: anonymous is not authorized to perform: cloudsearch:document on resource: arn:aws:cloudsearch:us-east-1:053216739513:domain/dev-audit', u'errors': [{u'message': u'[*Deprecated*: Use the outer message field] User: anonymous is not authorized to perform: cloudsearch:document on resource: arn:aws:cloudsearch: ...'}], u'__type': u'#AccessDenied'}
Bất kỳ thông tin chi tiết nào về cách khắc phục lỗi cấp quyền gây phiền nhiễu này? Tôi có thể tìm kiếm với id truy cập đã cho và khóa bí mật nhưng không tải lên được !!!
Bất kỳ may mắn này? Tôi đang gặp vấn đề tương tự. – apardes
@cocoa, nếu câu trả lời dưới đây giải quyết được vấn đề của bạn, vui lòng chấp nhận nó. Nếu không, chỉ ra cách nó không giải quyết được. – tedder42