InvalidCredsError with upload_object_via_stream() on Aurora Objects

Đang mở
#1,657 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
cloud

Hướng nghiên cứu

Bắt đầu trong libcloud/storage/drivers/s3.py tại upload_object_via_stream(), _put_object_multipart() và _initiate_multipart(), đồng thời so sánh luồng này với luồng upload_object() đang hoạt động. Tái hiện ví dụ Aurora Objects và lần theo request khởi tạo multipart; công việc được xem là hoàn tất khi các lượt upload bằng streaming thành công mà không có SignatureDoesNotMatch hoặc InvalidCredsError.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Summary

When trying to upload a file to Aurora Objects through upload_object_via_stream(), I get an InvalidCredsError.

Detailed Information

When I try the following code:

from libcloud.storage.types import Provider
from libcloud.storage.providers import get_driver

cls = get_driver(Provider.AURORAOBJECTS)
driver = cls('api-key', 'secret-key')

container = driver.get_container('container')

container.upload_object_via_stream(iter([b'test']), 'test.txt')

It results in the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/wout/project/.venv/lib/python3.9/site-packages/libcloud/storage/base.py", line 216, in upload_object_via_stream
    return self.driver.upload_object_via_stream(
  File "/home/wout/project/.venv/lib/python3.9/site-packages/libcloud/storage/drivers/s3.py", line 747, in upload_object_via_stream
    return self._put_object_multipart(container=container,
  File "/home/wout/project/.venv/lib/python3.9/site-packages/libcloud/storage/drivers/s3.py", line 988, in _put_object_multipart
    upload_id = self._initiate_multipart(container, object_name,
  File "/home/wout/project/.venv/lib/python3.9/site-packages/libcloud/storage/drivers/s3.py", line 572, in _initiate_multipart
    response = self.connection.request(request_path, method='POST',
  File "/home/wout/project/.venv/lib/python3.9/site-packages/libcloud/common/base.py", line 667, in request
    response = responseCls(**kwargs)
  File "/home/wout/project/.venv/lib/python3.9/site-packages/libcloud/common/base.py", line 167, in __init__
    message=self.parse_error(),
  File "/home/wout/project/.venv/lib/python3.9/site-packages/libcloud/storage/drivers/s3.py", line 138, in parse_error
    raise InvalidCredsError(self.body)
libcloud.common.types.InvalidCredsError: '<?xml version="1.0" encoding="UTF-8"?><Error><Code>SignatureDoesNotMatch</Code><RequestId>tx00000000000004e0ebfe5-00620a68e9-1d4a885a-ams02</RequestId><HostId>1d4a885a-ams02-eu</HostId></Error>'

However upload_object() is working fine as follows:

from libcloud.storage.types import Provider
from libcloud.storage.providers import get_driver

cls = get_driver(Provider.AURORAOBJECTS)
driver = cls('api-key', 'secret-key')

container = driver.get_container('container')

container.upload_object('test.txt', 'test.txt')

I am using Python 3.9.8-1 on Debian unstable with Libcloud 3.4.1.

Ngôn ngữ chính
Python
Star
2.1k
Fork
935
Merge trung bình
5 ngày 3 giờ
Pull request đã merge (30 ngày)
15

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của apache/libcloud

Tất cả issue của apache/libcloud

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.