How to solve “There has been an error processing your request”

Problem

Message "There has been an error processing your request. Exception printing is disabled by default for security reasons." is a very common problem, which usually appear after update (Magento 2 or extension) or changes in templates code.

For security reasons, Magento 2 hides a full error message and shows the message above with "Error log record number" reference.

Solution

Before dealing with error, you need to see full error text.

If you have an error log record number, you just need to open a report file with name, corresponding to this number. All reports are located in the folder var/report.

For example, if you have "Error log record number: 756135892816", then proper report will be [Magento Root Directory]/var/report/756135892816.

In some cases, Magento doesn’t return error log number. In this case you need to temporary switch Magento to Developer mode in file app/bootstrap.php, and add the following lines:

/**
 * Environment initialization
 */
error_reporting(E_ALL);
ini_set('display_errors', 1);
$_SERVER['MAGE_MODE'] = 'developer';

This will make a detailed error message displayed with a full backtrace and you will be able to resolve the problem.

Additionally, you can use Health Monitoring Suite to track all errors on an early stage. The extension will automatically notify you if the errors rate is growing after recent updates or changes.