Project

General

Profile

Actions

Bug #52768

closed

Uncaught TYPO3 Exception "uid1_uid2-uid3,uid1-uid4_0_0_0" is not a valid cache entry identifier in standard sitemap element when pagetree has nested mountpoints

Added by Christian Reiter over 10 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Pagetree
Target version:
-
Start date:
2013-10-13
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.1
PHP Version:
5.3
Tags:
exception_handling
Complexity:
Is Regression:
No
Sprint Focus:

Description

A project has a pagetree with nested mountpoints (structure detailed below).

The structure can be navigated through the nested mountpoints without problems (Typolinks generated in MENU Objects are generated correctly and load the correct content when followed - realURL is used).

In TYPO3 4.7.15, a Sitemap of this page tree was rendered correctly.
In TYPO3 6.0.10 and 6.1.5, usage of the Sitemap content element throws an uncaught exception.

By choosing a starting point for the sitemap in 6.1.5 it could be shown that trying to create a sitemap of a single page which mounts another page, that in turn contains mountpoints in its children, creates the exception.

Since nested mountpoints work for the navigation, and also worked in the default Sitemap element in 4.7.15 this behaviour seems unexpected.

The page structure is as follows

[39]
[147] - Page 1
[145] - Page 1b
...
..
[33] - Page 2, is a collection of many mount points to other pages
[430] - Page 4: MOUNTS Page 1(147)
[440] - Page 4b: MOUNTS Page 1b(145)
...
[29]
...
[245] - Page 3: MOUNTS Page 2(33) with all mount points it includes

Loading the sitemap page then breaks with

#1233058294: "147_33-245,147-430_0_0_0" is not a valid cache entry identifier.
InvalidArgumentException thrown in file
C:\...\typo3_src\6.1\typo3\sysext\core\Classes\Cache\Frontend\VariableFrontend.php


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #80970: [HMENU][Introduction package] Parallel mount points don't workClosed2017-04-23

Actions
Actions #1

Updated by Christian Reiter over 10 years ago

A closer look shows:

  • Mountpoint situation creates an identifier with a comma
  • const PATTERN_ENTRYIDENTIFIER = '/^[a-zA-Z0-9_%\\-&,]{1,250}$/'; does not allow this (TYPO3\CMS\Core\Cache\Frontend\FrontendInterface)
  • That causes the exception in TYPO3\CMS\Core\Cache\Frontend\VariableFrontend
  • This is used from TYPO3\CMS\Core\Utility\RootlineUtility->get
  • That is called from RealURL - $rootLine = $this->sysPage->getRootLine($id, $mpvar);

In TYPO3 4.7.15 PATTERN_ENTRYIDENTIFIER is the same but when RealURL gets a rootline, that is done by t3lib_pageSelect::getRootLine which is built very differently and doesn't cause that exception.

Actions #2

Updated by Christian Hellmuth over 9 years ago

+1:

I am experiencing the behavior mentioned above on a large TYPO3 installation (6.1.11). Mount points are being used and errors occur when they're nested.

Actions #3

Updated by Christian Reiter over 9 years ago

Christian Hellmuth wrote:

+1:

I am experiencing the behavior mentioned above on a large TYPO3 installation (6.1.11). Mount points are being used and errors occur when they're nested.

As a dirty workaround you can try changing the definition for PATTERN_ENTRYIDENTIFIER to allow a comma.

Actions #4

Updated by Christian Hellmuth over 9 years ago

Thanks Christian. As I am not much of a PHP coder could you perhaps give me a hint where to change that? Or even better, would you happen to have a patch file for that?

Actions #5

Updated by Christian Reiter over 9 years ago

Hi,

this is a dirty core hack.
In your TYPO3 source browse to typo3\sysext\core\Classes\Cache\Frontend\FrontendInterface.php
There look for about line 48
Overwrite

const PATTERN_ENTRYIDENTIFIER = '/^[a-zA-Z0-9_%\\-&]{1,250}$/';

with

const PATTERN_ENTRYIDENTIFIER = '/^[a-zA-Z0-9_%\\-&,]{1,250}$/';

this adds a comma and allows cache identifiers with a comma.
Everything that is used as an identifier and doesn't match this pattern throws ' not a valid cache entry identifier.'
After changing the file, clear the cache and make sure@ \typo3temp\Cache\Code@ is empty, and load the page that as affected by the error.

In my case this worked around the problem.
As for side effects, I can't say whether allowing cache identifiers with commas can have any unexpected results.

If it works: Of course as a core hack this will disappear if you replace the source with a new one. So you always have to remember to repeat it.
You can workaround this by using the code from git and having this as a local change, instead of downloading tarballs and replacing them.

Actions #6

Updated by Christian Hellmuth over 9 years ago

Thanks for your detailed explanation.

I think this is an issue that still deserves its fix. Mount points are a pretty common use case, especially on larger websites. And as nesting of mount points is possible and realurl one of the most widely used community extensions, a self-proclaimed enterprise CMS should not fail at this point.

By the way: Will this error still occur in 6.2 LTS or is it fixed there? Any info on that?

Actions #7

Updated by Christian Reiter over 9 years ago

Could you please test and confirm (or not) whether the fix described above works for your case?

I have seen the same problem with 6.2 LTS.
I also know that collaborating teams have encountered the PATTERN_ENTRYIDENTIFIER problem and fix on their own.
In 6.2.5 you will find the same definition at line 35 of typo3\sysext\core\Classes\Cache\Frontend\FrontendInterface.php and the same fix still works experimentally.

The problem is that the PATTERN_ENTRYIDENTIFIER is a very basic definition which as far as I know is backported from the TYPO3 FLOW framework.

So it isn't going to be changed "just like that" but perhaps core developers will take a look at it if awareness rises that it is a problem "in the wild".
I didn't get any response on asking about this issue on the newsgroup a year ago.
Perhaps you can try posting again with reference to this bug report.

Actions #8

Updated by Christian Hellmuth over 9 years ago

Okay, so I just applied the fix you suggested and it solves the described problem. The error does not occur any longer.
I cannot tell about possible side effects just yet. That will require some more testing.

Actions #9

Updated by Riccardo De Contardi almost 9 years ago

  • Status changed from New to Needs Feedback

Could this be closed?

Actions #10

Updated by Christian Reiter almost 9 years ago

This is an open issue that affects the current LTS.

Page trees that used to work with 4.5 or 4.7, and employ permitted TYPO3 Core functionality, throw an exception in the frontend with current LTS.

Also navigations and sitemaps rendered for those trees throw exceptions.

While many users don't care too much about Mount Points it is an issue encountered "in the wild" and should IMHO be acknowledged as a bug.

Actions #11

Updated by Markus Klein almost 9 years ago

  • Category set to Pagetree
  • Status changed from Needs Feedback to Accepted
Actions #12

Updated by Elmar Hinz about 7 years ago

  • Related to Bug #80970: [HMENU][Introduction package] Parallel mount points don't work added
Actions #13

Updated by Sybille Peters over 5 years ago

  • Tags set to exception_handling
Actions #14

Updated by Benni Mack over 4 years ago

  • Status changed from Accepted to Closed

We've tested this in TYPO3 v8, v9 and v10 and this error does not occur anymore. If it is still the case, please let us know and I will re-open this issue.

Actions

Also available in: Atom PDF