- ๐ณ๐ฟNew Zealand luke.stewart
luke.stewart โ made their first commit to this issueโs fork.
When using 8.x with the Update module active, the module will always see Drupal as not-up-to-date. Yet no email is ever sent, due to the following exception that gets thrown when the module causes AutomaticCron::onTerminate to be called, and the request time actually starts invoking cron jobs:
if ($threshold > 0) {
$cron_next = $this->state->get('system.cron_last', 0) + $threshold;
if (REQUEST_TIME > $cron_next) {
$this->cron->run();
}
}
While no mail goes out, the following error appears in the watchdog:
wid: 47
uid: 1
type: cron
message: %type: !message in %function (line %line of %file).
variables: a:6:{s:5:"%type";s:64:"Symfony\Component\DependencyInjection\Exception\RuntimeException";s:8:"!message";s:114:"You have requested a synthetic service ("request"). The DIC does not know how to construct this service.";s:9:"%function";s:43:"service_container_prod->getRequestService()";s:5:"%file";s:171:"/Users/rtoren/projects/drupal8/drupal/sites/default/files/php/service_container/service_container_prod/a1e224f690e8ddf15227b917194424a0d05132adc3cd5f3af47806f418a3aec5.php";s:5:"%line";i:3472;s:14:"severity_level";i:3;}
severity: 3
link:
location:
referer:
hostname:
timestamp: 1399691972
The actual "point of death" is in PhpMail::mail():
// For headers, PHP's API suggests that we use CRLF normally,
// but some MTAs incorrectly replace LF with CRLF. See #234403.
$mail_headers = join("\n", $mimeheaders);
$request = \Drupal::request();
The problem here is the call to \Drupal::request(). I've been able to verify that sometime during the handling of onTerminate, the request object ceases to be available via \Drupal::request() (remember, onTerminate runs only after the browser has received output), if the object is even available. So PhpMail::mail() cannot be called right now this late in the history of the request
Not sure what the fix is, but pretty sure I have the cause down.
Needs work
11.0 ๐ฅ
There is consensus among core maintainers that this is a major issue. Only core committers should add this tag.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
luke.stewart โ made their first commit to this issueโs fork.