TYPO3 Exception 1700841298 

TYPO3 13.4.29 - 05.06.26 

Installation Overview 

Exception happened in a console command called via scheduler. The scheduler task is sending emails and therefore faked a frontend request:

Bootstrap::initializeBackendAuthentication();
$site = $this->siteFinder->getSiteByPageId(1);

$request = (new ServerRequest())
    ->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_FE)
    ->withAttribute('site', $site);
$GLOBALS['TYPO3_REQUEST'] = $request;
// ...
$email = (new FluidEmail());
// ...
$email->setRequest($GLOBALS['TYPO3_REQUEST']);
Copied!

Solution 

I resolved the issue by not setting the global variable and instead sending the request as parameter to the place where it is needed for the mailer:

Bootstrap::initializeBackendAuthentication();
$site = $this->siteFinder->getSiteByPageId(1);

$request = (new ServerRequest())
    ->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_FE)
    ->withAttribute('site', $site);
// ...
$email = (new FluidEmail());
// ...
$email->setRequest($request);
Copied!