Reputation: 21600
Complete error message is:
[2014-10-12 08:07:45] request.CRITICAL: Uncaught PHP Exception Twig_Error_Runtime: "An exception has been thrown during the rendering of a template ("Unable to generate a URL for the named route "sonata_admin_dashboard" as such route does not exist.") in "SonataAdminBundle::standard_layout.html.twig" at line 104." at /Volumes/Sviluppo/web/sensorario/magna/app/cache/prod/classes.php line 4483 {"exception":"[object] (Twig_Error_Runtime: An exception has been thrown during the rendering of a template (\"Unable to generate a URL for the named route \"sonata_admin_dashboard\" as such route does not exist.\") in \"SonataAdminBundle::standard_layout.html.twig\" at line 104. at /Volumes/Sviluppo/web/sensorario/magna/app/cache/prod/classes.php:4483, Symfony\Component\Routing\Exception\RouteNotFoundException: Unable to generate a URL for the named route \"sonata_admin_dashboard\" as such route does not exist. at /Volumes/Sviluppo/web/sensorario/magna/app/cache/prod/appProdUrlGenerator.php:38)"} []
I get this error only in production environment. In dev environment all works fine.
And, for example, route
http://magna/admin/dashboard
returns 404, and tail -f app/logs/prod.log says:
No route found for "GET /admin/dashboard"
Upvotes: 1
Views: 4575
Reputation: 3362
You might have only imported the proper routing file under
app/config/routing_dev.yml
Try to import Sonata's routes in your
app/config/routing.yml
as well.
Upvotes: 1