Search code examples
phpsymfonysymfony-2.2

Why does production environment return a 200 with empty body?


I have a web developed with Symfony 2.2.1. I developed it using the dev environment and it works great. The problem is when I try the production environment. I receive a 200 with empty body.

My investigation:

Symfony doesn't write nothing in the logs.

$response = $kernel->handle($request); is called, but the next line $response->send(); it's not. This lines are in the app.php file

If I replace $kernel = new AppKernel('prod', false); to $kernel = new AppKernel('prod', true); in the app.php file all works great.

What can be wrong with my settings?

I have installed the bundles: FOSRestBundle, FOSUser, Sonata-Admin and Sonata-User.


Solution

  • Thanks @cheesemacfly! The log:

    [Wed May 15 18:35:06 2013] [error] [client X.X.X.X] PHP Fatal error: Uncaught exception 'Symfony\\Component\\DependencyInjection\\Exception\\ServiceNotFoundException' with message 'The service "sonata.block.renderer.traceable" has a dependency on a non-existent service "debug.stopwatch".' in /home/inqbarna/ZendProjects/Symfony/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php:59\nStack trace:\n#0 /home/inqbarna/ZendProjects/Symfony/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php(43): Symfony\\Component\\DependencyInjection\\Compiler\\CheckExceptionOnInvalidReferenceBehaviorPass->processReferences(Array)\n#1 /home/inqbarna/ZendProjects/Symfony/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php(37): Symfony\\Component\\DependencyInjection\\Compiler\\CheckExceptionOnInvalidReferenceBehaviorPass->processDefinition(Object(Symfony\\Component\\DependencyInjection\\Definition))\n#2 /home in /home/inqbarna/ZendProjects/Symfony/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php on line 59

    That is, Sonata-Admin requires Sonata-block and this one have a problem.