Bug #86986
closedCommands out of sync; you can't run this command now - error on TYPO3 backend module of EXT:indexed_search
0%
Description
In the production environment of my TYPO3 8.7 installation I get this error message when I try to open the TYPO3 backend module "Indexing":
Commands out of sync; you can't run this command now Doctrine\DBAL\Driver\Mysqli\MysqliException thrown in file /home/www/html-data/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php in line 280.
The problem seems to be in the loop in vendor/typo3/cms/typo3/sysext/indexed_search/Classes/Domain/Repository/AdministrationRepository.php
in function getRecordsNumbers()
After some research it seems that closeCursor()
is necessary, but I wasn't able to integrate that.
The funny thing is, that the error only occurs in my production environment. On the development machine, everything works fine!
So is this now a TYPO3 bug or a configuration problem of my production machine?
My environment:
- TYPO3 8.7.20
- Production:
-- PHP 7.2.8
-- MySQL 5.6.37
-- mysqlnd 5.0.12-dev
- Development:
-- PHP 7.2.7
-- MySQL 5.5.60
-- mysqlnd 5.0.12-dev
Only difference is that in the development environment pdo_mysql is not present.
Files
Updated by Tobias Schmidt almost 6 years ago
I recently came across this error in a single TYPO3 installation (TYPO3 8.7.10, PHP 7.0.30, MySQL 5.5.54) in two different situations:
- Pasting copied news in the backend
- Querying table tx_news_domain_model_news using QueryBuilder in a custom extension
The error only occurs in one of a dozen almost identical TYPO3 installations. And the error appeared all of a sudden a few weeks ago. Before that the installation was running fine without any problems. Until now I didn't manage to find out what causes this error.
Could it be that this is some kind of database error that has nothing to do with indexed_search or news?
Updated by Stefan Franke almost 6 years ago
- TYPO3 Version changed from 8 to 9
I am experiencing this error when hitting the submit button to start a search in EXT:ke_search (branch "compat9").
TYPO3 9.5.1
PHP 7.2.10
MySQL 5.7.24
Ubuntu 18.04
Updated by Stefan Franke almost 6 years ago
- TYPO3 Version changed from 9 to 8
Oops, sorry, didn't mean to change the TYPO3 version that was initially selected.
Updated by Tobias Schmidt almost 6 years ago
In my case table tx_news_domain_model_news was broken. Reading data worked but writing data sometimes didn't work for unknown reasons. Running mysqlcheck --auto-repair
fixed this problem for me.
Tobias Schmidt wrote:
I recently came across this error in a single TYPO3 installation (TYPO3 8.7.10, PHP 7.0.30, MySQL 5.5.54) in two different situations:
- Pasting copied news in the backend
- Querying table tx_news_domain_model_news using QueryBuilder in a custom extension
Updated by Peter Kraume almost 6 years ago
Thank you Tobias Schmidt! This was the right hint. In my case, the index of index_rel was broken. Deleting the table and rebuilding it fixed the problem for me!
Updated by Tizian Schmidlin about 4 years ago
Could we add this as a general error or troubleshoot for TYPO3 as a whole?
Updated by Česlav Przywara over 3 years ago
I came across the same error message in TYPO3 10. In my case it popped up in BE module of a custom extension and the actual problem was combination of insufficient sort_buffer_size
on MySQL server in production and inefficient SELECT query. After I added one column used in ORDER BY
clause to main index of the table, the problem was gone.
Would still like to know why I got this error in TYPO3 - I only found out about the insufficient sort_buffer_size
when I rerun the problematic query in Adminer.
Updated by Xavier Perseguers over 2 years ago
Found this ticket while googling the MariaDB error I got. In my case this is with EXT:news and a too greedy "starting point expansion". Solution/hack described here: https://github.com/georgringer/news/issues/1734
Updated by Alexander Grein over 2 years ago
Maybe this mariadb bug is the cause of it: https://jira.mariadb.org/browse/MDEV-27937
Updated by Ernesto Baschny over 2 years ago
Same bug appears in direct_mail when showing the "receipient list" for some bigger list (>1000 entries).
Bug of the "in_predicate_conversion" in later MariaDB versions (see https://mariadb.com/kb/en/conversion-of-big-in-predicates-into-subqueries/). Workaround for now is to turn that optimization off for the while in your `my.cnf`:
```
in_predicate_conversion_threshold=0
```
It "only happens in production" is because you are probably running newer MariaDB in production while you are running MySQL (or older MariaDB) in your local dev / docker environment. If you switch to the same MariaDB version as in production you can reproduce the error also locally.
This should be fixed in MariaDB 10.3.35, 10.4.25, 10.4.26, 10.5.16 and 10.7.4 to be released soon(tm).
Updated by Gerrit Hübbers over 2 years ago
I get this error when running the LinkValidator task on our TYPO3 installation (10,000+ pages) when setting the page tree traversal starting point to the root page and selecting a depth of infinite (i.e., link validator has to check more than thousands of pages).
Using
- TYPO3 10.4.27
- Debian 11 bullseye
- mariadb-server 1:10.5.15-0+deb11u1 ( https://packages.debian.org/de/bullseye/mariadb-server-10.5 )
Updated by Georg Ringer over 2 years ago
- Related to Feature #97284: Commands out of sync; you can't run this command now added
Updated by Anonymous over 2 years ago
DB/Connections/Default/initCommands = 'SET in_predicate_conversion_threshold=0;'
Updated by J. Peter M. Schuler over 2 years ago
A hotfix summary for the not-so-tech-savy:
The most common reason for the error commands out of sync
are special MariaDB versions which try to optimize queries with big IN()
clauses. To stop this behaviour a config var needs to be set either in
(1) the MariaDB server config, e.g. my.cnf
inside the category [mysqld]
[mysqld] in_predicate_conversion_threshold=0
(2) or inside TYPO3 conf vars, using the database init commands
DB: Connections: Default: initCommands: 'SET in_predicate_conversion_threshold=0;
Updated by Torben Hansen almost 2 years ago
Just for the records: I had the same problem on a Debian machine after OS upgrade. Setting the suggested in_predicate_conversion_threshold
did not help and I had to clear the contents of affected tables (for my luck only search index data from ext:ke_search). After that, the error did not appear any more.