Page MenuHomePhabricator

CCC: corrupt.py KeyError, image unidentified
Closed, ResolvedPublic

Description

Cannot retrieve full log output

File "/usr/local/lib/python3.8/site-packages/Pillow-7.1.0.dev0-py3.8-linux-x86_64.egg/PIL/Image.py", line 2871, in open
    raise UnidentifiedImageError(
PIL.UnidentifiedImageError: cannot identify image file '/tmp/tmpfjkmad_b/e24f8526-4bae-11ea-b84d-fa163eed7d19'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "corrupt.py", line 132, in process_file2
    store_image(image_page.title(), False, img_hash=img_hash, not_image=True)  # store in database
  File "/home/ccc/Commons-image-corruption-detector/database_stuff.py", line 77, in store_image
    'page_id': int(page_id),
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

Revisions and Commits

Event Timeline

TheSandDoctor created this task.
TheSandDoctor added a commit: Restricted Diffusion Commit.Feb 9 2020, 6:49 PM

Resolved by making the pageID -1 (no actual IDs are or can be -1) in the event that it cannot be found. At that point, it can manually be fixed as the number of incidents is fairly low overall.

TheSandDoctor changed the visibility from "All Users" to "Public (No Login Required)".Feb 11 2020, 9:01 AM
TheSandDoctor moved this task from Backlog to Done on the Commons-Corruption-Checker board.