Bug #53215

Rename symlink of typo3_src results in fatal error

Added by Stefan Froemken over 7 years ago. Updated over 2 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

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

Actions
#1

Updated by Stefan Froemken over 7 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

#2

Updated by Stefan Froemken over 7 years ago

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

But please: Try to work with correct paths.

#3

Updated by Tomita Militaru over 7 years ago

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

#4

Updated by Wouter Wolters over 7 years ago

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

#5

Updated by Stefan Froemken over 7 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

#6

Updated by Jörg Wagner almost 7 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.

#7

Updated by Patrick Crausaz over 6 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;

#8

Updated by Markus Klein over 6 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
#9

Updated by Patrick Crausaz over 6 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"

#10

Updated by Markus Klein over 6 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.

#11

Updated by Markus Klein over 6 years ago

  • Target version deleted (6.2.0)
#12

Updated by Patrick Crausaz over 6 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.

#13

Updated by Markus Klein over 6 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.

#14

Updated by Patrick Crausaz over 6 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.

#15

Updated by Markus Klein over 6 years ago

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

#16

Updated by Urs Braem over 6 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.

#17

Updated by Peter Buzanits over 6 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?

#18

Updated by Markus Klein over 6 years ago

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

#19

Updated by Thomas Mammitzsch over 6 years ago

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

#20

Updated by Helmut Hummel almost 6 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

#21

Updated by Benni Mack over 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF