Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception in combination with Solr extension scheduler task (Argument #1 ($site) must be of type ApacheSolrForTypo3\Solr\Domain\Site\Site, null given) #4

Open
localhorst opened this issue Nov 29, 2024 · 4 comments

Comments

@localhorst
Copy link

localhorst commented Nov 29, 2024

Hello, we are getting fatal errors on the command line when both these extensions are installed:

apache-solr-for-typo3/solr
werkraummedia/abtest

The error occurs when starting the solr indexing scheduler task from command line. It seems that the FrontendController must not be modified to initalize Solr index service (getInitializedIndexService). The error does not occur if the task is started manually from the backend.

foo@bar-web:/var/www/html$ vendor/bin/typo3 scheduler:run --task=5 

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/html/htdocs/typo3conf/ext/solr/Classes/Task/IndexQueueWorkerTask.php on line 75
thrown in file /var/www/html/htdocs/typo3conf/ext/solr/Classes/Task/IndexQueueWorkerTask.php
in line 207

Unfortunately, no more info about this error was logged. But I was able to determine the culprit with Xdebug.

I created a pull request for this error here.
#3
It works on our machines (DDEV/nginx and Production+Staging on Apache2, both PHP 8.1)

I guess the AB-Test hook is not needed in the CLI anyway.
Probably it can be disabled for the backend as well.

@localhorst localhorst changed the title Fatal error in combination with Solr extension scheduler task (Argument #1 ($site) must be of type ApacheSolrForTypo3\Solr\Domain\Site\Site, null given) Exception in combination with Solr extension scheduler task (Argument #1 ($site) must be of type ApacheSolrForTypo3\Solr\Domain\Site\Site, null given) Nov 29, 2024
@localhorst
Copy link
Author

@svewap @d-s-codappix Hi Daniel & Sven, could you have a look at this?

@svewap
Copy link

svewap commented Jan 27, 2025

@localhorst I'm sorry, but I don't currently have a contract that would allow me to spend the time on this.

@localhorst
Copy link
Author

Thanks anyway. Maybe @koritnik could merge (and test) this?

@DanielSiepmann
Copy link

Thanks @localhorst for pinging me. I'm not watching the repository of our customers.
I've provided feedback within your PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants