title: Symfony 2.4.2: You cannot create a service ("request") of an inactive scope ("request")
body: <p>I just updated a project to Symfony 2.4.2 from 2.2.2. After upgrading the profiler is causing an exception that is displayed inline at the bottom of each page:</p>
  
  <p>'Symfony\Component\DependencyInjection\Exception\InactiveScopeException' with message <strong>'You cannot create a service ("request") of an inactive scope ("request").'</strong></p>
  
  <pre><code>( ! ) Fatal error: Uncaught exception 'Symfony\Component\DependencyInjection\Exception\InactiveScopeException' with message 'You cannot create a service ("request") of an inactive scope ("request").' in /var/www/pm/app/cache/dev/appDevDebugProjectContainer.php on line 3776
  ( ! ) Symfony\Component\DependencyInjection\Exception\InactiveScopeException: You cannot create a service ("request") of an inactive scope ("request"). in /var/www/pm/app/cache/dev/appDevDebugProjectContainer.php on line 3776
  Call Stack
  #   Time    Memory  Function    Location
  1   0.0029  239928  {main}( )   ../app_dev.php:0
  2   4.0354  53462264    Symfony\Component\HttpKernel\Kernel-&gt;terminate( )   ../app_dev.php:18
  3   4.0355  53462360    Symfony\Component\HttpKernel\HttpKernel-&gt;terminate( )   ../bootstrap.php.cache:2283
  4   4.0371  53473320    Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher-&gt;dispatch( )    ../bootstrap.php.cache:2894
  5   4.0377  53477632    Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher-&gt;dispatch( )    ../TraceableEventDispatcher.php:138
  6   4.0377  53477632    Symfony\Component\EventDispatcher\EventDispatcher-&gt;dispatch( )  ../classes.php:1831
  7   4.0377  53477696    Symfony\Component\EventDispatcher\EventDispatcher-&gt;doDispatch( )    ../classes.php:1667
  8   4.0377  53478048    call_user_func ( )  ../classes.php:1734
  9   4.0377  53478088    Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher-&gt;Symfony\Component\HttpKernel\Debug\{closure}( )    ../classes.php:1734
  10  4.0385  53482400    call_user_func ( )  ../TraceableEventDispatcher.php:388
  11  4.0385  53482440    Symfony\Component\HttpKernel\EventListener\ProfilerListener-&gt;onKernelTerminate( )   ../TraceableEventDispatcher.php:388
  12  4.0387  53486304    Symfony\Component\HttpKernel\Profiler\Profiler-&gt;saveProfile( )  ../ProfilerListener.php:136
  13  4.0388  53486480    Symfony\Component\HttpKernel\DataCollector\EventDataCollector-&gt;lateCollect( )   ../Profiler.php:115
  14  4.0388  53486544    Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher-&gt;getNotCalledListeners( )   ../EventDataCollector.php:48
  15  4.0388  53486752    Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher-&gt;getListeners( )    ../TraceableEventDispatcher.php:166
  16  4.0388  53486848    Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher-&gt;getListeners( )    ../TraceableEventDispatcher.php:106
  17  4.0403  53497920    Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher-&gt;lazyLoad( )    ../classes.php:1807
  18  4.0416  53520352    Symfony\Component\DependencyInjection\Container-&gt;get( ) ../classes.php:1842
  </code></pre>
  
  <p>It seems that the error is caused when the profiler listens for the kernel termination, but I haven't been able to solve the issue.</p>
  
  <p>What is wrong?</p>
  
  <h2>Edit</h2>
  
  <p>Example of a service that has request injection:</p>
  
  <pre><code>services:
      property.value.form.resolver.number:
          class: Frisbee\ProductBundle\Form\Resolver\PropertyTypeFormResolverNumber
          arguments: [@form.factory, @request]
          scope: request
  </code></pre>