Bug #84070

Epic #83652: EXT: Redirects module - Umbrella issue

RedirectCacheService does not fallback gracefully if caching backend fails

Added by Sybille Peters over 2 years ago. Updated about 2 years ago.

Should have
Backend API
Target version:
Start date:
Due date:
% Done:


TYPO3 Version:
PHP Version:
Is Regression:
Sprint Focus:


Tested with 9.2.0-dev (current master).

If the configured caching backend (e.g. redis) fails because of a misconfiguration or downtime, TYPO3 falls back very nicely to non cached entries.

However the RedirectCacheService throws an exception in this case:

Core: Exception handler (WEB): Uncaught TYPO3 Exception: 
Return value of TYPO3\CMS\Redirects\Service\RedirectCacheService::getRedirects() must be of the type array, boolean returned 
| TypeError thrown in file 
/<webroot>/typo3/sysext/redirects/Classes/Service/RedirectCacheService.php in line 60. 
Requested URL: http://localhost/index.php?id=1


Steps to reproduce

  1. Initial installation with "introduction package" (or without, in this case create a new page with standard root template)
  2. Configure Redis as Caching backend (see configuration snippet below)
  3. cause redis backend to fail by stopping the redis service, e.g. service stop redis
  4. (while not logged in in backend): Load frontend pages, e.g. "Get Started" page id=1


Oops Error / Exception gets thrown.


Test without redirect:

  1. deinstall "redirect" extension. There will be no more exceptions, even though redis still isn't available

Basic Cache Configuration:





function setCacheConfigurationRedis($database=false, $names = [
    ] )

    if (!$database) {

    foreach($names as $name) {
        $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$name]['backend'] = \TYPO3\CMS\Core\Cache\Backend\RedisBackend::class;
        $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$name]['options']['database'] = $database;
        // problem with gzuncompress + php-redis
        $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$name]['options']['compression'] = false;


oops.png View (16.4 KB) Sybille Peters, 2018-02-27 18:01

Associated revisions

Revision 43cda8c4 (diff)
Added by Andreas Fernandez over 2 years ago

[BUGFIX] Let RedirectCacheService not rely on having redirects cached

RedirectCacheService::getRedirects() relies on having the redirects
cached. This assumption may lead to issues (e.g. in case a Redis server
fails), causing TypeErrors.

The code is changed to return the composed array in case the initial
cache request misses.

Resolves: #84070
Releases: master
Change-Id: I148db9ccbf28a2f93761fbf4b2cb632e27787b2d
Reviewed-on: https://review.typo3.org/56050
Tested-by: TYPO3com <>
Reviewed-by: Benjamin Franzke <>
Tested-by: Benjamin Franzke <>
Reviewed-by: Mathias Schreiber <>
Tested-by: Mathias Schreiber <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>


#1 Updated by Sybille Peters over 2 years ago

  • Description updated (diff)

#2 Updated by Susanne Moog over 2 years ago

  • Parent task set to #83652

#3 Updated by Gerrit Code Review over 2 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56050

#4 Updated by Andreas Fernandez over 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#5 Updated by Benni Mack about 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF