Project

General

Profile

Actions

Bug #86986

closed

Commands out of sync; you can't run this command now - error on TYPO3 backend module of EXT:indexed_search

Added by Peter Kraume about 4 years ago. Updated 8 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Indexed Search
Target version:
-
Start date:
2018-11-23
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

indexed_search.png (92.4 KB) indexed_search.png Peter Kraume, 2018-11-23 16:05

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Feature #97284: Commands out of sync; you can't run this command nowClosed2022-04-01

Actions
Actions #1

Updated by Tobias Schmidt about 4 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?

MySQL documentation about Commands out of sync error_

Actions #2

Updated by Stefan Franke about 4 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

Actions #3

Updated by Stefan Franke about 4 years ago

  • TYPO3 Version changed from 9 to 8

Oops, sorry, didn't mean to change the TYPO3 version that was initially selected.

Actions #4

Updated by Tobias Schmidt about 4 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
Actions #5

Updated by Peter Kraume about 4 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!

Actions #6

Updated by Mona Muzaffar about 4 years ago

  • Status changed from New to Closed
Actions #7

Updated by Tizian Schmidlin over 2 years ago

Could we add this as a general error or troubleshoot for TYPO3 as a whole?

Actions #8

Updated by Česlav Przywara almost 2 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.

Actions #9

Updated by Xavier Perseguers 11 months 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

Actions #10

Updated by Alexander Grein 10 months ago

Maybe this mariadb bug is the cause of it: https://jira.mariadb.org/browse/MDEV-27937

Actions #11

Updated by Ernesto Baschny 10 months 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).

Actions #12

Updated by Gerrit Hübbers 10 months 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

Actions #13

Updated by Georg Ringer 10 months ago

  • Related to Feature #97284: Commands out of sync; you can't run this command now added
Actions #14

Updated by Anonymous 9 months ago

DB/Connections/Default/initCommands = 'SET in_predicate_conversion_threshold=0;'

Actions #15

Updated by J. Peter M. Schuler 8 months 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;

Actions

Also available in: Atom PDF