?
avatar philip-sorokin
philip-sorokin
11 Apr 2017

I use Nginx + php7.0-fpm. Some errors are not visible to the system - error log is clear.

Steps to reproduce the issue

Add the following string in the index.php file right after the application initialization:

// Instantiate the application.
$app = JFactory::getApplication('site');

$nonexistent = null;
echo $nonexistent->nonexistent() + $abcd;

Expected and actual result

You will see the Joomla! error page (see the screenshot - with a strange error 0), but in the error log you will not find the error. But if you write the following:

// Instantiate the application.
$app = JFactory::getApplication('site');
echo $nonexistent;

You will see the notice in the log.

System information (as much as possible)

Debian 8.
Nginx + php7.0-fpm.
Joomla! RC2.
Error reporting: development (the same with none).

err

P.S. I discovered such behaviour when I was debugging a component, but it was impossible to find an error, because the error log was clear, and the Joomla! error page does not point to the broken file and string number -- It just gives a strange error 0 without any localization.

avatar philip-sorokin philip-sorokin - open - 11 Apr 2017
avatar joomla-cms-bot joomla-cms-bot - change - 11 Apr 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 11 Apr 2017
avatar philip-sorokin philip-sorokin - edited - 11 Apr 2017
avatar philip-sorokin philip-sorokin - edited - 11 Apr 2017
avatar philip-sorokin philip-sorokin - change - 11 Apr 2017
The description was changed
avatar philip-sorokin philip-sorokin - edited - 11 Apr 2017
avatar philip-sorokin philip-sorokin - change - 11 Apr 2017
The description was changed
avatar philip-sorokin philip-sorokin - edited - 11 Apr 2017
avatar philip-sorokin philip-sorokin - change - 11 Apr 2017
The description was changed
avatar philip-sorokin philip-sorokin - edited - 11 Apr 2017
avatar joomla-cms-bot joomla-cms-bot - change - 11 Apr 2017
Title
Something wrong with Joomla error handler
Something wrong with the Joomla error handler
avatar joomla-cms-bot joomla-cms-bot - edited - 11 Apr 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 11 Apr 2017
Category Libraries
avatar joomla-cms-bot joomla-cms-bot - change - 11 Apr 2017
The description was changed
avatar joomla-cms-bot joomla-cms-bot - edited - 11 Apr 2017
avatar joomla-cms-bot joomla-cms-bot - change - 11 Apr 2017
Title
Something wrong with the Joomla error handler
Something wrong with Joomla error handler
avatar joomla-cms-bot joomla-cms-bot - edited - 11 Apr 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 11 Apr 2017
Priority Medium Low
avatar joomla-cms-bot joomla-cms-bot - change - 11 Apr 2017
The description was changed
Title
Something wrong with Joomla error handler
Something wrong with the Joomla error handler
avatar joomla-cms-bot joomla-cms-bot - edited - 11 Apr 2017
avatar alikon
alikon - comment - 11 Apr 2017

What happens with the system debug plugin enabled ?

avatar philip-sorokin
philip-sorokin - comment - 11 Apr 2017

The debug console is not showing at all!

I assume, it is because of a fatal error. If you add the wrong code at the beginning of the file, you can see in the log:

2017/04/11 17:51:40 [error] 508#508: *4755 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to a member function nonexistent() on null in /home/ozon/web/dev.addondev.com/index.php:19

But when it goes after the application instantiation, you have an error 0 and the clear error log.

avatar mbabker
mbabker - comment - 11 Apr 2017

Joomla doesn't do anything to alter PHP's internal error logging, unless it is affected by us changing display_errors or calling error_reporting(), in which case it would still be coupled to PHP's configuration.

avatar philip-sorokin
philip-sorokin - comment - 11 Apr 2017

@mbabker
If you write wrong code at the beginning of the index.php file, you will have a fatal error logged. When adding the same wrong code after the application instantiation, you will have an error 0 and the clear log. My configuration is standard PHP7.0-fpm configuration, the same as Nginx.

avatar mbabker
mbabker - comment - 11 Apr 2017

Depends on the type of error thrown. PHP 7 Throwables will get caught in Joomla's exception handling layer, and this includes some things in PHP 5 that would trigger notices, warnings, and errors.

avatar philip-sorokin
philip-sorokin - comment - 11 Apr 2017

@mbabker, I mean the same error. I'll explain again.

Add the wrong code at the beginning of the index.php

define('JOOMLA_MINIMUM_PHP', '5.3.10');

$nonexistent = null;
echo $nonexistent->nonexistent() + $abcd;

You will have an error logged

2017/04/11 18:14:56 [error] 509#509: *4875 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to a member function nonexistent() on null in /home/user/web/dev.addondev.com/index.php:15

true-500

Then add the same code after Joomla instantiate the application:

// Instantiate the application.
$app = JFactory::getApplication('site');

$nonexistent = null;
echo $nonexistent->nonexistent() + $abcd;

The fatal error becomes error 0 and does not go into the log. And in the browser console you have the error description:

wrong-500

The above shows another issue. Why Joomla! demonstrates the server errors to everyone? It is a security issue, because you cannot disable it, even if you set the error_reporting param as none

avatar joomla-cms-bot joomla-cms-bot - change - 11 Apr 2017
The description was changed
avatar joomla-cms-bot joomla-cms-bot - edited - 11 Apr 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 9 May 2017
Status New Discussion
avatar franz-wohlkoenig franz-wohlkoenig - change - 13 May 2017
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2017-05-13 04:37:25
Closed_By franz-wohlkoenig
avatar joomla-cms-bot joomla-cms-bot - change - 13 May 2017
The description was changed
avatar joomla-cms-bot joomla-cms-bot - edited - 13 May 2017
avatar joomla-cms-bot joomla-cms-bot - close - 13 May 2017
avatar joomla-cms-bot
joomla-cms-bot - comment - 13 May 2017
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 13 May 2017

closed as having PR #15994


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/15215.

Add a Comment

Login with GitHub to post a comment