1
votes

I have an error when i execute this command :

php app/console cache:clear --env=prod && php app/console cache:clear --env=dev && php app/console assets:install --symlink && php app/console assetic:dump

The error is :

[Symfony\Component\Debug\Exception\ContextErrorException] Catchable Fatal Error: Argument 1 passed to Sonata\AdminBundle\Security\Handler\RoleSecurityHandler::__construct() must implement interface Symfony\Component\Security\Core\SecurityContextInter face, null given, called in /opt/preprod/app/cache/pro_/ap_ProdProjectContainer.php on line 1923 and defined

Can you help i dont really know how to fix this

EDIT

I tried to backup

composer.lock

and

vendor

directory (and then delete them). Then i deleted mannually the cache. Then i made a composer install but the error is back when i made the composer install.

Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache



  [Symfony\Component\Debug\Exception\ContextErrorException]                                                                                                                                          
  Catchable Fatal Error: Argument 1 passed to Sonata\AdminBundle\Security\Handler\RoleSecurityHandler::__construct() must implement interface Symfony\Component\Security\Core\SecurityContextInterface, null given, called in /opt/preprod/app/cache/dev/appDevDebugProjectContainer.php on line 4984 and defined



Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception


  [RuntimeException]
  An error occurred when executing the "'cache:clear --no-warmup'" command.

php app/check.php give me everything is ok

So i dont find the way to solve this

1
Did you try remove cache using rm -rf app/cache/* ?Andrzej Piszczek
You should first clear your cache manually, and then post the result of each of the commands by itself so we can help you find the problem. It could be related to a vendor conflict so you might need to backup your vendor (mv vendor vendor_bkp) and run composer install.xocasdashdash

1 Answers

0
votes

What version of Symfony are you using? I would guess 2.8 or 3.0 since it looks like the version of SonataAdminBundle is not compatible with your Symfony version.