Domanda

I am building a laravel application and everything seems to be working fine, except for the fact that I keep getting these errors appearing in the log file continuously. I mean they are showing up every few minutes, sometimes more often, sometimes less - it's making harder to find real problems in the log file. Except of these problems, they aren't really causing any problems - I have an App::missing method to take care of real users.

Do you have any idea of where to look for the solution?

[2014-05-15 19:58:20] local.ERROR: exception 'Symfony\Component\HttpKernel\Exception\NotFoundHttpException' with message 'Controller method not found.' in /Applications/MAMP/htdocs/gran.pw/vendor/laravel/framework/src/Illuminate/Routing/Controller.php:254
Stack trace:
#0 [internal function]: Illuminate\Routing\Controller->missingMethod(Array)
#1 /Applications/MAMP/htdocs/gran.pw/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(231): call_user_func_array(Array, Array)
#2 /Applications/MAMP/htdocs/gran.pw/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(93): Illuminate\Routing\Controller->callAction('missingMethod', Array)
#3 /Applications/MAMP/htdocs/gran.pw/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(62): Illuminate\Routing\ControllerDispatcher->call(Object(HomeController), Object(Illuminate\Routing\Route), 'missingMethod')
#4 /Applications/MAMP/htdocs/gran.pw/vendor/laravel/framework/src/Illuminate/Routing/Router.php(934): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'HomeController', 'missingMethod')
#5 [internal function]: Illuminate\Routing\Router->Illuminate\Routing\{closure}(Array)
#6 /Applications/MAMP/htdocs/gran.pw/vendor/laravel/framework/src/Illuminate/Routing/Route.php(105): call_user_func_array(Object(Closure), Array)
#7 /Applications/MAMP/htdocs/gran.pw/vendor/laravel/framework/src/Illuminate/Routing/Router.php(1000): Illuminate\Routing\Route->run(Object(Illuminate\Http\Request))
#8 /Applications/MAMP/htdocs/gran.pw/vendor/laravel/framework/src/Illuminate/Routing/Router.php(968): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#9 /Applications/MAMP/htdocs/gran.pw/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(738): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#10 /Applications/MAMP/htdocs/gran.pw/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(708): Illuminate\Foundation\Application->dispatch(Object(Illuminate\Http\Request))
#11 /Applications/MAMP/htdocs/gran.pw/vendor/laravel/framework/src/Illuminate/Http/FrameGuard.php(38): Illuminate\Foundation\Application->handle(Object(Illuminate\Http\Request), 1, true)
#12 /Applications/MAMP/htdocs/gran.pw/vendor/laravel/framework/src/Illuminate/Session/Middleware.php(72): Illuminate\Http\FrameGuard->handle(Object(Illuminate\Http\Request), 1, true)
#13 /Applications/MAMP/htdocs/gran.pw/vendor/laravel/framework/src/Illuminate/Cookie/Queue.php(47): Illuminate\Session\Middleware->handle(Object(Illuminate\Http\Request), 1, true)
#14 /Applications/MAMP/htdocs/gran.pw/vendor/laravel/framework/src/Illuminate/Cookie/Guard.php(51): Illuminate\Cookie\Queue->handle(Object(Illuminate\Http\Request), 1, true)
#15 /Applications/MAMP/htdocs/gran.pw/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Illuminate\Cookie\Guard->handle(Object(Illuminate\Http\Request), 1, true)
#16 /Applications/MAMP/htdocs/gran.pw/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(606): Stack\StackedHttpKernel->handle(Object(Illuminate\Http\Request))
#17 /Applications/MAMP/htdocs/gran.pw/public/index.php(49): Illuminate\Foundation\Application->run()
#18 {main} [] []
È stato utile?

Soluzione

Its a 404 for a non existant url.

i.e. http://example.com/this-url-does-not-exist

To see which URL is actually causing the 404 - add this to your filters file

App::missing(function($exception)
{
    Log::error('Missing URL was: ' . Request::fullUrl());
});

It will record the URL that any exception occurs on in your logs.

It is most likely due to either a search engine bot trying to search for old links, or could be some broken links within your application.

I did mention this to Taylor as a possible bug in Laravel 4.1 - that the http exception does not record the missing url - but it was closed at the time. I might re-open it as I'm sure it is a bug (since old 404 did record the url).

Altri suggerimenti

Looks like your HomeController is not extending Laravel's controller:

class HomeController extends Controller {

}

Because the method missingMethod is missing from yours and this one is in the Laravel Controller base class.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top