I have a web application running laravel 5.0.33 on Linux RHEL 7.9, with PHP 5.4.16. It uses Javascript and Ajax to download data from mysql. It has always worked fine until two days ago, when download attempts suddenly started hanging indefinitely, even though I hadn't touched any code.
I investigated, and found that it makes an Ajax call as follows:
var url = APP_URL+'/datatables/'+table_id+'/query';
$.ajax(url, {
method: 'POST',
data: {"query": query_str},
dataType: 'json',
}).done(function (data) {
// do some stuff here that I commented out
});
When I tried pasting the generated URL into a browser, I got a message saying 'MethodNotAllowedHttpException in RouteCollection.php line 207.' The stack trace was as follows:
in RouteCollection.php line 207
at RouteCollection->methodNotAllowed(array('POST')) in RouteCollection.php line 194
at RouteCollection->getRouteForMethods(object(Request), array('POST')) in RouteCollection.php line 142
at RouteCollection->match(object(Request)) in Router.php line 729
at Router->findRoute(object(Request)) in Router.php line 652
at Router->dispatchToRoute(object(Request)) in Router.php line 628
at Router->dispatch(object(Request)) in Kernel.php line 214
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 141
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in VerifyCsrfTokenWithExcludedRoutes.php line 32
at VerifyCsrfTokenWithExcludedRoutes->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in ShareErrorsFromSession.php line 55
at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in StartSession.php line 61
at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 36
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in EncryptCookies.php line 40
at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in CheckForMaintenanceMode.php line 42
at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 101
at Pipeline->then(object(Closure)) in Kernel.php line 115
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 84
at Kernel->handle(object(Request)) in index.php line 53
However, artisan route:list tells me that POST is fine for this route:
POST | datatables/{datatables}/query | query.create | App\Http\Controllers\Datazoo\DatatableQueryDatazooController@query <
Does anyone have any idea what might be happening?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire