Composer update throws an error with Sonata Admin kpn_menu.matcher
farshidalavim opened this issue · comments
Fatal error: Uncaught Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException: Circular reference detected for service "knp_menu.matcher", path: "knp_menu.matcher -> sonata.admin.menu.matcher.voter.children -> knp_menu.matcher". in /Applications/MAMP/htdocs/fulfilio/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php:69
Stack trace:
#0 /Applications/MAMP/htdocs/fulfilio/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php(72): Symfony\Component\DependencyInjection\Compiler\CheckCircularReferencesPass->checkOutEdges(Array)
#1 /Applications/MAMP/htdocs/fulfilio/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php(72): Symfony\Component\DependencyInjection\Compiler\CheckCircularReferencesPass->checkOutEdges(Array)
#2 /Applications/MAMP/htdocs/fulfilio/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckCircularRefer in /Applications/MAMP/htdocs/fulfilio/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php on line 69
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the symfony-scripts event terminated with an exception
Installation failed, reverting ./composer.json to its original content.
[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command:
Fatal error: Uncaught Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException: Circular reference detected for service "knp_menu.matcher", path: "knp_menu.matcher -> sonata.
admin.menu.matcher.voter.children -> knp_menu.matcher". in /Applications/MAMP/htdocs/fulfilio/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php
:69
Stack trace:
#0 /Applications/MAMP/htdocs/fulfilio/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php(72): Symfony\Component\DependencyInjection\Compiler\Che
ckCircularReferencesPass->checkOutEdges(Array)
#1 /Applications/MAMP/htdocs/fulfilio/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php(72): Symfony\Component\DependencyInjection\Compiler\Che
ckCircularReferencesPass->checkOutEdges(Array)
#2 /Applications/MAMP/htdocs/fulfilio/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckCircularRefer in /Applications/MAMP/htdocs/fulfilio/vendor/symfony/symfony/src/Sym
fony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php on line 69
I cannot clear my symfony cache due to this circular issue.
PHP 7.1.8
Symfony 3.3
Using version ^2.2 for knplabs/knp-menu-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
- Updating knplabs/knp-menu-bundle (2.1.3 => v2.2.0): Downloading (100%)
Writing lock file
Generating autoload files
ocramius/package-versions: Generating version class...
ocramius/package-versions: ...done generating version class
Incenteev\ParameterHandler\ScriptHandler::buildParameters
Updating the "app/config/parameters.yml" file
Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
Fatal error: Uncaught Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException: Circular reference detected for service "knp_menu.matcher", path: "knp_menu.matcher -> sonata.admin.menu.matcher.voter.children -> knp_menu.matcher". in /Applications/MAMP/htdocs/fulfilio/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php:69
Stack trace:
#0 /Applications/MAMP/htdocs/fulfilio/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php(72): Symfony\Component\DependencyInjection\Compiler\CheckCircularReferencesPass->checkOutEdges(Array)
#1 /Applications/MAMP/htdocs/fulfilio/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php(72): Symfony\Component\DependencyInjection\Compiler\CheckCircularReferencesPass->checkOutEdges(Array)
#2 /Applications/MAMP/htdocs/fulfilio/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckCircularRefer in /Applications/MAMP/htdocs/fulfilio/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php on line 69
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the symfony-scripts event terminated with an exception
Installation failed, reverting ./composer.json to its original content.
[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command:
Fatal error: Uncaught Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException: Circular reference detected for service "knp_menu.matcher", path: "knp_menu.matcher -> sonata.
admin.menu.matcher.voter.children -> knp_menu.matcher". in /Applications/MAMP/htdocs/fulfilio/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php
:69
Stack trace:
#0 /Applications/MAMP/htdocs/fulfilio/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php(72): Symfony\Component\DependencyInjection\Compiler\Che
ckCircularReferencesPass->checkOutEdges(Array)
#1 /Applications/MAMP/htdocs/fulfilio/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php(72): Symfony\Component\DependencyInjection\Compiler\Che
ckCircularReferencesPass->checkOutEdges(Array)
#2 /Applications/MAMP/htdocs/fulfilio/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckCircularRefer in /Applications/MAMP/htdocs/fulfilio/vendor/symfony/symfony/src/Sym
fony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php on line 69
Duplicate of KnpLabs/KnpMenuBundle#366, which is actually due to a bug in SonataAdminBundle, not in KnpMenuBundle (the new version of KnpMenuBundle just leads to triggering the circular reference issue all the time instead of triggering it only in some usage patterns).
This issue is already fixed in the dev version of SonataAdminBundle.
I'm closing this issue as it is not an issue in the KnpMenu library.