Topics

Tribe Support

Tribe Support's Topics

Umesh

Umesh

October 11 2017

500 Error and no error log

For last several months (obviously, I did not spend each day on fixing this issue), I'm stuck at one point in my upgrade process.

I'm getting 500 error in Article Edit code. And there is no error code. I tried enabling debug, adding error_reporting(E_ALL); ini_set('display_errors', 1);  in several places. 

I started tracing it from _actionEdit in article.php and still trying to figure out which specific controller chain causing this issue.

As there is no error/debug log, finding it difficult to reach a conclusion.

In one of the StackOverflow thread, it was mentioned that "@" error-control operator suppresses all error messages, however, Anahita has '@' mostly in templates/views and not in controllers.

Has anyone come across such scenario where PHP not generating any error log?

 

Nick Swinford
Nick Swinford
October 11 2017 Permalink
Is this a localhost or on a remote server? Does it have xDebug installed?
Nick Swinford
Nick Swinford
October 11 2017 Permalink
Instead of changing the ini settings, did you try changing Anahita's configuration file? The config file will override changes to your ini file. If you haven't try setting $debug to 1 and $error_reporting to E_ALL in the Anahita configuration file and see if that generates an error.
Rastin Mehr liked this
Umesh
Umesh
October 11 2017 Permalink
@nicholasjohn16 Its on a remote server. I've tried $debug=1 and $error_reporting=1 , but never tried $error_reporting=E_ALL.

Let me try and report
Umesh
Umesh
October 11 2017 Permalink
@nicholasjohn16 I tried with E_ALL in configuration.php file. I deliberately introduced error to see if I'm getting error messages. I got those however not getting any error message for

$result = parent::_actionEdit($context);

in _actionEdit.ComArticlesControllerArticle

Weird :( Thanks for your support though
Nick Swinford
Nick Swinford
October 11 2017 Permalink
E_ALL and $debug=1?

So the 500 Server Error happens when you're trying to edit an Article?
Umesh
Umesh
October 11 2017 Permalink
I guess I must have typed something wrong and this could be a compilation error, and not a runtime execution error.
Nick Swinford
Nick Swinford
October 11 2017 Permalink
So is the error resolved then?
Umesh
Umesh
October 11 2017 Permalink
Not yet... I'm going through all files and comparing with the older version to find out what has changed and possibly causing this issue.

I tried $debug=1 and $error_reporting=E_ALL, but still no error log

I get 500 error when I try to Edit an article.
Umesh
Umesh
October 12 2017 Permalink
Here are the steps I followed to solve this issue

1. Added try - catch block in _actionEdit.ComArticlesControllerArticle

try{

$result = parent::_actionEdit($context);
}
catch(Error $e) {
$trace = $e->getTrace();
echo $e->getMessage().' in '.$e->getFile().' on line '.$e->getLine().' called from '.$trace[0]['file'].' on line '.$trace[0]['line'];
$bt = debug_backtrace(); print_r($bt);
}

2. This resulted into getting error - Fatal error: Uncaught Error: Call to undefined function utf8_encode() in /usr/share/anahita-master/vendor/nooku/libraries/koowa/filter/html.php

3. I installed php7.0-xml package to get access to utf8_encode function
2 people liked this
Nick Swinford
Nick Swinford
October 12 2017 Permalink
Glad you figured it out! Thanks for sharing the solution!!
Rastin Mehr
Rastin Mehr
October 12 2017 Permalink
Good job you two on debugging the issue! 🙌🏅🏅

Powered by Anahita