Page MenuHomePhabricator

Incorrect counters on [[Special:LintErrors]]
Closed, ResolvedPublicBUG REPORT

Description

I know the number of errors on this page is an estimate, but I have realized that an error count of less than 500 is generally accurate.

Exactly, except for errors on deleted pages. These errors persist for a long time after the pages containing them have been removed. When I restore several pages, cleared and deleted again, the number dropped.

Now on pl.wiki (https://pl.wikipedia.org/wiki/Specjalna:B%C5%82%C4%99dy_sk%C5%82adzien) some errors of this type are probably counted in:

  • Wielolinijkowa tabela w elemencie listy (1 błąd) - multiline-html-table-in-list
  • Stare zachowanie znaczników font zawierających linki (14 błędów) - tidy-font-bug
  • Nieprawidłowe opcje pliku (3 błędy) - bogus-image-options
  • Linki w linkach (1 błąd) - wikilink-in-extlink
  • Źle zagnieżdżone znaczniki (149 błędów) - misnested-tag - I think that about 30-40 errors of 149 "are" on deleted pages

Event Timeline

@Malarz_pl: Thanks for reporting this. Please use the bug report form (linked from the top of the task creation page) to create a bug report, and fill in the sections in the template instead of deleting them, so your bug report is structured and easier to understand.

Aklapper changed the task status from Open to Stalled.Apr 29 2024, 11:39 AM

Numbers are updated by running initSiteStats.php. initSiteStats.php is run at 05:39 UTC on 1st and 15th of each month.

Setting status to stalled as it's unclear which numbers are expected on which exact page (full URL) at which exact time.

On page: https://pl.wikipedia.org/wiki/Specjalna:B%C5%82%C4%99dy_sk%C5%82adniowe

are listed errors:

  • Nadmiarowe znaczniki tabeli do usunięcia (0 błędów)
  • Błędnie zagnieżdżony znacznik z różnym renderowaniem w HTML5 i HTML4 (0 błędów)
  • Inne problemy (0 błędów)
  • Wielolinijkowa tabela w elemencie listy (1 błąd)
  • Wiele niezamkniętych tagów formatujących (0 błędów)
  • Obejście błędnego generowania akapitów (0 błędów)
  • Samozamykające się znaczniki (0 błędów)
  • Stare zachowanie znaczników font zawierających linki (14 błędów)
  • Błąd parsowania spacji (0 błędów)
  • Niezamknięty apostrof w nagłówku (0 błędów)

Średni priorytet

  • Nieprawidłowe opcje pliku (3 błędy)
  • Osierocona zawartość (0 błędów)
  • Źle zagnieżdżone znaczniki (120 błędów)
  • Wiele dwukropków poprzedzających (0 błędów)
  • Linki w linkach (1 błąd)

...

Some of them have continusly more then 0 error, but in fact there are no errors:

One of them indicate all the time 30-40 more errors then is in real:

This is probably related to errors on deleted pages.

This is probably related to errors on deleted pages.

As far as I know numbers are updated twice a month. Would be great to check again in three days if still such a problem

Numbers are esimated all the time.

The small numbers (<500?, <1000?) are esimated precisely and in most cases are uptaded a few second after article edit and IT WORKS. Propably without updating number of errors left in deleted article.

You can see it (dropping numer) in line with "Źle zagnieżdżone znaczniki". We propably clean them all in two days. Number is still bigger by 40-45 then real number of errors.

Maybe twice a month is updated basis for estimates.

Deleting a page should clear its entries from the linter table,
https://github.com/wikimedia/mediawiki-extensions-Linter/blob/master/includes/Hooks.php#L112-L129

Below a certain threshold, counts should be accurate,
https://github.com/wikimedia/mediawiki-extensions-Linter/blob/master/includes/Database.php#L308-L345

However, there have been times when the service has been interrupted and lints for a deleted page get orphaned.

The task T165538 exists to purge stale data that occurs in the linter table for a variety of reasons.

Deleting a page should clear its entries from the linter table,
https://github.com/wikimedia/mediawiki-extensions-Linter/blob/master/includes/Hooks.php#L112-L129
...
However, there have been times when the service has been interrupted and lints for a deleted page get orphaned.

From my observations, it doesn't work at all. The only solution that works is to restore the page, clear it and delete it again.

The task T165538 exists to purge stale data that occurs in the linter table for a variety of reasons.

We'll wait until the orphans are cleaned up.

From my observations, it doesn't work at all. The only solution that works is to restore the page, clear it and delete it again.

I tested on a local wiki and the code seems to work, the lints were cleaned up after deleting the page. Can you provide an example of a page recently deleted that left around lint errors?

This is probably related to errors on deleted pages.

As far as I know numbers are updated twice a month. Would be great to check again in three days if still such a problem

It's been over 24 hours since "05:39 UTC on 1st" and the numbers are still wrong.

Aklapper changed the task status from Stalled to Open.May 4 2024, 9:10 AM

I tested on a local wiki and the code seems to work, the lints were cleaned up after deleting the page.

My testing was insufficient, likely invoking the callback synchronously. I had previously fixed this problem in I2610b9b16d4032b0e18b3537cc9ed51bfdaff299 but a recent refactoring in Ib3d3622144b670ebe1a4ce04e6db6811584d42c8 broke it again.

Change #1027114 had a related patch set uploaded (by Arlolra; author: Arlolra):

[mediawiki/extensions/Linter@master] Fix regression clearing lints on page deletion

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

Change #1027114 merged by jenkins-bot:

[mediawiki/extensions/Linter@master] Fix regression clearing lints on page deletion

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

@ABreault-WMF thanks. It works for new deletion. I tested on https://pl.wikipedia.org/w/index.php?title=Wikipedysta:Malarz_pl/brudnopis/modu%C5%82&action=edit&redlink=1.

Will the old ones be corrected when refreshed on the May 15th as wrote @Aklapper (on April 29th)?

There are still virtual errors in 6 categories on the https://pl.wikipedia.org/wiki/Specjalna:B%C5%82%C4%99dy_sk%C5%82adzien

Patch was installed on pl.wiki on May 9th. The error numbers supposedly refresh on the 1st and 15th of the month, so this happened over 3 days ago. However, the incorrect number of errors is still displayed.

Will the old ones be corrected when refreshed on the May 15th as wrote @Aklapper (on April 29th)?

I'm not sure where the idea that these numbers are updated twice a month comes from?

There is a totals cache that looks like it's busted every 1000th call to update stats,
https://github.com/wikimedia/mediawiki-extensions-Linter/blob/master/includes/TotalsLookup.php#L135
https://gerrit.wikimedia.org/g/operations/mediawiki-config/+/3d5baa56e738159b847dba2395337ff39b82be78/wmf-config/InitialiseSettings.php#5813

After which, counts should be accurate below 20,
https://github.com/wikimedia/mediawiki-extensions-Linter/blob/master/includes/Database.php#L46

At this point, we will need T165538 to clear stale data from deleted pages which won't get updated.

At this point, we will need T165538 to clear stale data from deleted pages which won't get updated.

T165538 seems dead. It's 7 years old. It doesn't look like anyone is taking care of it.

Same as T363682 is not resolved. The ghost errors are still there. The only advantage is that no more are added, but the reported problem remains.

ABreault-WMF added a subscriber: Ladsgroup.

Same as T363682 is not resolved. The ghost errors are still there. The only advantage is that no more are added, but the reported problem remains.

Sorry, I closed the task because I saw it as two steps, fix the regression, which was done, and cleanup stale data, which is covered by T165538.

But you're right that in T298782 we'd previously purged the database.

I'm seeing 733 stale lints on plwiki with select count(*) from linter left join page on linter_page = page_id where page_namespace is null;
https://quarry.wmcloud.org/query/83395

@Ladsgroup Do you still have the script from T298782#7616224 and could I trouble you to run in again?

Sure. Only Polish Wikipedia or all wikis?

Thanks. Ghost errors are gone,

@Ladsgroup Thank you for taking the time. Consider pasting your script in T165538 as a basis for any work that happens there.

Yeah but I'm still deleting. It's because in commons, there are so many lint errors, any query to get a batch is taking ten minutes

Yeah but I'm still deleting. It's because in commons, there are so many lint errors, any query to get a batch is taking ten minutes

Otherwise, it has been cleaned up in every other wiki. If we can reduce the size of linter table in commons by fixing some large scale one, that'd be nice.

mysql:research@s4-analytics-replica.eqiad.wmnet [commonswiki]> select linter_template, linter_cat, linter_tag, count(*) from linter where linter_template != '' group by linter_template, linter_cat, linter_tag order by count(*) desc limit 50;
+-------------------------------------------------+------------+------------+----------+
| linter_template                                 | linter_cat | linter_tag | count(*) |
+-------------------------------------------------+------------+------------+----------+
| Template:Self                                   |         22 |            | 34603310 |
| Template:Information                            |         22 |            |  7984037 |
| Template:FlickreviewR                           |         22 |            |  7934724 |
| Template:Artwork                                |         22 |            |  7278730 |
| Template:Wikidata_Infobox                       |         22 |            |  5013646 |
| Template:Book                                   |         22 |            |  4721483 |
| Template:PD-USGov-NASA                          |         22 |            |  4495796 |
| Template:Geograph_from_structured_data          |         22 |            |  4455119 |
| Template:NASA-image                             |         22 |            |  4225663 |
| User:FlickreviewR/reviewed-pass                 |         22 |            |  3896914 |
| Template:PD-scan                                |         22 |            |  2019547 |
| Template:Autotranslate                          |         22 |            |  2017226 |
| Template:Photograph                             |         22 |            |  1985664 |
| Template:Geograph                               |         22 |            |  1862437 |
| Template:Check_categories                       |         22 |            |  1437730 |
| Template:Cc-zero                                |         22 |            |  1365720 |
| Template:PD-Art                                 |         22 |            |  1354494 |
| Template:PD-self                                |         22 |            |  1324879 |
| multi-part-template-block                       |         22 |            |  1321130 |
| Template:Flickrreview                           |         22 |            |  1202721 |
| Template:Supported_by_Wikimedia_Deutschland     |         22 |            |  1026539 |
| Template:National_Library_in_Warsaw_partnership |         22 |            |  1012302 |
| Template:PD-US-expired                          |         22 |            |   982857 |
| Template:PD-old                                 |         22 |            |   904179 |
| Template:Flickr-no_known_copyright_restrictions |         22 |            |   730325 |
| Template:Uncategorized                          |         22 |            |   637689 |
| Template:PD-old-70-1923                         |         22 |            |   523858 |
| Template:CC-zero                                |         22 |            |   499691 |
| Template:RCE-license                            |         22 |            |   486229 |
| Template:RCE-higher-resolution                  |         22 |            |   455573 |
| Template:NARA-cooperation                       |         22 |            |   455205 |
| Template:NARA-image-full                        |         22 |            |   454740 |
| User:DerHexer/licence2                          |         22 |            |   434875 |
| Template:Uploaded_from_Mobile                   |         22 |            |   429779 |
| Template:Personality_rights                     |         22 |            |   408596 |
| Template:PD-USGov                               |         22 |            |   407714 |
| Template:GFDL                                   |         22 |            |   406256 |
| Template:PD-old-100                             |         22 |            |   403896 |
| Template:Nationaal_Archief                      |         22 |            |   398083 |
| Template:Information                            |          4 | i          |   393443 |
| Template:OFL                                    |         22 |            |   356837 |
| Template:Wiki_Loves_Monuments_2013              |         22 |            |   355162 |
| Template:PD-US-no_notice                        |         22 |            |   348867 |
| Template:QualityImage                           |         22 |            |   344390 |
| Template:OGL3                                   |         22 |            |   335242 |
| Template:Wiki_Loves_Monuments_2012              |         22 |            |   333319 |
| Template:Milim                                  |         22 |            |   311394 |
| Template:Wiki_Loves_Monuments_2014              |         22 |            |   307422 |
| Template:Check_categories-Geograph              |         22 |            |   300638 |
| Template:PD-US                                  |         22 |            |   286134 |
+-------------------------------------------------+------------+------------+----------+
50 rows in set (23 min 52.857 sec)

The changes are going to take at least a week to propagate:

mysql:research@s4-analytics-replica.eqiad.wmnet [commonswiki]> select linter_template, linter_cat, linter_tag, count(*) from linter where linter_template != '' group by linter_template, linter_cat, linter_tag order by count(*) desc limit 50;
+-------------------------------------------------+------------+------------+----------+
| linter_template                                 | linter_cat | linter_tag | count(*) |
+-------------------------------------------------+------------+------------+----------+
| Template:Self                                   |         22 |            | 34194289 |
| Template:FlickreviewR                           |         22 |            |  7940020 |
| Template:Information                            |         22 |            |  7906539 |
| Template:Artwork                                |         22 |            |  7278740 |
| Template:Wikidata_Infobox                       |         22 |            |  5014794 |
| Template:Book                                   |         22 |            |  4722355 |
| Template:Geograph_from_structured_data          |         22 |            |  4455119 |
| Template:PD-USGov-NASA                          |         22 |            |  4425265 |
| Template:NASA-image                             |         22 |            |  4225666 |
| User:FlickreviewR/reviewed-pass                 |         22 |            |  3896911 |
| Template:PD-scan                                |         22 |            |  2019676 |

After ten days the numbers are better but not much:

mysql:research@s4-analytics-replica.eqiad.wmnet [commonswiki]> select linter_template, linter_cat, linter_tag, count(*) from linter where linter_template != '' group by linter_template, linter_cat, linter_tag order by count(*) desc limit 50;
+-------------------------------------------------+------------+------------+----------+
| linter_template                                 | linter_cat | linter_tag | count(*) |
+-------------------------------------------------+------------+------------+----------+
| Template:Self                                   |         22 |            | 28305118 |
| Template:FlickreviewR                           |         22 |            |  7972413 |
| Template:Artwork                                |         22 |            |  7277358 |
| Template:Information                            |         22 |            |  7072181 |
| Template:Wikidata_Infobox                       |         22 |            |  5027304 |
| Template:Book                                   |         22 |            |  4724893 |
| Template:Geograph_from_structured_data          |         22 |            |  4465691 |
| Template:NASA-image                             |         22 |            |  4225693 |
| User:FlickreviewR/reviewed-pass                 |         22 |            |  3896881 |
| Template:Artwork                                |         23 |            |  3386630 |
| Template:PD-USGov-NASA                          |         22 |            |  3051415 |
| Template:Autotranslate                          |         22 |            |  2020877 |
| Template:PD-scan                                |         22 |            |  2020711 |
| Template:Information                            |         23 |            |  2009704 |

We need to wait for a while until we can actually run the script on commons.

Much better:

+-------------------------------------------------+------------+------------+----------+
| linter_template                                 | linter_cat | linter_tag | count(*) |
+-------------------------------------------------+------------+------------+----------+
| Template:Self                                   |         22 |            | 13969317 |
| Template:Information                            |         23 |            |  7926719 |
| Template:Artwork                                |         22 |            |  7273742 |
| Template:Welcome                                |         23 |            |  6723401 |
| Template:Information                            |         22 |            |  6136551 |
| Template:Artwork                                |         23 |            |  5845934 |
| Template:FlickreviewR                           |         23 |            |  5356323 |
| Template:Wikidata_Infobox                       |         22 |            |  5044754 |
| Template:Book                                   |         22 |            |  4731527 |
| Template:Geograph_from_structured_data          |         22 |            |  4476655 |
| Template:NASA-image                             |         22 |            |  4225716 |
| User:FlickreviewR/reviewed-pass                 |         23 |            |  3896330 |
| Template:FlickreviewR                           |         22 |            |  2787045 |
| Template:Book                                   |         23 |            |  2506893 |
| Template:Wikidata_Infobox                       |         23 |            |  2480577 |
| Template:PD-scan                                |         22 |            |  2028593 |
| Template:Autotranslate                          |         22 |            |  2025964 |
| Template:Photograph                             |         22 |            |  1983395 |
| Template:PD-USGov-NASA                          |         23 |            |  1918599 |
| Template:Geograph                               |         22 |            |  1862598 |
| Template:NASA-image                             |         23 |            |  1854221 |
| Template:PD-scan                                |         23 |            |  1675291 |

Thanks for your continued effort here @Ladsgroup. Sorry I sent you down this path.