Page MenuHomePhabricator

ErfgoedBot missing_commonscat_links crashes with NoneType
Closed, ResolvedPublic

Description

Traceback (most recent call last):
  File "/data/project/heritage/pywikibot/pwb.py", line 263, in <module>
    if not main():
  File "/data/project/heritage/pywikibot/pwb.py", line 257, in main
    run_python_file(filename, [filename] + args, argvu, file_package)
  File "/data/project/heritage/pywikibot/pwb.py", line 121, in run_python_file
    main_mod.__dict__)
  File "/data/project/heritage/erfgoedbot/missing_commonscat_links.py", line 259, in <module>
    main()
  File "/data/project/heritage/erfgoedbot/missing_commonscat_links.py", line 253, in main
    makeStatistics(mconfig, totals)
  File "/data/project/heritage/erfgoedbot/missing_commonscat_links.py", line 187, in makeStatistics
    totalCategories += totals.get((countrycode, lang))
TypeError: unsupported operand type(s) for +=: 'int' and 'NoneType'

Event Timeline

Change 379971 had a related patch set uploaded (by Jean-Frédéric; owner: Jean-Frédéric):
[labs/tools/heritage@master] Respect skip config when making stats in missing_commonscat_links

https://gerrit.wikimedia.org/r/379971

JeanFred triaged this task as Medium priority.

This also happened on unused_images:

  File "erfgoedbot/unused_monument_images.py", line 249, in <module>
    main()
  File "erfgoedbot/unused_monument_images.py", line 243, in main
    makeStatistics(mconfig, totals)
  File "erfgoedbot/unused_monument_images.py", line 177, in makeStatistics
    totalImages += totals.get((countrycode, lang))
TypeError: unsupported operand type(s) for +=: 'int' and 'NoneType'

Change 379974 had a related patch set uploaded (by Jean-Frédéric; owner: Jean-Frédéric):
[labs/tools/heritage@master] Guard against empty totals when making statistics

https://gerrit.wikimedia.org/r/379974

Change 379971 merged by jenkins-bot:
[labs/tools/heritage@master] Respect skip config when making stats

https://gerrit.wikimedia.org/r/379971

Mentioned in SAL (#wikimedia-cloud) [2017-09-23T18:25:21Z] <JeanFred> Deploy latest from Git master: 1a7b88c (T176528), 150f545 (T176530)

Change 380060 had a related patch set uploaded (by Lokal Profil; owner: Lokal Profil):
[labs/tools/heritage@master] [WIP]Restructure missing_commonscat_links Statistics

https://gerrit.wikimedia.org/r/380060

Change 379974 abandoned by Jean-Frédéric:
Guard against empty totals when making statistics

Reason:
Superseded

https://gerrit.wikimedia.org/r/379974

Change 447107 had a related patch set uploaded (by Lokal Profil; owner: Lokal Profil):
[labs/tools/heritage@master] Move get_id_from_sort_key to common in preparation for re-use

https://gerrit.wikimedia.org/r/447107

Change 447108 had a related patch set uploaded (by Lokal Profil; owner: Lokal Profil):
[labs/tools/heritage@master] Add first tests for missing_commonscat_links

https://gerrit.wikimedia.org/r/447108

Change 447109 had a related patch set uploaded (by Lokal Profil; owner: Lokal Profil):
[labs/tools/heritage@master] Re-factor statistics bit of unused_monument_images

https://gerrit.wikimedia.org/r/447109

Change 447108 merged by jenkins-bot:
[labs/tools/heritage@master] Add first tests for missing_commonscat_links

https://gerrit.wikimedia.org/r/447108

Change 447109 merged by jenkins-bot:
[labs/tools/heritage@master] Re-factor statistics bit of unused_monument_images

https://gerrit.wikimedia.org/r/447109

Change 380060 merged by jenkins-bot:
[labs/tools/heritage@master] Restructure missing_commonscat_links

https://gerrit.wikimedia.org/r/380060

Check the logs to see if this is still happening.

Also check to ensure c:Commons:Monuments_database/Missing_commonscat_links/Statistics gets updated.

Lokal_Profil claimed this task.