Bug #42807

Libraries/doctrine/dbal/docs/examples/sharding/composer.json broken Flow

Added by Dominique Feyer over 2 years ago. Updated over 2 years ago.

Status:Resolved Start date:2012-11-09
Priority:Must have Due date:
Assigned To:Karsten Dambekalns % Done:

100%

Category:Package
Target version:TYPO3 Flow Base Distribution - 2.0 beta 1
PHP Version:5.3 Complexity:
Has patch:No Affected Flow version:Git 1.2 (master)

Description

With recent Flow version (master), after surf deploy, I was unable to use flow (web or cli), after som debug it look like the composer.json file located at Libraries/doctrine/dbal/docs/examples/sharding/ is parsed a broke every thing.

Here'is my shell output

➜  next git:(deploy) ✗ ./flow 
PHP Notice:  Undefined property: stdClass::$name in /home/vhosts/hosted.medialib.tv/releases/20121109001526/Packages/Framework/TYPO3.Flow/Classes/TYPO3/Flow/Package/PackageFactory.php on line 78
PHP Fatal error:  Uncaught exception 'TYPO3\Flow\Package\Exception\InvalidPackageKeyException' with message '"" is not a valid package key.' in /home/vhosts/hosted.medialib.tv/releases/20121109001526/Packages/Framework/TYPO3.Flow/Classes/TYPO3/Flow/Package/Package.php:96
Stack trace:
#0 /home/vhosts/hosted.medialib.tv/releases/20121109001526/Packages/Framework/TYPO3.Flow/Classes/TYPO3/Flow/Package/PackageFactory.php(49): TYPO3\Flow\Package\Package->__construct('', '/home/vhosts/ho...', 'Classes/', '')
#1 /home/vhosts/hosted.medialib.tv/releases/20121109001526/Packages/Framework/TYPO3.Flow/Classes/TYPO3/Flow/Package/PackageManager.php(734): TYPO3\Flow\Package\PackageFactory::create('/home/vhosts/ho...', 'Libraries/doctr...', '', 'Classes/', '')
#2 /home/vhosts/hosted.medialib.tv/releases/20121109001526/Packages/Framework/TYPO3.Flow/Classes/TYPO3/Flow/Package/PackageManager.php(627): TYPO3\Flow\Package\PackageManager->registerPackagesFromConfiguration()
#3 /home/vhosts/hosted.medialib.tv/releases/20121109001526/Packages/Framewor in /home/vhosts/hosted.medialib.tv/releases/20121109001526/Packages/Framework/TYPO3.Flow/Classes/TYPO3/Flow/Package/Package.php on line 96
➜  next git:(deploy) ✗ find Packages/Libraries/doctrine/ -name composer.json 
Packages/Libraries/doctrine/common/composer.json
Packages/Libraries/doctrine/dbal/docs/examples/sharding/composer.json
Packages/Libraries/doctrine/dbal/composer.json
Packages/Libraries/doctrine/orm/composer.json
Packages/Libraries/doctrine/migrations/composer.json
Packages/Libraries/doctrine/data-fixtures/composer.json
➜  next git:(deploy) ✗ mv Packages/Libraries/doctrine/dbal/docs/examples/sharding/composer.json Packages/Libraries/doctrine/dbal/docs/examples/sharding/_composer.json
➜  next git:(deploy) ✗ ./flow 
TYPO3 Flow 1.2 ("Production" context)
usage: ./flow <command identifier>

See "./flow help" for a list of all available commands.

The test is done on Linux with PHP 5.3.18-1 (dotdeb)

PackageManager.php_findComposerManifestPaths-3.png (380.2 kB) Karsten Dambekalns, 2012-11-09 17:54


Related issues

related to TYPO3 Flow Base Distribution - Story #41031: Composer support for packaging Resolved 2012-09-17

Associated revisions

Revision bc8e6048
Added by Karsten Dambekalns over 2 years ago

[BUGFIX] Fix composer manifest detection

The method findComposerManifestPaths() would return wrong results if
the list of found JSON files was in the "wrong" order. Adding a call to
asort() makes the longer paths come later in the list and fixes the
behavior.

Also the direct detection of a manifest is fixed and a useless
condition is removed.

Change-Id: If6902cd6a671a6c83485a36a7645768db3feb8c9
Fixes: #42807
Releases: 1.2

History

#1 Updated by Dominique Feyer over 2 years ago

The annoying thing is after renamming the composer.json file to the original name everything work :(

#2 Updated by Karsten Dambekalns over 2 years ago

  • Category set to Package
  • Status changed from New to Accepted
  • Assigned To set to Karsten Dambekalns
  • Priority changed from Should have to Must have
  • Target version set to 2.0 beta 1

Yesterday I merged https://review.typo3.org/16081 after checking locally. It removes some code for that very problem with the sharding example manifest I added with https://review.typo3.org/15119.

Can you make sure your Doctrine and Flow packages are really up to date? I'll check again locally, to see if I can reproduce the error.

#3 Updated by Karsten Dambekalns over 2 years ago

  • Status changed from Accepted to Needs Feedback

I updated all packages, removed all caches and PackageStates.php, before this:

kmac :: ~/Sites/neos ‹master*› » ./flow
TYPO3 Flow 1.2 ("Development" context)
usage: ./flow <command identifier>

See "./flow help" for a list of all available commands.

kmac :: ~/Sites/neos ‹master*› » FLOW_CONTEXT=Production ./flow
TYPO3 Flow 1.2 ("Production" context)
usage: ./flow <command identifier>

See "./flow help" for a list of all available commands.

Dominique, please double check…

#4 Updated by Dominique Feyer over 2 years ago

After the surf deployment, my last commit are:

TYPO3.Flow 450778452d666fc1af2f6899806debcc49f6df94
doctrine/dbal 9395ca33971c0ff875d71a0271e6c0d5b0f01508
doctrine/orm 6bad0109599348c5216df35f62b80a20ba16c507

#5 Updated by Dominique Feyer over 2 years ago

If I revert your commit:

git revert a148ca1ed1ded30ef8ecba4cdab2a0a575bd2c67

Everything work nicely ... so it's related ...

#6 Updated by Dominique Feyer over 2 years ago

I don't need to revert everything, just, the line 605 - 608 in Classes/TYPO3/Flow/Package/PackageManager.php and everything work fine

#7 Updated by Cedric Ziel over 2 years ago

I can confirm this one.. ran into it yesterday.

#8 Updated by Karsten Dambekalns over 2 years ago

I tried again, after removing Data/Temporary I can use Flow fine, with PHP 5.3 and 5.4. The versions you have (Dominique) are ok, that's recent. The offending composer file exists in my setup as well. All in all: I have no clue what is going on.

So, if you can, please check what is going on in findComposerManifestPaths() when you run into that error. Attached a screenshot of the state right after that method has been started for …Libraries/doctrine. My only guess is that the method somehow returns a different result, possibly because the order of files found is depending on the filesystem or whatever…

#9 Updated by Dominique Feyer over 2 years ago

It's a production server so no xdebug, here is a raw var dump:

array(1) {
  [0]=>
  string(100) "/home/vhosts/hosted.medialib.tv/releases/20121109122017/Packages/Framework/TYPO3.Party/composer.json" 
}
array(1) {
  [0]=>
  string(100) "/home/vhosts/hosted.medialib.tv/releases/20121109122017/Packages/Framework/TYPO3.Fluid/composer.json" 
}
array(1) {
  [0]=>
  string(99) "/home/vhosts/hosted.medialib.tv/releases/20121109122017/Packages/Framework/TYPO3.Flow/composer.json" 
}
array(1) {
  [0]=>
  string(105) "/home/vhosts/hosted.medialib.tv/releases/20121109122017/Packages/Application/Ttree.Medialib/composer.json" 
}
array(1) {
  [0]=>
  string(103) "/home/vhosts/hosted.medialib.tv/releases/20121109122017/Packages/Application/TYPO3.Guzzle/composer.json" 
}
array(1) {
  [0]=>
  string(102) "/home/vhosts/hosted.medialib.tv/releases/20121109122017/Packages/Application/TYPO3.Media/composer.json" 
}
array(1) {
  [0]=>
  string(101) "/home/vhosts/hosted.medialib.tv/releases/20121109122017/Packages/Application/TYPO3.Tmdb/composer.json" 
}
array(1) {
  [0]=>
  string(100) "/home/vhosts/hosted.medialib.tv/releases/20121109122017/Packages/Application/Ttree.ISO/composer.json" 
}
array(1) {
  [0]=>
  string(105) "/home/vhosts/hosted.medialib.tv/releases/20121109122017/Packages/Application/TYPO3.UAParser/composer.json" 
}
array(1) {
  [0]=>
  string(108) "/home/vhosts/hosted.medialib.tv/releases/20121109122017/Packages/Application/TYPO3.SwiftMailer/composer.json" 
}
array(1) {
  [0]=>
  string(101) "/home/vhosts/hosted.medialib.tv/releases/20121109122017/Packages/Application/TYPO3.Surf/composer.json" 
}
array(1) {
  [0]=>
  string(104) "/home/vhosts/hosted.medialib.tv/releases/20121109122017/Packages/Application/TYPO3.Imagine/composer.json" 
}
array(1) {
  [0]=>
  string(119) "/home/vhosts/hosted.medialib.tv/releases/20121109122017/Packages/Libraries/typo3/flow-composer-installers/composer.json" 
}
array(1) {
  [0]=>
  string(98) "/home/vhosts/hosted.medialib.tv/releases/20121109122017/Packages/Libraries/composer/installed.json" 
}
array(6) {
  [0]=>
  string(104) "/home/vhosts/hosted.medialib.tv/releases/20121109122017/Packages/Libraries/doctrine/common/composer.json" 
  [1]=>
  string(125) "/home/vhosts/hosted.medialib.tv/releases/20121109122017/Packages/Libraries/doctrine/dbal/docs/examples/sharding/composer.json" 
  [2]=>
  string(102) "/home/vhosts/hosted.medialib.tv/releases/20121109122017/Packages/Libraries/doctrine/dbal/composer.json" 
  [3]=>
  string(101) "/home/vhosts/hosted.medialib.tv/releases/20121109122017/Packages/Libraries/doctrine/orm/composer.json" 
  [4]=>
  string(108) "/home/vhosts/hosted.medialib.tv/releases/20121109122017/Packages/Libraries/doctrine/migrations/composer.json" 
  [5]=>
  string(111) "/home/vhosts/hosted.medialib.tv/releases/20121109122017/Packages/Libraries/doctrine/data-fixtures/composer.json" 
}
array(1) {
  [0]=>
  string(122) "/home/vhosts/hosted.medialib.tv/releases/20121109122017/Packages/Libraries/amazonwebservices/aws-sdk-for-php/composer.json" 
}
array(1) {
  [0]=>
  string(104) "/home/vhosts/hosted.medialib.tv/releases/20121109122017/Packages/Libraries/imagine/Imagine/composer.json" 
}
array(3) {
  [0]=>
  string(124) "/home/vhosts/hosted.medialib.tv/releases/20121109122017/Packages/Libraries/symfony/yaml/Symfony/Component/Yaml/composer.json" 
  [1]=>
  string(137) "/home/vhosts/hosted.medialib.tv/releases/20121109122017/Packages/Libraries/symfony/dom-crawler/Symfony/Component/DomCrawler/composer.json" 
  [2]=>
  string(130) "/home/vhosts/hosted.medialib.tv/releases/20121109122017/Packages/Libraries/symfony/console/Symfony/Component/Console/composer.json" 
}
PHP Notice:  Undefined property: stdClass::$name in /home/vhosts/hosted.medialib.tv/releases/20121109122017/Packages/Framework/TYPO3.Flow/Classes/TYPO3/Flow/Package/PackageFactory.php on line 78
PHP Fatal error:  Uncaught exception 'TYPO3\Flow\Package\Exception\InvalidPackageKeyException' with message '"" is not a valid package key.' in /home/vhosts/hosted.medialib.tv/releases/20121109122017/Packages/Framework/TYPO3.Flow/Classes/TYPO3/Flow/Package/Package.php:96

#10 Updated by Dominique Feyer over 2 years ago

This work:
$jsonPathsAndFilenames = Files::readDirectoryRecursively($packagePath, '.json');
asort($jsonPathsAndFilenames);

#11 Updated by Dominique Feyer over 2 years ago

This work:
$jsonPathsAndFilenames = Files::readDirectoryRecursively($packagePath, '.json');
asort($jsonPathsAndFilenames);

#12 Updated by Gerrit Code Review over 2 years ago

  • Status changed from Needs Feedback to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/16364

#13 Updated by Karsten Dambekalns over 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF