Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing tests with failed to open stream: Permission denied in /home/matt/dev/piwik-master/vendor/doctrine/cache/lib/Doctrine/Common/Cache/PhpFileCache.php #6905

Closed
mattab opened this issue Dec 28, 2014 · 8 comments
Assignees
Labels
answered For when a question was asked and we referred to forum or answered it. Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@mattab
Copy link
Member

mattab commented Dec 28, 2014

Running the test locally this morning results in error message:

./console tests:run ArchiveCronTest
Did you know? You can run tests faster by disabling xdebug
Executing command: cd /home/matt/dev/piwik-master/tests/PHPUnit && ../../vendor/phpunit/phpunit/phpunit  --group ArchiveCronTest 
PHPUnit 4.4.0 by Sebastian Bergmann.

Configuration read from /home/matt/dev/piwik-master/tests/PHPUnit/phpunit.xml


Warning: include(/home/matt/dev/piwik-master/tmp/cache/tracker/piwikcache_general.php): failed to open stream: Permission denied in /home/matt/dev/piwik-master/vendor/doctrine/cache/lib/Doctrine/Common/Cache/PhpFileCache.php on line 48

Call Stack:
    0.0002     235240   1. {main}() /home/matt/dev/piwik-master/vendor/phpunit/phpunit/phpunit:0
    0.0072    1018360   2. PHPUnit_TextUI_Command::main() /home/matt/dev/piwik-master/vendor/phpunit/phpunit/phpunit:62
    0.0072    1018992   3. PHPUnit_TextUI_Command->run() /home/matt/dev/piwik-master/vendor/phpunit/phpunit/src/TextUI/Command.php:138
    2.6617   83096600   4. PHPUnit_TextUI_TestRunner->doRun() /home/matt/dev/piwik-master/vendor/phpunit/phpunit/src/TextUI/Command.php:186
    2.7552   83500368   5. PHPUnit_Framework_TestSuite->run() /home/matt/dev/piwik-master/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:423
    2.9502   83504424   6. PHPUnit_Framework_TestSuite->run() /home/matt/dev/piwik-master/vendor/phpunit/phpunit/src/Framework/TestSuite.php:751
    3.0200   83507536   7. PHPUnit_Framework_TestSuite->run() /home/matt/dev/piwik-master/vendor/phpunit/phpunit/src/Framework/TestSuite.php:751
    3.0208   83510856   8. call_user_func() /home/matt/dev/piwik-master/vendor/phpunit/phpunit/src/Framework/TestSuite.php:708
    3.0208   83511032   9. Piwik\Tests\Framework\TestCase\SystemTestCase::setUpBeforeClass() /home/matt/dev/piwik-master/vendor/phpunit/phpunit/src/Framework/TestSuite.php:708
    3.0209   83512512  10. Piwik\Tests\Framework\Fixture->performSetUp() /home/matt/dev/piwik-master/tests/PHPUnit/Framework/TestCase/SystemTestCase.php:67
    3.3285   87571024  11. Piwik\Tests\Fixtures\ManySitesImportedLogs->setUp() /home/matt/dev/piwik-master/tests/PHPUnit/Framework/Fixture.php:251
   10.8992   87918168  12. Piwik\Tests\Fixtures\ManySitesImportedLogs->setupSegments() /home/matt/dev/piwik-master/tests/PHPUnit/Fixtures/ManySitesImportedLogs.php:51
   10.9000   88000936  13. Piwik\Plugins\SegmentEditor\API->add() /home/matt/dev/piwik-master/tests/PHPUnit/Fixtures/ManySitesImportedLogs.php:161
   10.9001   88001464  14. Piwik\Plugins\SegmentEditor\API->checkSegmentValue() /home/matt/dev/piwik-master/plugins/SegmentEditor/API.php:270
   10.9005   88039912  15. Piwik\Segment->__construct() /home/matt/dev/piwik-master/plugins/SegmentEditor/API.php:35
   10.9005   88040312  16. Piwik\Segment->initializeSegment() /home/matt/dev/piwik-master/core/Segment.php:99
   10.9012   88119424  17. Piwik\Segment->getCleanedExpression() /home/matt/dev/piwik-master/core/Segment.php:129
   10.9013   88119472  18. Piwik\Plugins\API\API->getSegmentsMetadata() /home/matt/dev/piwik-master/core/Segment.php:150
   10.9264   88324896  19. Piwik\Piwik::postEvent() /home/matt/dev/piwik-master/plugins/API/API.php:151
   10.9264   88324992  20. Piwik\EventDispatcher->postEvent() /home/matt/dev/piwik-master/core/Piwik.php:700
   10.9266   88333728  21. call_user_func_array() /home/matt/dev/piwik-master/core/EventDispatcher.php:121
   10.9266   88334152  22. Piwik\Plugins\CustomVariables\CustomVariables->getSegmentsMetadata() /home/matt/dev/piwik-master/core/EventDispatcher.php:121
   10.9266   88334152  23. Piwik\Plugins\CustomVariables\CustomVariables::getMaxCustomVariables() /home/matt/dev/piwik-master/plugins/CustomVariables/CustomVariables.php:100
   10.9266   88334152  24. Piwik\Tracker\Cache::getCacheGeneral() /home/matt/dev/piwik-master/plugins/CustomVariables/CustomVariables.php:75
   10.9266   88334152  25. Piwik\Cache\Lazy->fetch() /home/matt/dev/piwik-master/core/Tracker/Cache.php:128
   10.9266   88334456  26. Piwik\Cache\Backend\File->doFetch() /home/matt/dev/piwik-master/vendor/piwik/cache/src/Lazy.php:37
   10.9266   88334472  27. Doctrine\Common\Cache\PhpFileCache->doFetch() /home/matt/dev/piwik-master/vendor/piwik/cache/src/Backend/File.php:51


Warning: include(): Failed opening '/home/matt/dev/piwik-master/tmp/cache/tracker/piwikcache_general.php' for inclusion (include_path='/home/matt/dev/piwik-master/vendor/phpunit/php-text-template:/home/matt/dev/piwik-master/vendor/phpunit/php-timer:/home/matt/dev/piwik-master/vendor/phpunit/php-file-iterator:/home/matt/dev/piwik-master/vendor/phpseclib/phpseclib/phpseclib:/home/matt/dev/piwik-master/vendor/phpunit/php-code-coverage:.:/usr/share/php:/usr/share/pear:/home/matt/dev/piwik-master/vendor/bin:/home/matt/dev/piwik-master/core:/home/matt/dev/piwik-master/libs:/home/matt/dev/piwik-master/plugins') in /home/matt/dev/piwik-master/vendor/doctrine/cache/lib/Doctrine/Common/Cache/PhpFileCache.php on line 48



Maybe you have some ideas?

@mattab mattab added the Bug For errors / faults / flaws / inconsistencies etc. label Dec 28, 2014
@mattab mattab added this to the Piwik 2.10.0 milestone Dec 28, 2014
@mattab mattab self-assigned this Dec 28, 2014
@mattab
Copy link
Member Author

mattab commented Dec 29, 2014

FYI @tsteur we have to add the repo alias to the root composer.json for it to be used. In the 2.10.0-rc1 we actually didn't have the "filecache-race-condition-fix" branch code and we were using still doctrine/cache repo. It was fixed in: 41a0e0d

@mattab
Copy link
Member Author

mattab commented Dec 29, 2014

Added the fix to the doctrine/cache pull request

@mattab mattab closed this as completed Dec 29, 2014
@mattab mattab added the answered For when a question was asked and we referred to forum or answered it. label Dec 29, 2014
@tsteur
Copy link
Member

tsteur commented Jan 4, 2015

Where are we actually using the doctrine file cache so that we need that composer json include? I'm maybe not up to date...

@mattab
Copy link
Member Author

mattab commented Jan 4, 2015

not sure what you meant but our class extends from Doctrine class File extends PhpFileCache implements Backend

@tsteur
Copy link
Member

tsteur commented Jan 4, 2015

Yeah sure, but that's in the Piwik-Cache library which requires the correct doctrine version. If nothing else requires doctrine etc we should be fine I reckon. Just curious...

@mattab
Copy link
Member Author

mattab commented Jan 4, 2015

@mnapoli had an explanation, it's a feature / bug of Composer that we need to set the branch aliases in the root composer.json as well.

see maybe if it does not, it must be re-inline-aliased in A's composer.json. in https://getcomposer.org/doc/articles/aliases.md#require-inline-alias

@tsteur
Copy link
Member

tsteur commented Jan 4, 2015

ah... another project is requiring it too (PHP-DI), that's what I was missing

@mnapoli
Copy link
Contributor

mnapoli commented Jan 4, 2015

Not related to PHP-DI, it's just that piwik-cache uses our fork&branch of doctrine-cache using composer alias. But composer aliases are ignored when they are in dependencies, so the alias works in piwik-cache itself but not when it's included in piwik.

So we need to re-do the alias in piwik's composer.json.

See https://getcomposer.org/doc/articles/aliases.md#require-inline-alias

Note: If a package with inline aliases is required, the alias (right of the as) is used as the version constraint. The part left of the as is discarded. As a consequence, if A requires B and B requires monolog/monolog version dev-bugfix as 1.0.x-dev, installing A will make B require 1.0.x-dev, which may exist as a branch alias or an actual 1.0 branch. If it does not, it must be re-inline-aliased in A's composer.json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it. Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

3 participants