JMSSecurityExtraBundle icon indicating copy to clipboard operation
JMSSecurityExtraBundle copied to clipboard

Scope Widening Injection when updating my Symfony 2.1 project

Open gergelypolonkai opened this issue 12 years ago • 3 comments

When I tried to update my dependencies today, I got this error:

Generating autoload files
Clearing the cache for the dev environment with debug true



      [Symfony\Component\DependencyInjection\Exception\ScopeWideningInjectionException]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
  Scope Widening Injection detected: The definition "j_m_s.security_extra_bundle.tests.functional.test_bundle.controller.post_controller" references the service "request" which belongs to a narrower scope. Generally, it is safer to either move "j_m_s.security_extra_bundle.tests.functional.test_bundle.controller.post_controller" to scope "request" or alternatively rely on the provider pattern by injecting the container itself, and requesting the service "request" each time it is needed. In rare, special cases however that might not be necessary, then you can set the reference to strict=false to get rid of this error.  



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



  [RuntimeException]                                                            
  An error occurred when executing the "'assets:install '\''web'\'''" command.  



update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-custom-installers] [--no-scripts] [--no-progress] [-v|--verbose] [-o|--optimize-autoloader] [packages1] ... [packagesN]

I've attached my composer files under https://gist.github.com/gergelypolonkai/5005802

gergelypolonkai avatar Feb 21 '13 16:02 gergelypolonkai

Why would you have a service from the functional testsuite of the bundle in your container ? It makes no sense.

stof avatar Feb 21 '13 16:02 stof

I don't. It just happened in my production environment (Debian 6.0 with stock PHP 5.3.3) during the deployment process. It happened before back around 2.0, and suddenly started working after a while.

gergelypolonkai avatar Feb 21 '13 19:02 gergelypolonkai

It turned out that the problem is during cache warmup. Same project works fine on Fedora 18 with stock 5.4.11. On the Debian System, after removing the Tests directory of this one bundle, cache warmup (and actually everything else) runs just fine.

gergelypolonkai avatar Feb 22 '13 17:02 gergelypolonkai