Page MenuHomePhabricator

Exception when inviting a user
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • install latest version of the InviteSignup extension from git
  • run update.php to create db table
  • go to Special:InviteSignup, enter an email address, press "add"

What happens?:

  • an exception is thrown:
[ac7a8c7608c8bf4e67b0a048] /wiki/Special:InviteSignup MWException: Language::sprintfDate: The timestamp should have 14 characters

Backtrace:

from /var/www/mediawiki/includes/language/Language.php(943)
#0 /var/www/mediawiki/includes/language/Language.php(2255): Language->sprintfDate()
#1 /var/www/mediawiki/includes/language/Language.php(2324): Language->internalUserTimeAndDate()
#2 /var/www/mediawiki/extensions/InviteSignup/includes/SpecialInviteSignup.php(101): Language->userTimeAndDate()
#3 /var/www/mediawiki/includes/specialpage/SpecialPage.php(727): SpecialInviteSignup->execute()
#4 /var/www/mediawiki/includes/specialpage/SpecialPageFactory.php(1621): MediaWiki\SpecialPage\SpecialPage->run()
#5 /var/www/mediawiki/includes/MediaWiki.php(357): MediaWiki\SpecialPage\SpecialPageFactory->executePath()
#6 /var/www/mediawiki/includes/MediaWiki.php(960): MediaWiki->performRequest()
#7 /var/www/mediawiki/includes/MediaWiki.php(613): MediaWiki->main()
#8 /var/www/mediawiki/index.php(50): MediaWiki->run()
#9 /var/www/mediawiki/index.php(46): wfIndexMain()
#10 {main}

What should have happened instead?:

  • send out email to invite the user
  • save a corresponding row in the invitesignup db table

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):
MW 1.41.0, dito MW 1.39.7

Other information (browser name/version, screenshots, etc.):
This happens on Mariadb. I suspect the culprit being the schema change introduced with commit 7bba375b40e48ffd3c63ae15aaa45471d57e2d90. When I change the BINARY(14) fields, e.g.

is_when BINARY(14) NOT NULL,

back to VARBINARY(14) everything works as expected. There might be an underlying issue with the timestamp format used (TS_UNIX vs. TS_MW) though, which is only brought to light by the more restrictive BINARY field definition.

Event Timeline

@janboehme, ah, right, check here https://gerrit.wikimedia.org/r/c/mediawiki/extensions/InviteSignup/+/1110878

is_when BINARY(14) is not compatible with wfTimestamp( TS_UNIX ) (it adds null characters and $ts = wfTimestamp( TS_MW, $ts ) fails