2

I have a production environment working and I would like to know which errors or problems takes place on it which I can not reproduce in my testing environment.

For it, I am trying to make use of the error.log located in cakephp/app/tmp/ folder but I am not able to understand some of those errors or even know where exactly in the code do they take place.

For example:

2013-07-24 10:26:49 Error: [MissingActionException] Action TablesController::fancybox() could not be found.

#0 C:\inetpub\wwwroot\lib\Cake\Routing\Dispatcher.php(186): Controller->invokeAction(Object(CakeRequest))

#1 C:\inetpub\wwwroot\lib\Cake\Routing\Dispatcher.php(161): Dispatcher->_invoke(Object(TablesController), Object(CakeRequest), Object(CakeResponse))

#2 C:\inetpub\wwwroot\app\webroot\index.php(92): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse)) #3 C:\inetpub\wwwroot\index.php(42): require('C:\inetpub\wwwr...') #4 {main}

Where is the error coming from? Where am I suppose to to be calling the fancybox() function? In which file and line? I can not trace it with those indications.

Is there any way to read this properly? Am I missing something?

4
  • 2
    I always add the url and the referrer to my error logs. This way its easier to find the source of the issue and how to reproduce it in order to fix it: github.com/dereuromark/tools/blob/master/Lib/Error/… Commented Jul 24, 2013 at 9:55
  • please tag questions with the version of cake you're using Commented Jul 24, 2013 at 11:16
  • 2.2 But i guess this behavior is similar in other versions too. Commented Jul 24, 2013 at 11:18
  • it's not helpful to label your questions with versions of cake you aren't using. Commented Jul 24, 2013 at 11:34

1 Answer 1

1

Where is the error coming from?

The error message reports that TablesController::fancybox() could not be found

That means there is a request for a url of the form /tables/fancybox/.... was made.

Most likely this is a 404 request generated by a js library loaded by the page. To identify these errors - simply open e.g. chrome's network panel in developer tools and reload the page. Anything in red indicates a request for something that returned an error - and something to fix.

The information of what is making the request will also be in the apache access/error log - the referer is the initiator responsible for making these erroneous requests.

Sign up to request clarification or add additional context in comments.

3 Comments

I've been looking for fancybox inside all my project files and I don't find any call to the controller with that name. All I can find is a CSS class with that name and the JS initializations of the jQuery plugin. ($.fancybox({ ...)
I'll give you some advice if you tag your questions appropriately ;). 2.3 would show you exactly what url is responsible - so you are not using 2.3.
Either backport the ErrorHadler from 2.3 so you can see the Request Url in the error log - or put function beforeFilter() { if ($this->name === 'CakeError') { $this->log($this->here); $this->log($this->referer()); } in your app controller - and identify the exact request url causing the error. Based on that - act accordingly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.