Project

General

Profile

Actions

Bug #60737

closed

Symlinks as Document roots are breaking the cache

Added by Frederik Vosberg almost 10 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
Start date:
2014-08-01
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

Description

Hi there,

my hoster uses symlinks to the document root to resolve the domain to the document root.

  1. If there is a host-specific pseudo-DocumentRoot, use it instead of the default one
    RewriteCond %{REQUEST_URI} !^/f?cgi-bin/
    RewriteCond /var/www/virtual/julia/%{HTTP_HOST} -d
    RewriteRule (.*) /var/www/virtual/julia/%{HTTP_HOST}$1
    

That causes errors when trying to load file paths with GeneralUtility::getFileAbsFileName() because the PATH_typo3 constant contains the current document root. (the current domain of this request).

But the cache holds absolute paths to the symlink document root of the request which triggered the caching.

So the getFileAbsFileName returns empty filePaths, because the absolute file paths passed to it didnt start wih the PATH_typo3.

So we have to realpath them before checking.

Im going to push a patch to gerrit, give me a minute it is my first time ;)


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #58288: Cache that write absolute paths needs PATH_site in cache identifierClosed2014-04-28

Actions
Actions #1

Updated by Gerrit Code Review almost 10 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 http://review.typo3.org/31941

Actions #2

Updated by Frederik Vosberg over 9 years ago

Can I do something to help?

Actions #3

Updated by Gerrit Code Review over 9 years ago

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

Actions #4

Updated by Gerrit Code Review over 9 years ago

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

Actions #5

Updated by Gerrit Code Review over 9 years ago

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

Actions #6

Updated by Helmut Hummel over 9 years ago

  • Status changed from Under Review to Needs Feedback

Frederik Vosberg wrote:

That causes errors when trying to load file paths with GeneralUtility::getFileAbsFileName() because the PATH_typo3 constant contains the current document root. (the current domain of this request).

But the cache holds absolute paths to the symlink document root of the request which triggered the caching.

Can you point out which cache entries are written with realpath and describe in which context GeneralUtility::getFileAbsFileName() fails?

Actions #7

Updated by Stefan Froemken over 9 years ago

Hello Helmut,

we have similar problems on our servers. Apache runs on a symlink /www -> /kunden and if you are logged in by SSH "pwd" shows you /kunden.
So, if TYPO3 Cache was deleted and the next call comes from scheduler/CLI the Cacheentries will be created with /kunden.
If you then try to call Login screen of TYPO3 Backend the whole CSS is broken. The path to these files are wrong. To create relative paths the Core removes the amount of letters of PATH_site from the absolute paths in Cache. In our case we have a difference of 2 letters.
After clearing the cache and call BE again it works.

Stefan

Actions #8

Updated by Helmut Hummel over 9 years ago

Stefan Froemken wrote:

we have similar problems on our servers. Apache runs on a symlink /www -> /kunden and if you are logged in by SSH "pwd" shows you /kunden.
So, if TYPO3 Cache was deleted and the next call comes from scheduler/CLI the Cacheentries will be created with /kunden.
If you then try to call Login screen of TYPO3 Backend the whole CSS is broken. The path to these files are wrong. To create relative paths the Core removes the amount of letters of PATH_site from the absolute paths in Cache. In our case we have a difference of 2 letters.

This issue you describe is resolved with https://review.typo3.org/#/c/31565/ and is included since 6.2.5

Actions #9

Updated by Stefan Froemken over 9 years ago

Thank you Helmut for searching this ticket. I just have created a new instance with current master and you're right. It works now.

Actions #10

Updated by Anja Leichsenring over 9 years ago

  • Status changed from Needs Feedback to Resolved

fixed with #58288

Actions #11

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF