Closed gpaumier closed 9 years ago
'tallies' is undefined
happens because (for some reason) we're trying to print a non-first page using the first-page template.
The problem seems to be caused by an issue around line 165
Debugging output from around those lines while running the script on fa.wikipedia:
…Checking metadata for 50 pages …Checking metadata for 19 pages files_to_print_on_the_first_page (line 166): 251 line 168: skipped files_to_print_on_the_first_page (line 173): 251 files_with_missing_mrd (line 173): 612 Outputting page: 1
After a batch is done, we seem to save the files_with_missing_mrd
for the first page even if it's not a full page (line 183), which doesn't make sense. We should do this only when not another_batch_is_coming
(which we do at line 200). The first occurrence may be the cause of the issue. Currently testing that hypothesis.
So, the good news is that removing that line 183 fixes the crash and outputs the second and first page correctly.
The bad news is that there's a discrepancy between the number of files listed on the pages and the number of files missing MRD from the tallies (a pretty big one).
Although, now that I check a few other examples, the discrepancy seems not to be limited to this instance, so I'm going to open a separate issue for this.
Example stacktrace:
This notably happens (at the moment) when running the script on fa.wikipedia.