get_container returns None instead of the expected tuple

Bug #1752277 reported by Mehdi Abaakouk
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-swiftclient
Incomplete
Undecided
Unassigned

Bug Description

Hi,

During https://bugs.launchpad.net/tripleo/+bug/1751056 investigation, we discover that swiftclient get_container method sometimes returns None instead of the expected tuple or exception.

The following code:

        try:
            headers, files = self.swift.get_container(
                container, full_listing=True)
        except swclient.ClientException as e:

raise this exception because None is returned instead of the headers and files.

[Thu Feb 22 12:35:23.833389 2018] [:error] [pid 19] [remote 192.168.24.3:188] yield future.result()
[Thu Feb 22 12:35:23.833406 2018] [:error] [pid 19] [remote 192.168.24.3:188] File "/usr/lib/python2.7/site-packages/concurrent/futures/_base.py", line 422, in result
[Thu Feb 22 12:35:23.833438 2018] [:error] [pid 19] [remote 192.168.24.3:188] return self.__get_result()
[Thu Feb 22 12:35:23.833450 2018] [:error] [pid 19] [remote 192.168.24.3:188] File "/usr/lib/python2.7/site-packages/concurrent/futures/thread.py", line 62, in run
[Thu Feb 22 12:35:23.833820 2018] [:error] [pid 19] [remote 192.168.24.3:188] result = self.fn(*self.args, **self.kwargs)
[Thu Feb 22 12:35:23.833835 2018] [:error] [pid 19] [remote 192.168.24.3:188] File "/usr/lib/python2.7/site-packages/gnocchi/utils.py", line 312, in <lambda>
[Thu Feb 22 12:35:23.833862 2018] [:error] [pid 19] [remote 192.168.24.3:188] return list(executor.map(lambda args: fn(*args), list_of_args))
[Thu Feb 22 12:35:23.833873 2018] [:error] [pid 19] [remote 192.168.24.3:188] File "/usr/lib/python2.7/site-packages/gnocchi/storage/__init__.py", line 252, in _get_measures_timeserie
[Thu Feb 22 12:35:23.833893 2018] [:error] [pid 19] [remote 192.168.24.3:188] metric, aggregation.method, aggregation.granularity)
[Thu Feb 22 12:35:23.833903 2018] [:error] [pid 19] [remote 192.168.24.3:188] File "/usr/lib/python2.7/site-packages/gnocchi/storage/__init__.py", line 185, in _list_split_keys_for_metric
[Thu Feb 22 12:35:23.833921 2018] [:error] [pid 19] [remote 192.168.24.3:188] metric, aggregation, granularity, version)),
[Thu Feb 22 12:35:23.833931 2018] [:error] [pid 19] [remote 192.168.24.3:188] File "/usr/lib/python2.7/site-packages/gnocchi/storage/swift.py", line 167, in _list_split_keys
[Thu Feb 22 12:35:23.834481 2018] [:error] [pid 19] [remote 192.168.24.3:188] container, full_listing=True)
[Thu Feb 22 12:35:23.834555 2018] [:error] [pid 19] [remote 192.168.24.3:188] TypeError: 'NoneType' object is not iterable

Revision history for this message
Christian Schwede (cschwede) wrote :

I checked the python-swiftclient code; it must be an obscure circumstance where that happens. By default exceptions are either raised or a tuple is returned, and I wasn't able to spot a situation where this won't happen.

Can't verify this because we're lacking logs from Swift at that timepoint - so marking as incomplete for now.

Changed in python-swiftclient:
status: New → Incomplete
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.