Open klodeckl opened 3 weeks ago
Downgrading to TYPO3 11.5.38 didn’t solve the problem. I don’t know why.
I already recreated the task but withoult luck, issue still exists
@klodeckl , @seirerman I can not reproduce the issue within solr-ddev-site on TYPO3 11.5.40 The scheduler task runs as expected via CLI.
Please provide more infos about your setup:
typo3 scheduler:run --task=<ID_of_EXT:solr-task> -f
)?It is a multisite system, yes.
Running the scheduler task only throws the same error message: /var/www/vendor/bin/typo3 scheduler:run --task=19 -fvv Uncaught TYPO3 Exception ApacheSolrForTypo3\Solr\Task\IndexQueueWorkerTask::getInitializedIndexService(): Argument #1 ($site) must be of type ApacheSolrForTypo3\Solr\Domain\Site\Site, null given, called in /var/www/vendor/apache-solr-for-typo3/solr/Classes/Task/IndexQueueWorkerTask.php on line 75 thrown in file /var/www/vendor/apache-solr-for-typo3/solr/Classes/Task/IndexQueueWorkerTask.php in line 207
Upgrade wizards are executed und database schema is up to date.
On our TYPO3 11.5.39 projects we do no have any trouble. Currently 11.5.40 is blocked for out projects by https://forge.typo3.org/issues/105239, so we can not try 11.5.40 on any of our projects.
I didn't encounter any problems starting the Scheduler task in our solr-ddev-site environment with TYPO3 11.5.40.
But I was able to provoke this error, it occurs if
Perhaps there is an issue with the TypoScript or the site configuration.
Site configuration is set as usual, and solr TS is included. The frontend wouldn't work without it.
Any specific values I should check?
I had the same error, but the message was misleading. In my case, the following condition in the Typoscript was the problem:
request && request.getNormalisedParams().getHttpHost()
I had to extend it:
request && request.getNormalizedParams() && request.getNormalizedParams().getHttpHost()
You can also start the Debugger and set a breakpoint in vendor/typo3/cms-scheduler/Classes/Scheduler.php:181
. Here you can read the full exception message.
All infos based on TYPO3 12.4.21.
@seirerman No specific setting unfortunately I only did very basic tests and removed the TS includes completely.
IMHO the hint from @dschlobohm regarding the misleading error message is a good point, a detailed look at the exception could help to identify the error.
I don't have a condition containing "request.getNormalisedParams" anywhere in my code. I also removed all of my custom solr TS, but that didn't help, either.
This is from my log:
Tue, 15 Oct 2024 09:40:04 +0200 [CRITICAL] request="facccf3df39e5" component="TYPO3.CMS.Core.Error.DebugExceptionHandler": Core: Exception handler (CLI: BE): TypeError, code
#0, file /var/html/web/typo3conf/ext/solr/Classes/Task/IndexQueueWorkerTask.php, line 207: ApacheSolrForTypo3\Solr\Task\IndexQueueWorkerTask::getInitializedIndexService(): Argument #1 ($site) must be of type ApacheSolrForTypo3\Solr\Domain\Site\Site, null given, called in /var/html/web/typo3conf/ext/solr/Classes/Task/IndexQueueWorkerTask.php on line 75- TypeError: ApacheSolrForTypo3\Solr\Task\IndexQueueWorkerTask::getInitializedIndexService(): Argument #1 ($site) must be of type ApacheSolrForTypo3\Solr\Domain\Site\Site, null given, called in /var/html/web/typo3conf/ext/solr/Classes/Task/IndexQueueWorkerTask.php on line 75, in file /var/html/web/typo3conf/ext/solr/Classes/Task/IndexQueueWorkerTask.php:207 - {"mode":"CLI","application_mode":"BE","exception_class":"TypeError","exception_code":0,"file":"/var/html/web/typo3conf/ext/solr/Classes/Task/IndexQueueWorkerTask.php","line":207,"message":"ApacheSolrForTypo3\\Solr\\Task\\IndexQueueWorkerTask::getInitializedIndexService(): Argument #1 ($site) must be of type ApacheSolrForTypo3\\Solr\\Domain\\Site\\Site, null given, called in /var/html/web/typo3conf/ext/solr/Classes/Task/IndexQueueWorkerTask.php on line 75","request_url":"http:///index.php","exception":"TypeError: ApacheSolrForTypo3\\Solr\\Task\\IndexQueueWorkerTask::getInitializedIndexService(): Argument #1 ($site) must be of type ApacheSolrForTypo3\\Solr\\Domain\\Site\\Site, null given, called in /var/html/web/typo3conf/ext/solr/Classes/Task/IndexQueueWorkerTask.php on line 75 and defined in /var/html/web/typo3conf/ext/solr/Classes/Task/IndexQueueWorkerTask.php:207\nStack trace:\n
#0 /var/html/web/typo3conf/ext/solr/Classes/Task/IndexQueueWorkerTask.php(75): ApacheSolrForTypo3\\Solr\\Task\\IndexQueueWorkerTask->getInitializedIndexService()\n
#1 /var/html/web/typo3/sysext/scheduler/Classes/Scheduler.php(192): ApacheSolrForTypo3\\Solr\\Task\\IndexQueueWorkerTask->execute()\n
#2 /var/html/web/typo3/sysext/scheduler/Classes/Command/SchedulerCommand.php(255): TYPO3\\CMS\\Scheduler\\Scheduler->executeTask()\n
#3 /var/html/web/typo3/sysext/scheduler/Classes/Command/SchedulerCommand.php(194): TYPO3\\CMS\\Scheduler\\Command\\SchedulerCommand->executeOrStopTask()\n
#4 /var/html/web/typo3/sysext/scheduler/Classes/Command/SchedulerCommand.php(120): TYPO3\\CMS\\Scheduler\\Command\\SchedulerCommand->loopTasks()\n
#5 /var/html/vendor/symfony/console/Command/Command.php(298): TYPO3\\CMS\\Scheduler\\Command\\SchedulerCommand->execute()\n
#6 /var/html/vendor/symfony/console/Application.php(1058): Symfony\\Component\\Console\\Command\\Command->run()\n
#7 /var/html/vendor/symfony/console/Application.php(301): Symfony\\Component\\Console\\Application->doRunCommand()\n
#8 /var/html/vendor/symfony/console/Application.php(171): Symfony\\Component\\Console\\Application->doRun()\n
#9 /var/html/web/typo3/sysext/core/Classes/Console/CommandApplication.php(114): Symfony\\Component\\Console\\Application->run()\n
#10 /var/html/vendor/typo3/cms-cli/typo3(23): TYPO3\\CMS\\Core\\Console\\CommandApplication->run()\n
#11 /var/html/vendor/typo3/cms-cli/typo3(24): {closure}()\n
#12 /var/html/vendor/bin/typo3(120): include('...')\n
#13 {main}"}
We're testing the upgrade to TYPO3 12 at the moment (with the plan to update all of our websites by the end of the month), and fortunately ext:solr 12.0.5 is not affected. Indexing works fine with TYPO3 12.
I’m currently working on the update to TYPO3 12. I will test if the issue is also solved for me after the update and report it here.
I had the same error, but the message was misleading. In my case, the following condition in the Typoscript was the problem:
request && request.getNormalisedParams().getHttpHost()
I had to extend it:
request && request.getNormalisedParams() && request.getNormalisedParams().getHttpHost()
All infos based on TYPO3 12.4.21.
I can confirm this. After an update from TYPO3 11 -> 12 (+ solr 11 -> 12), I saw the error message that the OP posted (Argument must be Site, null given). In the scheduler, when adding or editing an IndexQueueWorker-task, the site select dropdown was empty.
Changing ALL occurences of
request && request.getNormalizedParams().getHttpHost()
in our own sitepackage typoscript to
request && request.getNormalizedParams() && request.getNormalizedParams().getHttpHost()
the error message vanished, and the site selector drop down contained all configured sites.
Attention: dschlobohms original post/code has a typo (getNormalisedParams, with an "s"). It must be getNormalizedParams (with a "z").
I've updated my post, thanks for the hint!
I updated TYPO3 from 11.5.38 to 11.5.40. Now I get the following error when executing the indexing scheduler task:
Uncaught TYPO3 Exception ApacheSolrForTypo3\Solr\Task\IndexQueueWorkerTask::getInitializedIndexService(): Argument #1 ($site) must be of type ApacheSolrForTypo3\Solr\Domain\Site\Site, null given, called in /var/www/vendor/apache-solr-for-typo3/solr/Classes/Task/IndexQueueWorkerTask.php on line 75 thrown in file /var/www/vendor/apache-solr-for-typo3/solr/Classes/Task/IndexQueueWorkerTask.php in line 207
Manually starting the task in the backend scheduler module works fine.
solr 11.5.6 PHP 8.2