Page MenuHomePhabricator

Problem with creating a page in the Meta: ExpiryDef: Invalid expiry value
Closed, ResolvedPublicPRODUCTION ERROR

Description

Hello,

I am trying to create a new page in the Meta under the name: Levant Cultural Exchange Program.

I cannot. I have the following message:

[7b4230ad-38e2-4dc7-a6bb-2ea03c98eaa5] 2020-11-09 21:19:34: استثناء مميت من النوع "InvalidArgumentException"

In Arabic: deadly exception.

Thank you in advance,

Details

Stack Trace
2020-11-09 21:19:34 [7b4230ad-38e2-4dc7-a6bb-2ea03c98eaa5] mw1331 metawiki 1.36.0-wmf.16 exception ERROR: [7b4230ad-38e2-4dc7-a6bb-2ea03c98eaa5] /w/index.php?title=Levant_Cultural_Exchange_Program&action=submit   InvalidArgumentException from line 104 of /srv/mediawiki/php-1.36.0-wmf.16/includes/libs/ParamValidator/TypeDef/ExpiryDef.php: Invalid expiry value: بلا حدود، أسبوع واحد {"exception_id":"7b4230ad-38e2-4dc7-a6bb-2ea03c98eaa5","exception_url":"/w/index.php?title=Levant_Cultural_Exchange_Program&action=submit","caught_by":"entrypoint"} 
[Exception InvalidArgumentException] (/srv/mediawiki/php-1.36.0-wmf.16/includes/libs/ParamValidator/TypeDef/ExpiryDef.php:104) Invalid expiry value: بلا حدود، أسبوع واحد
  #0 /srv/mediawiki/php-1.36.0-wmf.16/includes/EditPage.php(1045): Wikimedia\ParamValidator\TypeDef\ExpiryDef::normalizeExpiry(string, integer)
  #1 /srv/mediawiki/php-1.36.0-wmf.16/includes/EditPage.php(587): EditPage->importFormData(WebRequest)
  #2 /srv/mediawiki/php-1.36.0-wmf.16/includes/actions/EditAction.php(71): EditPage->edit()
  #3 /srv/mediawiki/php-1.36.0-wmf.16/includes/actions/SubmitAction.php(38): EditAction->show()
  #4 /srv/mediawiki/php-1.36.0-wmf.16/includes/MediaWiki.php(530): SubmitAction->show()
  #5 /srv/mediawiki/php-1.36.0-wmf.16/includes/MediaWiki.php(316): MediaWiki->performAction(Article, Title)
  #6 /srv/mediawiki/php-1.36.0-wmf.16/includes/MediaWiki.php(943): MediaWiki->performRequest()
  #7 /srv/mediawiki/php-1.36.0-wmf.16/includes/MediaWiki.php(546): MediaWiki->main()
  #8 /srv/mediawiki/php-1.36.0-wmf.16/index.php(53): MediaWiki->run()
  #9 /srv/mediawiki/php-1.36.0-wmf.16/index.php(46): wfIndexMain()
  #10 /srv/mediawiki/w/index.php(3): require(string)
  #11 {main}

Event Timeline

Reedy changed the subtype of this task from "Task" to "Production Error".
Reedy edited Stack Trace. (Show Details)

Perhaps this falls under Editing, so tagging @ppelberg.

brennen renamed this task from Problem with creating a page in the Meta to Problem with creating a page in the Meta: ExpiryDef: Invalid expiry value.Nov 9 2020, 9:59 PM
brennen added a project: User-brennen.
brennen moved this task from Backlog to Logs/Train on the User-brennen board.

May block 1.36.0-wmf.16 (T263182) - input welcome. I believe all 19 instances in logstash are for the same creation attempt; haven't seen any others yet.

Looks like this is a translation issue. In Arabic, the message has been translated incorrectly. See Hebrew vs Arabic for comparison

Hebrew: https://meta.wikimedia.org/wiki/Special:AllMessages?prefix=watchlist-expiry-options&filter=all&lang=he&limit=50
Arabic: https://meta.wikimedia.org/wiki/Special:AllMessages?prefix=watchlist-expiry-options&filter=all&lang=ar&limit=50

I'll try and edit the message locally for Meta and we'll follow up with a patch to default expiration to "infinite" if the messaging is wrong

We've fixed this locally on Meta for now, so we should okay there, and also made the same fix on translatewiki.

May block 1.36.0-wmf.16 (T263182) - input welcome. I believe all 19 instances in logstash are for the same creation attempt; haven't seen any others yet.

Watchlist expiry isn't enabled on any Arabic wiki right now so I think we're okay (I see wmf.16 is already live on all groups anyway). We do however plan to enable it on Commons and Wikidata (which are multilingual) on November 17, but I'm assuming the TWN fix will have synced to git by then?

Change 640280 had a related patch set uploaded (by Dmaza; owner: Dmaza):
[mediawiki/core@master] Fix invalid watchlist expiry options

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

Change 640289 had a related patch set uploaded (by MusikAnimal; owner: MusikAnimal):
[mediawiki/core@master] New maintenance script to identify invalid options messages

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

Change 641286 had a related patch set uploaded (by Dmaza; owner: Dmaza):
[mediawiki/core@REL1_35] Fix invalid watchlist expiry options

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

Change 640280 merged by jenkins-bot:
[mediawiki/core@master] Fix invalid watchlist expiry options

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

Change 641286 merged by jenkins-bot:
[mediawiki/core@REL1_35] Fix invalid watchlist expiry options

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

dom_walden added a subscriber: dom_walden.

We now check the translations and only include valid expiry values in the dropdown. Any invalid expiry values are ignored and not included in the dropdown.

If none of the expiry values are valid, we fall back to English. If the page is already temporarily watched, we include the "n days left" option in the user's interface language. E.g.:

fallback_dropdown.png (337×686 px, 44 KB)

As Sam points out, if the English translation is invalid, we show an empty dropdown (screenshot) or, if the page is already temporarily watched, a dropdown with just the current expiration time. When you submit, the page is either watched permanently or the expiry time is unchanged. It does not prevent you submitting.

empty_dropdown.png (248×700 px, 28 KB)

It should be noted that this bug also affected action=watch and the watch star, and those have been fixed with these changes as well. With respect to the dropdown, they now behave the same as above.

The Arabic translation on Meta has been fixed, so I can successfully edit and create pages on Meta when I set my interface language to Arabic.

There are a few other translations which are incorrect, including be-tarask, awa, br. Meta gets updated tomorrow, after which the bug shouldn't affect them. But the translations will need to be corrected at some point, so they can see expiry options in their language.

Test Environment: https://en.wikipedia.beta.wmflabs.org MediaWiki 1.36.0-alpha (0dd35aa) 17:31, 17 November 2020 (latest version tested).

This change has been on production for a while now, and it seems to have resolved the issue. Users can now see valid expiry values in the dropdown. If there are invalid translations, they can still watch pages permanently. I'm marking this work as Done.