Project

General

Profile

Actions

Feature #97284

closed

Commands out of sync; you can't run this command now

Added by Peter Friesen about 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2022-04-01
Due date:
% Done:

0%

Estimated time:
PHP Version:
7.4
Tags:
Complexity:
Sprint Focus:

Description

I was asked to investigate a problem with TYPO3 10.4.26 and the News extension. When saving a new news, this error message appears:

Commands out of sync; you can't run this command now.

It is a website with a lot of news (5000+) in some categories. The error no longer occurs when modifying the news. Only when creating for the first time. A category must be selected, and there must be at least 1000 news in this category.

I investigated the cause a little more closely. This message comes from mariadb database.

The recording of the SQL queries reveals the cause, see below. A statement is built with WHERE IN (...), over 1000 values are entered here. MariaDB 10.3.18 introduced a new parameter called in_predicate_conversion_threshold with a default value of 1000. See: https://mariadb.com/kb/en/server-system-variables/#in_predicate_conversion_threshold

In the case of a statement with more than 1000 values in IN (...), mariadb aborts. This problem will occur for all records and extensions with categories. I suspect that this is where the statement is assembled: typo3/sysext/core/Classes/Database/RelationHandler.php

This is not a bug in TYPO3 and News extension. This is a limit of the mariadb database. With root servers you can increase the value in mariadb. But as a customer of a web host, you don't have the option. I would be happy if the TYPO3 developers optimize or split the SQL statement.

Thank you!

Connect user@localhost as anonymous on typo3db
Prepare INSERT INTO `tx_news_domain_model_news` (SNIP)
Execute INSERT INTO `tx_news_domain_model_news` (SNIP)
Close stmt
Prepare SELECT * FROM `tx_news_domain_model_news` WHERE `uid` = ?
Execute SELECT * FROM `tx_news_domain_model_news` WHERE `uid` = 5455
Close stmt
SNIP
Prepare SELECT * FROM `sys_category_record_mm` WHERE `uid_local` = ? ORDER BY `sorting` ASC, `uid_foreign` ASC
Execute SELECT * FROM `sys_category_record_mm` WHERE `uid_local` = 9 ORDER BY `sorting` ASC, `uid_foreign` ASC
Close stmt
Prepare SELECT `uid`, `t3ver_oid`, `t3ver_state` FROM `tx_news_domain_model_news` WHERE (`t3ver_oid` IN (?, ?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, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)) AND (`t3ver_wsid` <> ?) ORDER BY `t3ver_state` DESC
Close stmt

Core: Exception handler (WEB): Uncaught TYPO3 Exception: Commands out of sync; you can't run this command now | Doctrine\DBAL\Driver\Mysqli\MysqliException thrown in file /www/htdocs/typo3_src-10.4.26/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php in line 335.

Also see #86986 and https://github.com/georgringer/news/issues/1734


Files

Screenshot_002.png (70.5 KB) Screenshot_002.png Peter Friesen, 2022-04-01 19:15

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #86986: Commands out of sync; you can't run this command now - error on TYPO3 backend module of EXT:indexed_searchClosed2018-11-23

Actions
Actions #1

Updated by Peter Friesen about 2 years ago

  • Tracker changed from Bug to Feature
  • TYPO3 Version deleted (10)
Actions #2

Updated by Georg Ringer about 2 years ago

  • Related to Bug #86986: Commands out of sync; you can't run this command now - error on TYPO3 backend module of EXT:indexed_search added
Actions #3

Updated by Georg Ringer about 2 years ago

  • Status changed from New to Closed

I am closing this as this is more an issue of configuration of mariadb

Actions

Also available in: Atom PDF