Welcome Guest, Not a member yet? Register   Sign In
Session error: "Query error: Commands out of sync; you can't run this command now..."
#1

Hello everyone
I face an issue with database session.
The site was working fine on PHP 7.2 (Codeigniter 3.1.9) for a long time. As PHP 7.2 is deprecated the hosting updated to PHP 7.4 and then in the logs I periodically started to get something like:


Code:
Query error: Commands out of sync; you can't run this command now - Invalid query: INSERT INTO `ci_sessions` (`id`, `ip_address`, `timestamp`, `data`) VALUES ('fb7eec234234234234345634639f089b06ff70b', 'X.X.X.X', 1630386492, '__ci_last_regenerate|i:1630386492;user|s:20:\"20657889564c\";')
Query error: Commands out of sync; you can't run this command now - Invalid query: SELECT RELEASE_LOCK('868db8ea6235235edrgydrfg6b5d33ea77') AS ci_session_lock



The error is always represented with 2 rows, and the first row is either insert into ci_sessions table, or update. The second row is always about release lock.

I tried to update to the latest Codeigniter 3.1.11 and the same error is still there.

After reading on the forums, the issue arise when stored procedure is used, or there are several queries comma-separated in the same db->query() request. However, we don't use stored procedures and the queries are always just one query at a time.
Is there any hint what can be done? Or how to further debug it? The main problem is that this issue repeats very rarely and I cannot replicate it on the local machine (e.g. there are thousands of users on the website per day and I see this error 2-3 times per day at different times).
Reply


Messages In This Thread
Session error: "Query error: Commands out of sync; you can't run this command now..." - by Volder - 08-31-2021, 05:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB