Issue Bug Closed

#105433Cache identifier built by GreedyDatabaseBackend too long, causes exception

Thomas Prangenberg 10/24/24, 09:46 updated 12/02/25, 14:32

Description

In TYPO3 13.4, GreedyDatabaseBackend builds a cache identifier based on a multitude of context properties. In addition to other things it adds all user group IDs of the current user imploded by an underscore.

This causes an exception if a user has more user groups assigned than the cache frontend can handle, due to the cache identifier exceeding the allowed length of 250 characters:

(1/1) #1233058486 InvalidArgumentException

"greedy_database_backend_sys_category-c81e728d9d4c2f636f067f89cc14862c-0-0-includeFloating-b2cc891e71394a0a49ed6afb55ef7905-0000-1729761340-0_-2_5650_5680_5687_5688_5692_5693_5707_5723_5736_5756_5757_5758_5759_5760_5761_5792_5793_5794_5797_5824_5828_5836_5837_5838_5839_5840_5841_5842_5980" is not a valid cache entry identifier.

in /var/www/html/vendor/typo3/cms-core/Classes/Cache/Frontend/AbstractFrontend.php line 85

Hashing the imploded string in https://github.com/TYPO3/typo3/blob/main/typo3/sysext/core/Classes/Domain/Persistence/GreedyDatabaseBackend.php#L159 works as a workaround, though I’m not entirely sure if that is enough to prevent the problem since putting all of the cache id parts together could in theory still exceed the allowed length (it’s highly variable). Maybe the entire result should be hashed before returning the cache id.

The issue can for example be reproduced by installing friendsoftypo3/content-blocks or any other usage of TYPO3\CMS\Core\Collection\LazyRecordCollection and assigning a very large number of user groups to a frontend user.

Reviews 2

History 24

  1. Anonymous commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2024-10-24T11:35:08+00:00" > 10/24/24, 11:35 </span>

    Applied in changeset commit:9f018421661b3b0b15c4e4cf4dc701de87b1d905.