Project

General

Profile

Actions

Bug #57723

closed

PackageStates.php may cannot be written due to invalid path

Added by Andreas Fernandez over 10 years ago. Updated almost 10 years ago.

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

0%

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

Description

Hi there,

I tried to do a fresh install of TYPO3 6.2, but it failed in the second step due to following error:

Uncaught exception 'TYPO3\CMS\Core\Package\Exception\PackageStatesUnavailableException' with message 'The PackageStates.php file is either corrupt or unavailable.' in typo3_sources/typo3_src-6.2.0/typo3/sysext/core/Classes/Package/PackageManager.php:283

Stack trace:
#0 typo3_sources/typo3_src-6.2.0/typo3/sysext/core/Classes/Package/PackageManager.php(130): TYPO3\CMS\Core\Package\PackageManager->loadPackageStates()
#1 typo3_src-6.2.0/typo3/sysext/core/Classes/Core/Bootstrap.php(322): TYPO3\CMS\Core\Package\PackageManager->initialize(Object(TYPO3\CMS\Core\Core\Bootstrap))
#2 typo3_sources/typo3_src-6.2.0/typo3/sysext/core/Classes/Core/Bootstrap.php(288): TYPO3\CMS\Core\Core\Bootstrap->initializePackageManagement('TYPO3\CMS\Core\...')
#3 typo3_sources/typo3_src-6.2.0/typo3/sysext/install/Classes/Service/ClearCacheService.php(64): TYPO3\CMS\Core\Core\Bootstrap->reinitializeCla in typo3_sources/typo3_src-6.2.0/typo3/sysext/core/Classes/Package/PackageManager.php on line 283

After digging around I found out that the PackageStates.php is tried to be written into /var/www/virtual/XXXX/html/typo3conf/../../typo3conf/PackageStates.php. This obviously fails because the path would be resolved to /var/www/virtual/XXXX/typo3conf which is outside the DocumentRoot.

My symlinks are configured like this:

index.php -> typo3_src/index.php
typo3 -> typo3_src/typo3
typo3_src -> ../typo3_sources/typo3_src-6.2.0

Symlinking typo3conf in my DocumentRoot workarounds the problem:

/var/www/virtual/XXXX/typo3conf -> /var/www/virtual/XXXX/html/typo3conf

My TYPO3 is hosted at https://uberspace.de, a shared hosting platform. The provider uses CentOS, php-fcgi and Apache with suEXEC.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #57601: Upgrading 6.2: PHP Fatal error: Uncaught exception 'TYPO3\\Flow\\Package\\Exception\\PackageStatesFileNotWritableExceptionClosed2014-04-03

Actions
Actions #1

Updated by Markus Klein over 10 years ago

  • Status changed from New to Needs Feedback

I tried to reproduce this with an identical folder hierarchy, but everything is working like expected.
Seems to be an issue with server configuration somehow.

The path to the PackageStates.php file is built like this:
$this->packageStatesPathAndFilename = PATH_typo3conf . 'PackageStates.php';

So PATH_typo3conf is wrong in your case, which depends on the detection of the path of the currently executed script.
Please check what is going on in typo3/sysext/core/Classes/Core/SystemEnvironmentBuilder.php::getPathThisScriptNonCli()

Actions #2

Updated by Andreas Fernandez over 10 years ago

  • $cgiPath is "/var/www/virtual/foo/html/typo3/sysext/install/Start/Install.php" as defined in $_SERVER['ORIG_PATH_TRANSLATED']
  • PHP_SAPI is "cgi-fcgi"
  • $scriptPath is returned as "/var/www/virtual/foo/html/typo3/sysext/install/Start/Install.php"
Actions #3

Updated by Markus Klein over 10 years ago

Ok then the problem must be "upstream". Please debug through the getPathSite() function downwards.

Actions #4

Updated by Andreas Fernandez over 10 years ago

@getPathSite()@:
  • $relativePathPart is "typo3/sysext/install/Start/"
getPathSiteByRelativePathPart():
  • $entryScriptDirectory is "/var/www/virtual/foo/html/typo3/sysext/install/Start/"
  • $pathSite is returned as "/var/www/virtual/foo/html/"

This would make PATH_typo3conf to "/var/www/virtual/foo/html/typo3conf/".

Actions #5

Updated by Markus Klein over 10 years ago

Which is correct.

Actions #6

Updated by Andreas Fernandez over 10 years ago

Yeah, but it still tries to write into "/var/www/virtual/foo/html/typo3conf/../../typo3conf/PackageStates.php"

Actions #7

Updated by Markus Klein over 10 years ago

Looking into the code of the posted stack trace it only does
$this->packageStatesConfiguration = @include($this->packageStatesPathAndFilename) ?: array();

This include obviously fails, therefore the exception.

And $this->packageStatesPathAndFilename is only written in one place:
$this->packageStatesPathAndFilename = PATH_typo3conf . 'PackageStates.php';

So PATH_typo3conf is defined in a wrong way, but it is only defined in the SystemEnvironmentBuilder and just depends on PATH_site.
You need to find out, why in this case PATH_site is not set correctly.

Actions #8

Updated by Alexander Opitz over 10 years ago

  • Target version deleted (next-patchlevel)

Hi Andreas did you tried to debug more? Did you find the issue?

Actions #9

Updated by Andreas Fernandez over 10 years ago

Hi Alexander,

unfortunately not, either it's a strange setting at my hoster's site or I messed up with the symlinks (the directory structure is a bit weird). I try to investigate this, soon.

Actions #10

Updated by Alexander Opitz almost 10 years ago

  • Status changed from Needs Feedback to Closed

Closed after chatting with Andreas, it seams an issue on hoster's site.

Actions

Also available in: Atom PDF