Page MenuHomePhabricator

SparkPost error during password reset
Open, Needs TriagePublicBug

Description

We noticed that when user re-set their password (confirm link send out by email), Sparkpost error message showed.

Steps to Reproduce:

  1. https://en.moegirl.org/Special:PasswordReset
  2. Type in username & email address.
  3. error message: [b14049ef8f2c3d8dbf0db51b] 2019-06-10 06:50:06: Fatal exception of type "SparkPost\SparkPostException"

Actual Results:
[b14049ef8f2c3d8dbf0db51b] 2019-06-10 06:50:06: Fatal exception of type "SparkPost\SparkPostException"

Expected Results:
Password reset link send to user.

Event Timeline

Zoglun created this task.Jun 10 2019, 6:51 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 10 2019, 6:51 AM

Error log dump. Seems to be a bug in reply to:

[cb23798b3e9e6e25b017d619] /Special:PasswordReset SparkPost\SparkPostException from line 103 of /w/extensions/SparkPost/vendor/sparkpost/sparkpost/lib/SparkPost/SparkPost.php: { "errors": [ { "message": "Invalid header", "description": "Error while validating header Reply-To: Header content all whitespace", "code": "3002" } ] }

Backtrace:

#0 /w/extensions/SparkPost/vendor/sparkpost/sparkpost/lib/SparkPost/SparkPost.php(79): SparkPost\SparkPost->syncRequest(string, string, array, array)
#1 /w/extensions/SparkPost/vendor/sparkpost/sparkpost/lib/SparkPost/ResourceBase.php(89): SparkPost\SparkPost->request(string, string, array, array)
#2 /w/extensions/SparkPost/vendor/sparkpost/sparkpost/lib/SparkPost/ResourceBase.php(59): SparkPost\ResourceBase->request(string, string, array, array)
#3 /w/extensions/SparkPost/vendor/sparkpost/sparkpost/lib/SparkPost/Transmission.php(23): SparkPost\ResourceBase->post(array, array)
#4 /w/extensions/SparkPost/includes/SPHooks.php(129): SparkPost\Transmission->post(array)
#5 /w/extensions/SparkPost/includes/SPHooks.php(71): MediaWiki\SparkPost\SPHooks::sendEmail(array, array, MailAddress, string, string, SparkPost\SparkPost, GlobalVarConfig)
#6 /w/includes/Hooks.php(177): MediaWiki\SparkPost\SPHooks::onAlternateUserMailer(array, array, MailAddress, string, string)
#7 /w/includes/Hooks.php(205): Hooks::callHook(string, array, array, NULL)
#8 /w/includes/mail/UserMailer.php(370): Hooks::run(string, array)
#9 /w/includes/mail/UserMailer.php(189): UserMailer::sendInternal(array, MailAddress, string, string, array)
#10 /w/includes/user/User.php(4657): UserMailer::send(array, MailAddress, string, string, array)
#11 /w/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php(475): User->sendMail(string, string)
#12 /w/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php(320): MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider->sendPasswordResetEmail(MediaWiki\Auth\TemporaryPasswordAuthenticationRequest)
#13 [internal function]: MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider->MediaWiki\Auth\{closure}(integer)
#14 /w/includes/libs/rdbms/database/Database.php(3390): call_user_func_array(Closure, array)
#15 /w/includes/libs/rdbms/loadbalancer/LoadBalancer.php(1409): Wikimedia\Rdbms\Database->runOnTransactionIdleCallbacks(integer)
#16 [internal function]: Wikimedia\Rdbms\LoadBalancer->Wikimedia\Rdbms\{closure}(Wikimedia\Rdbms\DatabaseMysqli)
#17 /w/includes/libs/rdbms/loadbalancer/LoadBalancer.php(1653): call_user_func_array(Closure, array)
#18 /w/includes/libs/rdbms/loadbalancer/LoadBalancer.php(1418): Wikimedia\Rdbms\LoadBalancer->forEachOpenMasterConnection(Closure)
#19 /w/includes/libs/rdbms/lbfactory/LBFactory.php(248): Wikimedia\Rdbms\LoadBalancer->runMasterPostTrxCallbacks(integer)
#20 [internal function]: Wikimedia\Rdbms\LBFactory->Wikimedia\Rdbms\{closure}(Wikimedia\Rdbms\LoadBalancer)
#21 /w/includes/libs/rdbms/lbfactory/LBFactoryMulti.php(425): call_user_func_array(Closure, array)
#22 /w/includes/libs/rdbms/lbfactory/LBFactory.php(250): Wikimedia\Rdbms\LBFactoryMulti->forEachLB(Closure)
#23 /w/includes/MediaWiki.php(601): Wikimedia\Rdbms\LBFactory->commitMasterChanges(string, array)
#24 /w/includes/MediaWiki.php(575): MediaWiki::preOutputCommit(RequestContext, Closure)
#25 /w/includes/MediaWiki.php(877): MediaWiki->doPreOutputCommit(Closure)
#26 /w/includes/MediaWiki.php(524): MediaWiki->main()
#27 /w/index.php(42): MediaWiki->run()
#28 {main}

Same bug mentioned in T217816 as well.

This comment was removed by Zoglun.

@D3r1ck01 It seems that this extension need to set Reply-To header based on condition. Only add Reply-To header when user sending email via Special:EmailUser page.

I'll have a look at this, thanks for reporting!