Page MenuHomePhabricator

Domain Exception on trying to write to undefined property mailer
Closed, ResolvedPublic

Description

This error appears in the logs every 30 seconds.

[15-Jun-2015 10:55:30 Europe/Madrid] [2015-06-15 10:55:30] EXCEPTION: (PhutilProxyException) Error while executing Task ID 198435. {>} (DomainException) Attempt to write to undeclared property PhabricatorMailImplementationPHPMailerAdapter::mailer. at [<phutil>/src/object/Phobject.php:23]
[15-Jun-2015 10:55:30 Europe/Madrid] arcanist(head=master, ref.master=956bfa701c36), phabricator(head=master, ref.master=b95fc8ba5d9f), phutil(head=master, ref.master=3b4da3f33153), sprint(head=master, ref.master=ba0d4c2d46da)
[15-Jun-2015 10:55:30 Europe/Madrid]   #0 <#2> Phobject::__set(string, PHPMailer) called at [<phabricator>/src/applications/metamta/adapter/PhabricatorMailImplementationPHPMailerAdapter.php:13]
[15-Jun-2015 10:55:30 Europe/Madrid]   #1 <#2> PhabricatorMailImplementationPHPMailerAdapter::__construct()
[15-Jun-2015 10:55:30 Europe/Madrid]   #2 <#2> ReflectionClass::newInstance() called at [<phutil>/src/utils/utils.php:671]
[15-Jun-2015 10:55:30 Europe/Madrid]   #3 <#2> newv(string, array) called at [<phabricator>/src/infrastructure/env/PhabricatorEnv.php:513]
[15-Jun-2015 10:55:30 Europe/Madrid]   #4 <#2> PhabricatorEnv::newObjectFromConfig(string) called at [<phabricator>/src/applications/metamta/storage/PhabricatorMetaMTAMail.php:368]
[15-Jun-2015 10:55:30 Europe/Madrid]   #5 <#2> PhabricatorMetaMTAMail::buildDefaultMailer() called at [<phabricator>/src/applications/metamta/storage/PhabricatorMetaMTAMail.php:387]
[15-Jun-2015 10:55:30 Europe/Madrid]   #6 <#2> PhabricatorMetaMTAMail::sendNow() called at [<phabricator>/src/applications/metamta/PhabricatorMetaMTAWorker.php:26]
[15-Jun-2015 10:55:30 Europe/Madrid]   #7 <#2> PhabricatorMetaMTAWorker::doWork() called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorWorker.php:91]
[15-Jun-2015 10:55:30 Europe/Madrid]   #8 <#2> PhabricatorWorker::executeTask() called at [<phabricator>/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php:162]
[15-Jun-2015 10:55:30 Europe/Madrid]   #9 <#2> PhabricatorWorkerActiveTask::executeTask() called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php:22]
[15-Jun-2015 10:55:30 Europe/Madrid]   #10 PhabricatorTaskmasterDaemon::run() called at [<phutil>/src/daemon/PhutilDaemon.php:183]
[15-Jun-2015 10:55:30 Europe/Madrid]   #11 PhutilDaemon::execute() called at [<phutil>/scripts/daemon/exec/exec_daemon.php:125]

Event Timeline

josetesan raised the priority of this task from to Needs Triage.
josetesan updated the task description. (Show Details)
josetesan added a project: libphutil.
josetesan updated the task description. (Show Details)
josetesan added a subscriber: josetesan.
joshuaspence claimed this task.
joshuaspence added a subscriber: joshuaspence.

This should be resolved at HEAD.

HEAD seems to have fixed this $mailer issue for PhabricatorMailImplementationPHPMailerLiteAdapter, but not for PhabricatorMailImplementationPHPMailerAdapter

dgfitch added a subscriber: dgfitch.

For some reason my stack trace is slightly shorter, but I updated Friday and it stopped working.

I updated to HEAD just now, and I'm still getting similar errors and no mail is sending.

[16-Jun-2015 13:57:16 America/Chicago] [2015-06-16 13:57:16] EXCEPTION: (PhutilProxyException) Error while executing Task ID 132335. {>} (DomainException) Attempt to write to undeclared property PhabricatorMailImplementationPHPMailerAdapter::mailer. at [<phutil>/src/object/Phobject.php:23]
[16-Jun-2015 13:57:16 America/Chicago]   #2 <#2> ReflectionClass::newInstance() called at [<phutil>/src/utils/utils.php:671]
[16-Jun-2015 13:57:16 America/Chicago]   #3 <#2> newv(string, array) called at [<phabricator>/src/infrastructure/env/PhabricatorEnv.php:513]
[16-Jun-2015 13:57:16 America/Chicago]   #4 <#2> PhabricatorEnv::newObjectFromConfig(string) called at [<phabricator>/src/applications/metamta/storage/PhabricatorMetaMTAMail.php:368]

I'm using phpmailer:

pasted_file (559×289 px, 46 KB)

Adding protected $mailer; to src/applications/metamta/adapter/PhabricatorMailImplementationPHPMailerAdapter.php fixes it.

Edit: Except now I've overflowed the local mail server with the pending queue, heh...

Yep. Getting this error as well on our phabricator instance.

@dgfitch's fix seems to have made the daemons not explode again.