Page MenuHomePhabricator

PHP Error "Undefined index: 1 in AbuseFilter.php on line 928"
Closed, ResolvedPublicPRODUCTION ERROR

Description

PHP Notice: Undefined index: 1 in /srv/mediawiki/php-1.32.0-wmf.19/extensions/AbuseFilter/includes/AbuseFilter.php on line 928
trace
#0 /srv/mediawiki/php-1.32.0-wmf.19/extensions/AbuseFilter/includes/AbuseFilter.php(928): MWExceptionHandler::handleError(integer, string, string, integer, array, array)
#1 /srv/mediawiki/php-1.32.0-wmf.19/extensions/AbuseFilter/includes/AbuseFilter.php(1187): AbuseFilter::executeFilterActions(array, Title, AbuseFilterVariableHolder)
#2 /srv/mediawiki/php-1.32.0-wmf.19/extensions/AbuseFilter/includes/AbuseFilterHooks.php(123): AbuseFilter::filterAction(AbuseFilterVariableHolder, Title)
#3 /srv/mediawiki/php-1.32.0-wmf.19/extensions/AbuseFilter/includes/AbuseFilterHooks.php(58): AbuseFilterHooks::filterEdit(RequestContext, WikitextContent, string, Status, string, boolean)
#4 /srv/mediawiki/php-1.32.0-wmf.19/includes/Hooks.php(174): AbuseFilterHooks::onEditFilterMergedContent(RequestContext, WikitextContent, Status, string, User, boolean)
#5 /srv/mediawiki/php-1.32.0-wmf.19/includes/Hooks.php(202): Hooks::callHook(string, array, array, NULL)
#6 /srv/mediawiki/php-1.32.0-wmf.19/includes/EditPage.php(1719): Hooks::run(string, array)
#7 /srv/mediawiki/php-1.32.0-wmf.19/includes/EditPage.php(2163): EditPage->runPostMergeFilters(WikitextContent, Status, User)
#8 /srv/mediawiki/php-1.32.0-wmf.19/includes/EditPage.php(1546): EditPage->internalAttemptSave(NULL, boolean)
#9 /srv/mediawiki/php-1.32.0-wmf.19/includes/api/ApiEditPage.php(392): EditPage->attemptSave(NULL)
#10 /srv/mediawiki/php-1.32.0-wmf.19/includes/api/ApiMain.php(1587): ApiEditPage->execute()
#11 /srv/mediawiki/php-1.32.0-wmf.19/includes/api/ApiMain.php(531): ApiMain->executeAction()
#12 /srv/mediawiki/php-1.32.0-wmf.19/includes/api/ApiMain.php(502): ApiMain->executeActionWithErrorHandling()
#13 /srv/mediawiki/php-1.32.0-wmf.19/api.php(87): ApiMain->execute()
#14 /srv/mediawiki/w/api.php(3): include(string)
#15 {main}

Source

https://github.com/wikimedia/mediawiki-extensions-AbuseFilter/blob/b0bf8b0e154ce03d2496dd136fa05dd74d3f27f9/includes/AbuseFilter.php#L928:

		foreach ( $actionsByFilter as $filter => $actions ) {
			# line 928:
				list( $rateCount, $ratePeriod ) = explode( ',', array_shift( $parameters ) );

Details

See https://logstash.wikimedia.org/goto/e142c47d3a68a749937b7770d4fef021

  • Happens about 700 times per week.
  • Always for the same index (1) and line number (928).
  • Has been happening for at least 30 days (since 1.32.0-wmf.15 or earlier).

Event Timeline

Krinkle updated the task description. (Show Details)

Strongly related to T203336, I guess. I'll try to look into this.

Daimona triaged this task as High priority.EditedSep 5 2018, 9:46 AM

I'm highly undecided between High and UBN. I tried to replicate the problem on my wiki, but didn't succeed. However, since those parameters are vital for the "throttle" action, their lack means that basically every filter with "throttle" set could be malfunctioning, taking unpredictable actions. This also made me discover this problem with throttle. My suggestion is to merge the patch for T203336, run the included script and see if it makes this error disappear: since it happens every 14 mins on average, this should be trivial to check. If it won't disappear, then I'll try again to reproduce the problem.

Also, @Krinkle would it be possible to know on which wiki the problem originate? Is it only one wiki, or more than one?

Last 7 days:

  • Total: 604 errors matching
  • Domains: de.wiktionary.org 332x, pt.wikipedia.org 190x, (others)

@Krinkle Thanks, that explains a lot. I quickly looked at de.wiktionary filters and found two bad things there. However, those filters are both private and I don't want to say too much here. I'll try to find a solution later, although the exising patches should fix the problem.

Adding missing team tag based on mw:Maintainers, for a production error.

Recent trace:

PHP Notice: Undefined index: 1

#0 /srv/mediawiki/php-1.33.0-wmf.6/extensions/AbuseFilter/includes/AbuseFilter.php(932): MWExceptionHandler::handleError(integer, string, string, integer, array, array)
#1 /srv/mediawiki/php-1.33.0-wmf.6/extensions/AbuseFilter/includes/AbuseFilter.php(1187): AbuseFilter::executeFilterActions(array, Title, AbuseFilterVariableHolder, User)
#2 /srv/mediawiki/php-1.33.0-wmf.6/extensions/AbuseFilter/includes/AbuseFilterHooks.php(123): AbuseFilter::filterAction(AbuseFilterVariableHolder, Title, string, User)
#3 /srv/mediawiki/php-1.33.0-wmf.6/extensions/AbuseFilter/includes/AbuseFilterHooks.php(58): AbuseFilterHooks::filterEdit(DerivativeContext, WikitextContent, string, Status, string, boolean)
#4 /srv/mediawiki/php-1.33.0-wmf.6/includes/Hooks.php(174): AbuseFilterHooks::onEditFilterMergedContent(DerivativeContext, WikitextContent, Status, string, User, boolean)
#5 /srv/mediawiki/php-1.33.0-wmf.6/includes/Hooks.php(202): Hooks::callHook(string, array, array, NULL)
#6 /srv/mediawiki/php-1.33.0-wmf.6/includes/EditPage.php(1768): Hooks::run(string, array)
#7 /srv/mediawiki/php-1.33.0-wmf.6/includes/EditPage.php(2212): EditPage->runPostMergeFilters(WikitextContent, Status, User)
#8 /srv/mediawiki/php-1.33.0-wmf.6/includes/EditPage.php(1595): EditPage->internalAttemptSave(NULL, boolean)
#9 /srv/mediawiki/php-1.33.0-wmf.6/includes/api/ApiEditPage.php(392): EditPage->attemptSave(NULL)
#10 /srv/mediawiki/php-1.33.0-wmf.6/includes/api/ApiMain.php(1576): ApiEditPage->execute()
#11 /srv/mediawiki/php-1.33.0-wmf.6/includes/api/ApiMain.php(500): ApiMain->executeAction()
#12 /srv/mediawiki/php-1.33.0-wmf.6/extensions/VisualEditor/includes/ApiVisualEditorEdit.php(72): ApiMain->execute()
#13 /srv/mediawiki/php-1.33.0-wmf.6/extensions/VisualEditor/includes/ApiVisualEditorEdit.php(370): ApiVisualEditorEdit->saveWikitext(Title, string, array)
#14 /srv/mediawiki/php-1.33.0-wmf.6/includes/api/ApiMain.php(1576): ApiVisualEditorEdit->execute()
#15 /srv/mediawiki/php-1.33.0-wmf.6/includes/api/ApiMain.php(531): ApiMain->executeAction()
#16 /srv/mediawiki/php-1.33.0-wmf.6/includes/api/ApiMain.php(502): ApiMain->executeActionWithErrorHandling()
#17 /srv/mediawiki/php-1.33.0-wmf.6/api.php(87): ApiMain->execute()

For the record, this is still happening. Although this bug has no attached patch, it should be fixed after running the script in T209565 and manually fixing filters in P7956.

mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:09 PM