Project

General

Profile

Actions

Bug #53215

closed

Rename symlink of typo3_src results in fatal error

Added by Stefan Froemken over 10 years ago. Updated over 5 years ago.

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

0%

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

Description

Hello Core-Team,

in all previous TYPO3-Installations you can change typo3_src to another location without any problems. But here in current GIT-Version (30.10.2013) I get following fatal error when doing so:

Warning: require(/kunden/removedPath/typo3_src-6.2.0-2013-10-22/typo3/sysext/core/Resources/PHP/TYPO3.Flow/Classes/TYPO3/Flow/Package/PackageManager.php) [function.require]: failed to open stream: No such file or directory in /kunden/removedPath/typo3temp/Cache/Code/cache_classes/typo3_flow_package_packagemanager.php on line 1

Fatal error: require() [function.require]: Failed opening required '/kunden/removedPath/typo3_src-6.2.0-2013-10-22/typo3/sysext/core/Resources/PHP/TYPO3.Flow/Classes/TYPO3/Flow/Package/PackageManager.php' (include_path='/www/removedPath/typo3/contrib/pear/:.:/usr/local/lib/php') in /kunden/removedPath/typo3temp/Cache/Code/cache_classes/typo3_flow_package_packagemanager.php on line 1

As you can see some files in cache_classes refer to an old path. The new path is: typo3_src-6.2.0-2013-10-30

Please create these paths with symlink and not with path behind symlink.

Stefan


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #61317: PackageManager caches absolute paths for different PATH_siteClosed2014-09-02

Actions
Actions #1

Updated by Stefan Froemken over 10 years ago

I can't access Installtool. I thought Installtool can run self-sufficient?! So there is no possibility to clear the cache.
The error appears in cache_classes. So I have make: rm -rf ./cache_classes
Now following error appears:

Warning: require_once(/kunden/removedPath/typo3_src-6.2.0-2013-10-22/typo3/sysext/core/Classes/Package.php) [function.require-once]: failed to open stream: No such file or directory in /kunden/removedPath/typo3_src-6.2.0-2013-10-30/typo3/sysext/core/Classes/Package/PackageManager.php on line 223

Fatal error: require_once() [function.require]: Failed opening required '/kunden/removedPath/typo3_src-6.2.0-2013-10-22/typo3/sysext/core/Classes/Package.php' (include_path='/www/removedPath/typo3/contrib/pear/:.:/usr/local/lib/php') in /kunden/removedPath/typo3_src-6.2.0-2013-10-30/typo3/sysext/core/Classes/Package/PackageManager.php on line 223

Actions #2

Updated by Stefan Froemken over 10 years ago

OK...after rm -rf ./cache_core too, Installtool works again.

But please: Try to work with correct paths.

Actions #3

Updated by Tomita Militaru over 10 years ago

After any upgrade of the TYPO3 core (aka change typo3_src) you need to clear the cache.

Actions #4

Updated by Wouter Wolters over 10 years ago

Then I suggest to do a clear all cache (whichh is available in Install Tool) after the switch of the symlink.

Actions #5

Updated by Stefan Froemken over 10 years ago

Hello,

as I told you, I have to clear the cache manually on filesystem first, before I can access the installtool. There is no possibility to access Installtool after changing the symlink.
The second question is: Why are you working with resolved path of symlink (typo3_src-6.2.0-beta) and not with symlink (typo3_src) itself?

Stefan

Actions #6

Updated by Jörg Wagner almost 10 years ago

This problem is alive and kicking in 6.2.3.
It has driven us nuts for about one week.
On a hosting webspace with no visible error reporting and no access to the PHP error log, FE and BE simply returned blank white pages with no clue what was going wrong.
Now we found out that this was due to the cache files that were copied with the project and that tried to access absolute paths of the local development system.

Most definitely Stefan is right with his complaints:
When a devel system is copied to a production system and the resulting installation locks you out and leaves you completely helpless, there is a rational for an improvement of the code logic.

Only after finding and reading this report we realized that we had to clear /typo3temp/Cache/ to get the system working again.

Actions #7

Updated by Patrick Crausaz over 9 years ago

I got the same error while installing 6.2.5

What I did:
1. Downloaded the current source and unzip.
2. Created Symlink index.php and typo3 to the target "typo3_src-6.2.5
3. Created File "FIRST_INSTALL" in Root
4. Opened the website in the Browser
5. Here it shows up a warning: Symlink to wrong target
6. Move the typo3_src-6.2.5 directory to "typo3_src" and changing the symlink targets to typo3_src instead of typo3_src-6.2.5
7. Reload the website in the browser ->> ERROR: require_once uses old symlink target

- There is no typo3temp/Cache created at this point. SO there aren't any cached files that could be deleted. 
- There is no Install-Tool at this point of installation
- Tried to clear Cookies, Session Cookies. Browser Cache. Nothing worked

Error occures in "typo3/sysext/core/Classes/Core/ClassLoader.php" on Line 182
require_once $classLoadingInformation0;

Actions #8

Updated by Markus Klein over 9 years ago

The correct structure should be:

  • typo3_src-6.2.5 folder as downloaded
  • typo3_src symlink to typo3_src-6.2.5
  • typo3 symlink to typo3_src/typo3
  • index.php symlink to typo3_src/index.php
Actions #9

Updated by Patrick Crausaz over 9 years ago

@ Markus Klein
Yes, thats correct. But thats no justification that the system breaks when the symlink were different. Not everybody will use the links that way, only because it's suggested to do so.
And the error still occures, also with this configuration.

I'm not quite sure if this is a TYPO3 issue or a PHP issue. When I debug the given path that is used for require_once, all paths seems to be correct.
Or related to Apache? I also found some PHP related issues while googling about that. Keywords: "Changing symlinks require_one"

Actions #10

Updated by Markus Klein over 9 years ago

@Patrick Broens: Did you think about opcode caches? Maybe you're running opcache, then you need to clear that cache too if you change the symlinks. That's a PHP issue.

Actions #11

Updated by Markus Klein over 9 years ago

  • Target version deleted (6.2.0)
Actions #12

Updated by Patrick Crausaz over 9 years ago

@Markus
I just tried to change symlinks in one project and cleared the opcode cache with the clear button within the Install Tool.

The website is running yet. It took about 5 minutes and probably 60 refreshes of the page in the browser.

what I did:

1. changed symlinks index.php and typo3 to a new target.
2. same php fatal error appears: require_once failed to open steam... in ClassLoader.php // Frontend and Backend and Install Tool; same error
3. Refresh the website // same error, but the file that should be loaded has changed (file to be loaded in require_once(...file...))
4. Refreshed the page (of the install tool) several times, PHP throws always the same error but always with another Class to load in the ClassLoader.
5. I assumed that the ClassLoader had to pass though all the classes/files by refreshing the page. Finally after about 20 refreshes the Install Tool appeared and it was possible to access the Clear Cache button.
6. Cleared Cache and opcode cache within the Install Tool.
7. Again refreshing the Install Tool and the Frontend about 50 times. (you can see that it's working as long as the Error always changes)
- sometimes the page loades, and one refresh later another error comes up. Just clicking trough the page for 5 minutes until all errors are gone.

BE, FE and Install Tool now working.

Would it be helpful, if we did a try and catch on the require_once function in that ClassLoader.php ? When the file cannot be loaded, try the next.
Try to open file, when it's not working, try the next. And when all files were passes through, there should be an exception thrown.
That way you don't have to refresh the page a hundred times and the user has a clue about what is happening when he gets the exception.

Actions #13

Updated by Markus Klein over 9 years ago

Well, you have to clear the opcode cache on the command line (or restart the webserver) once you change the symlinks of course the Install Tool won't work either.
Anything you add to the ClassLoader slows down TYPO3 extremely, hence it should be optimized for the common case, which a symlink change clearly is not.

Actions #14

Updated by Patrick Crausaz over 9 years ago

Agreed.
So at least it would be nice to have an official documentation / tutorial in the wiki for that case. Because it wasn't easy to figure out what the actual problem was and I see there are a few guys with that issue.

Actions #15

Updated by Markus Klein over 9 years ago

Maybe you can add this information there: http://wiki.typo3.org/Opcode_Cache

Actions #16

Updated by Urs Braem over 9 years ago

I've been experiencing similar behaviour upon upgrading from TYPO3 6.2.5 to 6.2.6

Line 182 in sysext/core/Classes/Core/ClassLoader.php was requiring the old version of the core (6.2.5) which resulted in a php error.

Warning: require_once(/home/username/typo3_src-6.2.5/typo3/sysext/core/Resources/PHP/TYPO3.Flow/Classes/TYPO3/Flow/Package/PackageManager.php): failed to open stream: No such file or directory in /home/username/typo3_src-6.2.6/typo3/sysext/core/Classes/Core/ClassLoader.php on line 182

Fatal error: require_once(): Failed opening required '/home/username/typo3_src-6.2.5/typo3/sysext/core/Resources/PHP/TYPO3.Flow/Classes/TYPO3/Flow/Package/PackageManager.php' (include_path='/home/username/public_html/upgrade/typo3/contrib/pear/:.:/opt/alt/php55/usr/share/pear:/opt/alt/php55/usr/share/php') in /home/username/typo3_src-6.2.6/typo3/sysext/core/Classes/Core/ClassLoader.php on line 182

I cleared the cache manually (rm -r typo3temp/*) and also had to remove and recreate the symlink to the core. Then I could log in again.
BUT a day later, the error was there again. I cleared the cache again, now also in the install tool. This helped.

Above, Tomita Militaru says:

After any upgrade of the TYPO3 core (aka change typo3_src) you need to clear the cache.

Can that be? In 4.5, I've never needed to do this for minor upDATEs. And we're not talking about major upgrades here.

Actions #17

Updated by Peter Buzanits over 9 years ago

I ran into the same issue while migrating a 6.2.6 site to a different server. The old paths are in the cache and the cache cannot be deleted because install tool and backend are not reachable.

What is the correct way to migrate a 6.2 installation to a different server?

Actions #18

Updated by Markus Klein over 9 years ago

Do not transfer the typo3temp folder. This is a local folder; you do not even need to backup it.

Actions #19

Updated by Thomas Mammitzsch about 9 years ago

with php-fpm you might need to restart the service, after removing typo3temp/Cache/*. At least that worked for me.

Actions #20

Updated by Helmut Hummel almost 9 years ago

  • Status changed from New to Resolved

This is an opcode cache/ webserver issue, we cannot resolve within TYPO3. However we greatly mitigate the troubles by integrating composer class loading (partly as well in 6.2), so the issues described here will not occur

Actions #21

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF