I am trying to access a POST route which is currently working locally but doesn’t work once deployed to the production server. I've removed the name of the app and replaced with XXX in the following. I've run out of ideas and I think I've tried everything posted here.
We have a very similar POST only route which is working fine, but from a previous deployment.
I'm trying to access the route www.XXX.com/api/convert_mov
my routing.yml
XXX_api_convert:
path: /api/convert_mov
defaults: { _controller: XXXPartnerBundle:API:convert }
methods: [POST]
php app/console router:debug | grep api
returns
XXX_api_convert POST ANY ANY /api/convert_mov
I have run
php app/console cache:clear --env=prod
app/logs/prod.log
shows
request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "POST /api/convert_mov"" at /var/www/XXX/ppp/releases/20150903102317/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php line 144 {"exception":"[object] (Symfony\Component\HttpKernel\Exception\NotFoundHttpException(code: 0): No route found for \"POST /api/convert_mov\" at /var/www/XXX/ppp/releases/20150903102317/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php:144, Symfony\Component\Routing\Exception\ResourceNotFoundException(code: 0): at /var/www/XXX/ppp/releases/20150903102317/app/cache/prod/appProdUrlMatcher.php:738)"} []
Even after warming up the cache I can see this in appProdUrlMatcher.php
// XXX_api_convert
if ($pathinfo === '/api/convert_mov') {
if ($this->context->getMethod() != 'POST') {
$allow[] = 'POST';
goto not_XXX_api_convert;
}
return array ( '_controller' => 'XXX\\PartnerBundle\\Controller\\APIController::convertAction', '_route' => 'XXX_api_convert',);
}
not_XXX_api_convert:
}
php app/console router:debug --env=prod | grep api
– malcolm