Page MenuHomeSoftware Heritage

mimetype indexer: fails with TypeError: 'NoneType' object is not subscriptable
Closed, MigratedEdits Locked

Description

 	[2019-01-08 03:26:21,174: ERROR/ForkPoolWorker-7] Problem when computing metadata.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/swh/indexer/indexer.py", line 501, in run
    n=self.config['write_batch_size']):
  File "/usr/lib/python3/dist-packages/swh/core/utils.py", line 41, in grouper
    for _data in itertools.zip_longest(*args, fillvalue=None):
  File "/usr/lib/python3/dist-packages/swh/indexer/indexer.py", line 468, in _index_with_skipping_already_done
    start, _end, contents)
  File "/usr/lib/python3/dist-packages/swh/indexer/indexer.py", line 444, in _index_contents
    if not isinstance(res['id'], bytes):
TypeError: 'NoneType' object is not subscriptable

Introduced in D788.
This check should be done only if res is not None (which can be ;).

Event Timeline

ardumont triaged this task as Normal priority.Jan 8 2019, 12:03 PM
ardumont created this task.
zack renamed this task from mimetype indexer: fix new error to mimetype indexer: fails with TypeError: 'NoneType' object is not subscriptable.Jan 8 2019, 12:07 PM

Forget about it, it's directly caused by T861

hmm wait nvm, it should still be fixed