s3api logging causes 500 when setting ACLs with empty ID

Bug #1999564 reported by Tim Burke
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
In Progress
Undecided
Unassigned

Bug Description

Seen when testing locally:

Dec 13 17:13:05 saio proxy-server: __str__ returned non-string (type NoneType):
Traceback (most recent call last):
  File "/vagrant/swift/swift/common/middleware/s3api/s3api.py", line 345, in __call__
    resp = self.handle_request(req)
  File "/vagrant/swift/swift/common/middleware/s3api/s3api.py", line 383, in handle_request
    res = handler(req)
  File "/vagrant/swift/swift/common/middleware/s3api/controllers/s3_acl.py", line 65, in PUT
    req.get_response(self.app, 'POST')
  File "/vagrant/swift/swift/common/middleware/s3api/s3request.py", line 1615, in get_response
    resp = self.acl_handler.handle_acl(
  File "/vagrant/swift/swift/common/middleware/s3api/acl_handlers.py", line 94, in handle_acl
    return getattr(ah, method)(app)
  File "/vagrant/swift/swift/common/middleware/s3api/acl_handlers.py", line 291, in POST
    'Grant %s %s permission on the bucket /%s' %
TypeError: __str__ returned non-string (type NoneType)

Trouble comes down to how Users get str()ed: https://github.com/openstack/swift/blob/2.30.0/swift/common/middleware/s3api/subresource.py#L221-L222

The display_name passed to the constructor (apparently) may be None, causing __str__ to return None, causing the TypeError.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/swift/+/869401

Changed in swift:
status: New → In Progress
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.