What is the problem?
Trying to access the details/examine an abuse filter log I am getting the below exceptions:
For Special:AbuseLog/<log id>:
[fdd36556b437c8cf96519d0b] /wiki/Special:AbuseLog/236 TypeError: Argument 2 passed to MediaWiki\Extension\AbuseFilter\ProtectedVarsAccessLogger::logViewProtectedVariableValue() must be of the type string, null given, called in /var/www/html/w/extensions/AbuseFilter/includes/Special/SpecialAbuseLog.php on line 842 Backtrace: from /var/www/html/w/extensions/AbuseFilter/includes/ProtectedVarsAccessLogger.php(99) #0 /var/www/html/w/extensions/AbuseFilter/includes/Special/SpecialAbuseLog.php(842): MediaWiki\Extension\AbuseFilter\ProtectedVarsAccessLogger->logViewProtectedVariableValue() #1 /var/www/html/w/extensions/AbuseFilter/includes/Special/SpecialAbuseLog.php(243): MediaWiki\Extension\AbuseFilter\Special\SpecialAbuseLog->showDetails() #2 /var/www/html/w/includes/specialpage/SpecialPage.php(723): MediaWiki\Extension\AbuseFilter\Special\SpecialAbuseLog->execute() #3 /var/www/html/w/includes/specialpage/SpecialPageFactory.php(1724): MediaWiki\SpecialPage\SpecialPage->run() #4 /var/www/html/w/includes/actions/ActionEntryPoint.php(504): MediaWiki\SpecialPage\SpecialPageFactory->executePath() #5 /var/www/html/w/includes/actions/ActionEntryPoint.php(146): MediaWiki\Actions\ActionEntryPoint->performRequest() #6 /var/www/html/w/includes/MediaWikiEntryPoint.php(200): MediaWiki\Actions\ActionEntryPoint->execute() #7 /var/www/html/w/index.php(58): MediaWiki\MediaWikiEntryPoint->run() #8 {main}
Special:AbuseFilter/examine/log/<log id>:
[93fde6f86959cbaa00443a28] /wiki/Special:AbuseFilter/examine/log/236 TypeError: Argument 2 passed to MediaWiki\Extension\AbuseFilter\ProtectedVarsAccessLogger::logViewProtectedVariableValue() must be of the type string, null given, called in /var/www/html/w/extensions/AbuseFilter/includes/View/AbuseFilterViewExamine.php on line 344 Backtrace: from /var/www/html/w/extensions/AbuseFilter/includes/ProtectedVarsAccessLogger.php(99) #0 /var/www/html/w/extensions/AbuseFilter/includes/View/AbuseFilterViewExamine.php(344): MediaWiki\Extension\AbuseFilter\ProtectedVarsAccessLogger->logViewProtectedVariableValue() #1 /var/www/html/w/extensions/AbuseFilter/includes/View/AbuseFilterViewExamine.php(132): MediaWiki\Extension\AbuseFilter\View\AbuseFilterViewExamine->showExaminerForLogEntry() #2 /var/www/html/w/extensions/AbuseFilter/includes/Special/SpecialAbuseFilter.php(175): MediaWiki\Extension\AbuseFilter\View\AbuseFilterViewExamine->show() #3 /var/www/html/w/includes/specialpage/SpecialPage.php(723): MediaWiki\Extension\AbuseFilter\Special\SpecialAbuseFilter->execute() #4 /var/www/html/w/includes/specialpage/SpecialPageFactory.php(1724): MediaWiki\SpecialPage\SpecialPage->run() #5 /var/www/html/w/includes/actions/ActionEntryPoint.php(504): MediaWiki\SpecialPage\SpecialPageFactory->executePath() #6 /var/www/html/w/includes/actions/ActionEntryPoint.php(146): MediaWiki\Actions\ActionEntryPoint->performRequest() #7 /var/www/html/w/includes/MediaWikiEntryPoint.php(200): MediaWiki\Actions\ActionEntryPoint->execute() #8 /var/www/html/w/index.php(58): MediaWiki\MediaWikiEntryPoint->run() #9 {main}
My suspicion:
- The filter which triggered those log entries is marked as protected but does not use the user_unnamed_ip variable.
- So far all the log entries where I have seen these exceptions are for the autocreateaccount action.
- Filters which use the pattern user_unnamed_ip do not trigger such a log entry, so the assumption is that protected filters do not need to support such a log entry.
However, it is possible to have a protected filter which does not use the user_unnamed_ip variable, and this will trigger an autocreateaccount log entry. For example:
- When creating a filter, you can check the I understand that details of this filter will be hidden from users who cannot see protected variables checkbox regardless of which variables you have used.
- You can edit an existing filter and remove any user_unnamed_ip variables from its pattern. This will not remove its protected status.
Steps to reproduce problem
- Enable temporary accounts on your wiki (e.g. $wgAutoCreateTempUser['enabled'] = true;)
- As an admin with the abusefilter-access-protected-vars right, create a new abuse filter (Special:AbuseFilter/new)
- Choose any value for description and for pattern put action
- Check the box that says I understand that details of this filter will be hidden from users who cannot see protected variables
- As an anonymous user (not logged in as either a named user or temporary user) perform an edit
- As the admin from step 2, go to Special:AbuseLog
- You will see two entries for the edit you made in step 3. One will say triggered filter <id>, performing the action "autocreateaccount". For this entry, click details and/or examine
Expected behaviour: The details or examine pages will load successfully.
Observed behaviour: Above exception(s).
Environment
Wiki(s): local docker Abuse Filter – (11901be) 07:41, 8 October 2024.