Issue Bug Resolved

#107785RedisBackend: missing error handling in Redis method calls

Rico Sonntag 10/20/25, 08:17 updated 09/16/26, 19:45

Description

In TYPO3 v13 (v13.4.19), I just encountered the following error:

503
Oops, an error occurred!

array_diff(): Argument #1 ($array) must be of type array, false given

The backend log showed:

Core: Exception handler (WEB): Uncaught TYPO3 Exception: array_diff(): Argument #1 ($array) must be of type array, false given | TypeError thrown in file /var/www/vol_typo3/releases/55/vendor/typo3/cms-core/Classes/Cache/Backend/RedisBackend.php in line 547

(!) The $this->redis->… calls are missing error handling or a helpful return of the specific Redis error ($this->redis->getLastError()). Only after manually adding debug output did I see the actual error:

NOPERM this user has no permissions to run the 'sunion' command

A permission error in the Redis user being used.

Reviews 4

History 321

  1. Rico Sonntag commented <span data-processor="relativetime" data-value="2026-02-26T12:40:07+00:00" > 02/26/26, 12:40 </span>

    The patch adds error handling to all Redis commands in RedisBackend that can return false on failure (sMembers(), keys(), sUnion()). Each failure is logged as a warning with the Redis error from getLastError(), and the method returns early or uses an empty array as fallback. Includes 9 unit tests.

  2. Rico Sonntag commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-09-16T13:30:10+00:00" > 09/16/26, 13:30 </span>

    Applied in changeset commit:7bcbc79869f2b2b3812d5f6b5131f6dc429fe395.

  3. Gerrit Code Review pushed patch set 3 for 14.3 to change 95876 status Resolved Under Review <span data-processor="relativetime" data-value="2026-09-16T13:55:38+00:00" > 09/16/26, 13:55 </span>

  4. Rico Sonntag commented and changed status Under Review Resolved <span data-processor="relativetime" data-value="2026-09-16T19:45:11+00:00" > 09/16/26, 19:45 </span>

    Applied in changeset commit:05c92341977fdf7c0db62f4ab1dd7033e12cfa13.