Page MenuHomePhabricator

Reportupdater SQL jobs failing with Python error
Closed, ResolvedPublic

Description

Likely caused by my recent changes, although I haven't found an obvious commit, and can't reproduce the error when running manually. This is breaking my job but also seems to affect other reports.

2021-06-01 06:27:56,676 - INFO - Executing "<Report key=users_codemirror_and_wikitext type=sql granularity=day ...
2021-06-01 06:28:12,710 - ERROR - Report "users_codemirror_and_wikitext" could not be written because of error
'NoneType' object has no attribute 'strftime'
Traceback (most recent call last):
  File "/srv/reportupdater/reportupdater/reportupdater/writer.py", line 45, in run
    self.write_results(header, updated_data, report, self.get_output_folder())
  File "/srv/reportupdater/reportupdater/reportupdater/writer.py", line 148, in write_results
    row[0] = row[0].strftime(DATE_FORMAT)
AttributeError: 'NoneType' object has no attribute 'strftime'

Event Timeline

For row[0] to be None, I think there would have to be corrupted data either coming from the query, or in the output file already. The only way I was able to reproduce a matching error was to remove the date header while leaving the rest of the output file intact. Can someone please verify whether the output files seem to contain mangled rows, especially the header row?

odimitrijevic triaged this task as High priority.
odimitrijevic moved this task from Incoming to Smart Tools for Better Data on the Analytics board.
Milimetric claimed this task.
Milimetric added a subscriber: Milimetric.

This just started working sometime in mid June of this year. There was no code change, so I have no idea why, but clearly the way we log these errors doesn't do anybody any favors.