Activity log for bug #1929083

Date Who What changed Old value New value Message
2021-05-20 14:34:41 Walter bug added bug
2021-05-20 14:34:41 Walter attachment added tempurl-put-upload-throws-dict_items.patch https://bugs.launchpad.net/bugs/1929083/+attachment/5499015/+files/tempurl-put-upload-throws-dict_items.patch
2021-05-20 14:35:09 Walter description A customer of ours was attempting to PUT files in a tempurl, which is supposed to be legl legal according to "/info". However, the PUT failed with this backtrace: Traceback (most recent call last): File "eventlet/wsgi.py", line 573, in handle_one_response result = self.application(self.environ, start_response) File "swift/common/middleware/catch_errors.py", line 145, in __call__ return context.handle_request(env, start_response) File "swift/common/middleware/catch_errors.py", line 120, in handle_request self._response_headers.append(('X-Trans-Id', trans_id)) AttributeError: 'dict_items' object has no attribute 'append' The immediate cause is this: - Append is attempted on something that is not a list self._response_headers = somedict.items() ... self._response_headers.append(('X-Trans-Id', trans_id)) That is not legal in python3 (it was in python2). I checked for .items() candidates, and there are few. At least: swift/common/middleware/symlink.py: self._response_headers = response_header_dict.items() swift/common/middleware/tempurl.py: return headers.items() And the latter makes the most sense, as the user was using the tempurl functionality. And indeed, this patch fixes things: ``` --- swift/common/middleware/tempurl.py +++ swift/common/middleware/tempurl.py @@ -839,7 +839,7 @@ class TempURL(object): if h.startswith(p): del headers[h] break - return headers.items() + return list(headers.items()) def filter_factory(global_conf, **local_conf): ``` Versions: - swift 2.25.1, but according to git, nothing was changed between 2.25.1 and master - python3.8, but that's irrelevant Cheers, Walter Doekes OSSO B.V. A customer of ours was attempting to PUT files in a tempurl, which is supposed to be legal legal according to "/info". However, the PUT failed with this backtrace:   Traceback (most recent call last):     File "eventlet/wsgi.py", line 573, in handle_one_response       result = self.application(self.environ, start_response)     File "swift/common/middleware/catch_errors.py", line 145, in __call__       return context.handle_request(env, start_response)     File "swift/common/middleware/catch_errors.py", line 120, in handle_request       self._response_headers.append(('X-Trans-Id', trans_id))   AttributeError: 'dict_items' object has no attribute 'append' The immediate cause is this: - Append is attempted on something that is not a list   self._response_headers = somedict.items()   ...   self._response_headers.append(('X-Trans-Id', trans_id)) That is not legal in python3 (it was in python2). I checked for .items() candidates, and there are few. At least:   swift/common/middleware/symlink.py:     self._response_headers = response_header_dict.items()   swift/common/middleware/tempurl.py:     return headers.items() And the latter makes the most sense, as the user was using the tempurl functionality. And indeed, this patch fixes things: ``` --- swift/common/middleware/tempurl.py +++ swift/common/middleware/tempurl.py @@ -839,7 +839,7 @@ class TempURL(object):                      if h.startswith(p):                          del headers[h]                          break - return headers.items() + return list(headers.items())  def filter_factory(global_conf, **local_conf): ``` Versions: - swift 2.25.1, but according to git, nothing was changed between 2.25.1 and master - python3.8, but that's irrelevant Cheers, Walter Doekes OSSO B.V.
2021-05-20 14:36:36 Walter description A customer of ours was attempting to PUT files in a tempurl, which is supposed to be legal legal according to "/info". However, the PUT failed with this backtrace:   Traceback (most recent call last):     File "eventlet/wsgi.py", line 573, in handle_one_response       result = self.application(self.environ, start_response)     File "swift/common/middleware/catch_errors.py", line 145, in __call__       return context.handle_request(env, start_response)     File "swift/common/middleware/catch_errors.py", line 120, in handle_request       self._response_headers.append(('X-Trans-Id', trans_id))   AttributeError: 'dict_items' object has no attribute 'append' The immediate cause is this: - Append is attempted on something that is not a list   self._response_headers = somedict.items()   ...   self._response_headers.append(('X-Trans-Id', trans_id)) That is not legal in python3 (it was in python2). I checked for .items() candidates, and there are few. At least:   swift/common/middleware/symlink.py:     self._response_headers = response_header_dict.items()   swift/common/middleware/tempurl.py:     return headers.items() And the latter makes the most sense, as the user was using the tempurl functionality. And indeed, this patch fixes things: ``` --- swift/common/middleware/tempurl.py +++ swift/common/middleware/tempurl.py @@ -839,7 +839,7 @@ class TempURL(object):                      if h.startswith(p):                          del headers[h]                          break - return headers.items() + return list(headers.items())  def filter_factory(global_conf, **local_conf): ``` Versions: - swift 2.25.1, but according to git, nothing was changed between 2.25.1 and master - python3.8, but that's irrelevant Cheers, Walter Doekes OSSO B.V. A customer of ours was attempting to PUT files in a tempurl, which is supposed to be legal according to "/info". However, the PUT failed with this backtrace:   Traceback (most recent call last):     File "eventlet/wsgi.py", line 573, in handle_one_response       result = self.application(self.environ, start_response)     File "swift/common/middleware/catch_errors.py", line 145, in __call__       return context.handle_request(env, start_response)     File "swift/common/middleware/catch_errors.py", line 120, in handle_request       self._response_headers.append(('X-Trans-Id', trans_id))   AttributeError: 'dict_items' object has no attribute 'append' The immediate cause is this: - Append is attempted on something that is not a list   self._response_headers = somedict.items()   ...   self._response_headers.append(('X-Trans-Id', trans_id)) That is not legal in python3 (it was in python2). I checked for .items() candidates, and there are few. At least:   swift/common/middleware/symlink.py:     self._response_headers = response_header_dict.items()   swift/common/middleware/tempurl.py:     return headers.items() And the latter makes the most sense, as the user was using the tempurl functionality. And indeed, this patch fixes things: ``` --- swift/common/middleware/tempurl.py +++ swift/common/middleware/tempurl.py @@ -839,7 +839,7 @@ class TempURL(object):                      if h.startswith(p):                          del headers[h]                          break - return headers.items() + return list(headers.items())  def filter_factory(global_conf, **local_conf): ``` Versions: - swift 2.25.1, but according to git, nothing was changed between 2.25.1 and master - python3.8, but that's irrelevant Cheers, Walter Doekes OSSO B.V.
2021-05-20 15:11:35 OpenStack Infra swift: status New In Progress
2021-05-20 23:32:24 OpenStack Infra swift: status In Progress Fix Released
2021-05-23 18:53:59 OpenStack Infra tags in-stable-wallaby
2021-05-26 04:38:16 OpenStack Infra tags in-stable-wallaby in-stable-victoria in-stable-wallaby
2021-05-26 21:30:54 OpenStack Infra tags in-stable-victoria in-stable-wallaby in-stable-ussuri in-stable-victoria in-stable-wallaby
2021-05-27 04:49:38 OpenStack Infra tags in-stable-ussuri in-stable-victoria in-stable-wallaby in-stable-train in-stable-ussuri in-stable-victoria in-stable-wallaby