TYPO3-Solr / ext-solr

A TYPO3 extension that integrates the Apache Solr search server with TYPO3 CMS. dkd Internet Service GmbH is developing the extension. Community contributions are welcome. See CONTRIBUTING.md for details.
GNU General Public License v3.0
137 stars 252 forks source link

[BUG] Deleting or disabling a content element may throw an exception #4203

Open pduersteler opened 3 weeks ago

pduersteler commented 3 weeks ago

Describe the bug When I want to delete a content element on a page, an exception is being thrown. This does not happen on every page or content element, but when it happens, the error is reproducable on that very element multiple times.

Hiding an element still works even though there is an exception. Deleting an element does not work. It may also affect the Solr backend modules when visiting them after an exception has been thrown.

To Reproduce I'm already sorry for the vague bug report, as I can't really provide a bullet-proof way of reproducing it.

Steps to (sometimes) reproduce the behavior:

  1. Create a content element on a page (in our case, a content block from v13)
  2. Click either on "hide" or "delete" in the page view
  3. See error

Expected behavior The element is either disabled or deleted, based on the request.

Screenshots Not applicable

Used versions (please complete the following information):

Additional context While fetching the version information for this bug report, I found out that, as soon as the error appeared, every Solr backend module throws the same error. Before that, I was able to access the "index queue" module to clear the index in order to test if the index has a relevance in this.

The top error is:

An exception occurred while executing a query: You have an error in your SQL syntax;
check the manual that corresponds to your MariaDB server version for the right syntax
to use near ') `pidlist` ON (`sys_template`.`pid` = `pidlist`.`uid`) WHERE ((`sys_template...'
at line 1

further down the line, it appears to originate from the following lines (in order of appearance in the exception trace).

at TYPO3\CMS\Core\TypoScript\IncludeTree\SysTemplateRepository->getSysTemplateRowsByRootline(array(), object(TYPO3\CMS\Core\Http\ServerRequest))
in vendor/apache-solr-for-typo3/solr/Classes/System/Configuration/ConfigurationManager.php line 187

at ApacheSolrForTypo3\Solr\System\Configuration\ConfigurationManager->getSysTemplateRowsForAssociatedContextPageId(object(TYPO3\CMS\Core\Http\ServerRequest))
in vendor/apache-solr-for-typo3/solr/Classes/System/Configuration/ConfigurationManager.php line 121

at ApacheSolrForTypo3\Solr\System\Configuration\ConfigurationManager->getCoreTypoScriptFrontendByRequest(object(TYPO3\CMS\Core\Http\ServerRequest))
in vendor/apache-solr-for-typo3/solr/Classes/System/Configuration/ConfigurationManager.php line 69

at ApacheSolrForTypo3\Solr\System\Configuration\ConfigurationManager->getTypoScriptFromRequest(object(TYPO3\CMS\Core\Http\ServerRequest))
in vendor/apache-solr-for-typo3/solr/Classes/System/Configuration/ConfigurationManager.php line 96

at ApacheSolrForTypo3\Solr\System\Configuration\ConfigurationManager->getTypoScriptConfiguration()
in vendor/apache-solr-for-typo3/solr/Classes/Util.php line 104

at ApacheSolrForTypo3\Solr\Util::getSolrConfiguration()
in vendor/apache-solr-for-typo3/solr/Classes/System/Solr/SolrConnection.php line 100

[...]

at ApacheSolrForTypo3\Solr\ConnectionManager->getConnectionsBySite(object(ApacheSolrForTypo3\Solr\Domain\Site\Site))
in vendor/apache-solr-for-typo3/solr/Classes/Domain/Index/Queue/GarbageRemover/AbstractStrategy.php line 110

at ApacheSolrForTypo3\Solr\Domain\Index\Queue\GarbageRemover\AbstractStrategy->deleteIndexDocuments('pages', 54)
in vendor/apache-solr-for-typo3/solr/Classes/Domain/Index/Queue/GarbageRemover/AbstractStrategy.php line 81

at ApacheSolrForTypo3\Solr\Domain\Index\Queue\GarbageRemover\AbstractStrategy->deleteInSolrAndUpdateIndexQueue('pages', 54)
in vendor/apache-solr-for-typo3/solr/Classes/Domain/Index/Queue/GarbageRemover/PageStrategy.php line 55

The trace obviously changes down the line in the cases of "backend module visit", "record disable", and "record delete", where the error might occur.

dkd-kaehm commented 2 weeks ago

@pduersteler I can reproduce this issue on TYPO3 13.4.0, but not on 13.4.x-dev. It seems to be related on #4208 and https://forge.typo3.org/issues/10554. But this issue is still not solved because the garbage collector is interrupted by the original cause of this.