Failed to create bucket (reason: S3ResponseError: S3ResponseError: 404 Not Found
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Duplicity |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Failed to create bucket (attempt #1) 'lin-v4clogfram
The reason appears to be that a change in Boto broke the missing bucket check. That check is in BotoBackend.put from duplicity/
def put(self, source_path, remote_
...
Note that this relies on a string match against the exception message to decide whether the bucket exists or not.
Now Boto (at least python-
def get_bucket(self, bucket_name, validate=True, headers=None):
"""
Retrieves a bucket by name.
If the bucket does not exist, an ``S3ResponseError`` will be raised. If
you are unsure if the bucket exists or not, you can use the
or ``None``.
...
If the default ``validate=True`` is passed, a request is made to the
service to ensure the bucket exists. Prior to Boto v2.25.0, this fetched
a list of keys (but with a max limit set to ``0``, always returning an empty
list) in the bucket (& included better error messages), at an
increased expense. As of Boto v2.25.0, this now performs a HEAD request
(less expensive but worse error messages).
If you were relying on parsing the error message before, you should call
something like::
bucket = conn.get_
...
if validate:
return self.head_
else:
return self.bucket_
So as they say, we need to stop parsing the exception message and either do a lookup() first, or catch S3ResponseError, or set validate=False and see whether get_all_keys() throws an exception.
Changed in duplicity: | |
status: | New → In Progress |
importance: | Undecided → Medium |
assignee: | nobody → Kenneth Loafman (kenneth-loafman) |
Changed in duplicity: | |
status: | In Progress → Fix Committed |
Changed in duplicity: | |
assignee: | Kenneth Loafman (kenneth-loafman) → nobody |
Changed in duplicity: | |
status: | Fix Committed → Fix Released |
Unfortunately, the proposed fix gave rise to #1568677