Page MenuHomePhabricator

Blank afl_var_dump on 9 testwiki abuse_filter_log entries from July 2012 causes exceptions
Closed, ResolvedPublic

Description

mysql> select afl_id, afl_timestamp, afl_user_text, afl_action, afl_title, afl_filter from abuse_filter_log where afl_var_dump = '';
+--------+----------------+------------------+------------+-----------+------------+
| afl_id | afl_timestamp  | afl_user_text    | afl_action | afl_title | afl_filter |
+--------+----------------+------------------+------------+-----------+------------+
|   7845 | 20120724110304 | !Silent          | edit       | Teste     | 68         |
|   7847 | 20120724110709 | !Silent          | edit       | Teste2    | 68         |
|   7849 | 20120724110728 | !Silent          | edit       | Teste2    | 68         |
|   7851 | 20120724110745 | !Silent          | edit       | Teste2    | 68         |
|   7853 | 20120724130121 | !Silent          | edit       | Teste     | 68         |
|   7855 | 20120724130306 | !Silent          | edit       | Teste     | 68         |
|   7857 | 20120724144240 | Sandboxer23      | edit       | Sandbox   | 42         |
|   7859 | 20120724164208 | Test123456123456 | edit       | Sauce     | 100        |
|   7860 | 20120724164208 | Test123456123456 | edit       | Sauce     | 105        |
+--------+----------------+------------------+------------+-----------+------------+
9 rows in set (0.20 sec)

When browsing to https://test.wikipedia.org/wiki/Special:AbuseLog/$afl_id you get something like this:

Exception encountered, of type "BadMethodCallException"
[6f0b6271] /wiki/Special:AbuseLog/7845 BadMethodCallException from line 327 of /srv/mediawiki/php-1.26wmf20/extensions/AbuseFilter/special/SpecialAbuseLog.php: Call to a member function dumpAllVars() on a non-object (boolean)
Backtrace:
#0 /srv/mediawiki/php-1.26wmf20/extensions/AbuseFilter/special/SpecialAbuseLog.php(65): SpecialAbuseLog->showDetails(string)
#1 /srv/mediawiki/php-1.26wmf20/includes/specialpage/SpecialPage.php(384): SpecialAbuseLog->execute(string)
#2 /srv/mediawiki/php-1.26wmf20/includes/specialpage/SpecialPageFactory.php(553): SpecialPage->run(string)
#3 /srv/mediawiki/php-1.26wmf20/includes/MediaWiki.php(249): SpecialPageFactory::executePath(Title, RequestContext)
#4 /srv/mediawiki/php-1.26wmf20/includes/MediaWiki.php(683): MediaWiki->performRequest()
#5 /srv/mediawiki/php-1.26wmf20/includes/MediaWiki.php(474): MediaWiki->main()
#6 /srv/mediawiki/php-1.26wmf20/index.php(41): MediaWiki->run()
#7 /srv/mediawiki/w/index.php(3): include(string)
#8 {main}

Event Timeline

Krenair raised the priority of this task from to Low.
Krenair updated the task description. (Show Details)
Krenair added a project: AbuseFilter.
Krenair subscribed.

Checked whether we might have the data for 7847 anyway:

mysql> select afl_id, afl_var_dump from abuse_filter_log where afl_id in (7846, 7847, 7848);
+--------+--------------------+
| afl_id | afl_var_dump       |
+--------+--------------------+
|   7846 | stored-text:142252 |
|   7847 |                    |
|   7848 | stored-text:142255 |
+--------+--------------------+
3 rows in set (0.00 sec)

142253 and 142254 are actually revision text, so no luck.

Daimona subscribed.

Whatever we want to do, the script envisioned in T204236 (point 3.) would be a good place to handle empty var dumps.

Krinkle subscribed.

Stil seen on 1.32.0-wmf.23. Viewing https://test.wikipedia.org/wiki/Special:AbuseLog/7845 (as an admin) produces:

[W7PUBQrAADUAAEF2KcYAAADM] /wiki/Special:AbuseLog/7845

BadMethodCallException: Call to a member function dumpAllVars() on a non-object (boolean)

#0 /srv/mediawiki/php-1.32.0-wmf.24/extensions/AbuseFilter/includes/special/SpecialAbuseLog.php(108): SpecialAbuseLog->showDetails(string)
#1 /srv/mediawiki/php-1.32.0-wmf.24/includes/specialpage/SpecialPage.php(569): SpecialAbuseLog->execute(string)

Maybe this was caused by the bug fixed in rEABF31dba52a94f64e0e51dbeab06d83deb38b94ceb9? If so, these rows with empty var_dump should have duplicates with the var_dump set and, and thus can be deleted (and the deletion should be properly handled).

So, the script in the mentioned task will take care of this problem. The key here is that my assumption was correct, i.e. those rows are due to a bug (promptly resolved) which caused duplicate insertions, one without the var dump. This is pretty obvious: just look at this query, every hit has two rows, the first one without the var dump.
In this case, the script would just search for a duplicate row and delete the faulty ones. However, I'm a bit scared by Krenair's comment in T110854#1588294: "stored-text:142255" should actually contain the var dump for the row 7847 (and 7848). Could someone please check again that fetchText.php 142255 really holds a revision text, and not an AbuseFilterVariableHolder/array?

FTR:

16:08 <Urbanecm> is https://phabricator.wikimedia.org/T110854 actually resolved now?
16:08 <Urbanecm> the script was completed at testwiki already
16:33 <Daimona> For testwiki, yes, but I'd leave it open because it might have happened on other wikis, too
17:42 <Urbanecm> okay