Return to site

Exception printing is disabled by default for security reasons in Magento 2

Solve the Error of There has been an error processing your request in Magento 2

The most common error of Magento 2 store is when installing new extensions, setting configuration or even server memory is overloaded. This error is called Exception printing is disabled by default for security reasons Magento 2. So what is the problem? Follow this guide to resolve the error Exception printing is disabled by default for security reasons in Magento 2.

IMPORTANT NOTE: To get rid of seeing complex errors like this, you should use a stable Magento ERP for your website.

First, you must know The message of "Error Exception printing is disabled by default for security reasons" itself is NOT an error, but a notification on some errors occurring in your system.

This error message when installing a new Magento theme or Magento module, or related to cache folder of Magento. The conflict between some components of Magento cause this error and Magento cannot operate properly.

Which looks like that in Magento 2:

Exception printing is disabled by default for security reasons in Magento 2

How to fix Exception printing is disabled by default for security reasons in Magento 2

To fix this Error, you need to enable Exception printing in Magento 2.

As can be seen in the error page, you will need to check error log record number xxxxxxx. Error log files of Magento are generated in /var/report (Magento 1) and /var/log (Magento 2). You will need an FTP client like Filezilla to open the file and read error log.

Note: To know how the error Exception printing is disabled by default for security reasons looks like in Magento 1, see the picture below:

broken image

You can also enable Exception printing error by navigating to Magento/errors (Magento 1) or /pub/errors/ (Magento 2), you will find a file named local.xml.sample. Rename this file to local.xml. Next, flush Magento cache and reload the error page. There are similar errors:

a:4:{i:0;s:46:"SQLSTATE[HY000] [1049] Unknown database 'ce21'";i:1;s:4514:"#0 \vendor\magento\zendframework1\library\Zend\Db\Adapter\Pdo\Mysql.php(111): Zend_Db_Adapter_Pdo_Abstract->_connect()
#1 \vendor\magento\framework\DB\Adapter\Pdo\Mysql.php(340): Zend_Db_Adapter_Pdo_Mysql->_connect()
#2 \vendor\magento\zendframework1\library\Zend\Db\Adapter\Abstract.php(861): Magento\Framework\DB\Adapter\Pdo\Mysql->_connect()
#3 \vendor\magento\zendframework1\library\Zend\Db\Adapter\Abstract.php(931): Zend_Db_Adapter_Abstract->quote('1', NULL)
#4 \vendor\magento\framework\DB\Adapter\Pdo\Mysql.php(1363): Zend_Db_Adapter_Abstract->quoteInto('`store`.`store_...', '1', NULL, NULL)
#5 \vendor\magento\zendframework1\library\Zend\Db\Select.php(1007): Magento\Framework\DB\Adapter\Pdo\Mysql->quoteInto('`store`.`store_...', '1', NULL)
#6 \vendor\magento\zendframework1\library\Zend\Db\Select.php(477): Zend_Db_Select->_where('`store`.`store_...', '1', NULL, true)
#7 \vendor\magento\framework\DB\Select.php(115): Zend_Db_Select->where('`store`.`store_...', '1', NULL)
#8 \vendor\magento\framework\Model\ResourceModel\Db\AbstractDb.php(367): Magento\Framework\DB\Select->where('`store`.`store_...', '1')
#9 \vendor\magento\module-store\Model\ResourceModel\Store.php(168): Magento\Framework\Model\ResourceModel\Db\AbstractDb->_getLoadSelect('store_id', '1', Object(Magento\Store\Model\Store\Interceptor))
#10 \vendor\magento\framework\Model\ResourceModel\Db\AbstractDb.php(341): Magento\Store\Model\ResourceModel\Store->_getLoadSelect('store_id', '1', Object(Magento\Store\Model\Store\Interceptor))
#11 \var\generation\Magento\Store\Model\ResourceModel\Store\Interceptor.php(89): Magento\Framework\Model\ResourceModel\Db\AbstractDb->load(Object(Magento\Store\Model\Store\Interceptor), '1', NULL)
#12 \vendor\magento\framework\Model\AbstractModel.php(531): Magento\Store\Model\ResourceModel\Store\Interceptor->load(Object(Magento\Store\Model\Store\Interceptor), '1', NULL)
#13 \vendor\magento\module-store\Model\Store.php(488): Magento\Framework\Model\AbstractModel->load('1', NULL)
#14 \var\generation\Magento\Store\Model\Store\Interceptor.php(24): Magento\Store\Model\Store->load('1', NULL)
#15 \vendor\magento\module-store\Model\StoreRepository.php(89): Magento\Store\Model\Store\Interceptor->load('1')
#16 \vendor\magento\module-store\Model\StoreRepository.php(103): Magento\Store\Model\StoreRepository->getById('1')
#17 \vendor\magento\module-store\Model\StoreResolver.php(167): Magento\Store\Model\StoreRepository->getActiveStoreById('1')
#18 \vendor\magento\module-store\Model\StoreResolver.php(105): Magento\Store\Model\StoreResolver->getDefaultStoreById('1')
#19 \vendor\magento\module-store\Model\StoreManager.php(151): Magento\Store\Model\StoreResolver->getCurrentStoreId()
#20 \vendor\magento\module-store\App\Request\PathInfoProcessor.php(39): Magento\Store\Model\StoreManager->getStore('')
#21 \vendor\magento\module-backend\App\Request\PathInfoProcessor.php(47): Magento\Store\App\Request\PathInfoProcessor->process(Object(Magento\Framework\App\Request\Http), '/')
#22 \var\generation\Magento\Backend\App\Request\PathInfoProcessor\Proxy.php(95): Magento\Backend\App\Request\PathInfoProcessor->process(Object(Magento\Framework\App\Request\Http), '/')
#23 \vendor\magento\framework\App\Request\Http.php(165): Magento\Backend\App\Request\PathInfoProcessor\Proxy->process(Object(Magento\Framework\App\Request\Http), '/')
#24 \vendor\magento\framework\HTTP\PhpEnvironment\Request.php(209): Magento\Framework\App\Request\Http->setPathInfo()
#25 \vendor\magento\framework\App\Request\Http.php(208): Magento\Framework\HTTP\PhpEnvironment\Request->getPathInfo()
#26 \vendor\magento\framework\App\Http.php(130): Magento\Framework\App\Request\Http->getFrontName()
#27 \vendor\magento\framework\App\Bootstrap.php(258): Magento\Framework\App\Http->launch()
#28 \index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#29 {main}";s:3:"url";s:6:"/ce21/";s:11:"script_name";s:15:"/ce21/index.php";}

Cache Issue of Exception printing is disabled by default for security reasons in Magento 2

a:5:{i:0;s:71:"Could not determine temp directory, please specify a cache_dir manually";i:1;s:4546:"#0 /home/host/domains/example.com/public_html/lib/Zend/Cache/Backend.php(197): Zend_Cache::throwException('Could not deter...')

Session issue of Exception printing is disabled by default for security reasons in Magento 2

Warning: SessionHandler::read(): open(/var/lib/php/session/sess_cvevqn06desuj80, O_RDWR) failed: Permission denied (13) in /var/www/vhosts/[site]/httpdocs/vendor/magento/framework/Session/SaveHandler.php on line 74

Registry issue of Exception printing is disabled by default for security reasons in Magento 2

a:5:{i:0;s:63:"Mage registry key "_singleton/megamenu/observer" already exists";i:1;s:2654:"#0 /home/host/public_html/magento2/app/Mage.php(223): Mage::throwException('Mage registry k...')
#1 /home/host/public_html/magento2/app/Mage.php(477): Mage::register('_singleton/mega...', false)
#2 /home/host/public_html/magento2/app/code/core/Mage/Core/Model/App.php(1335): Mage::getSingleton('megamenu/observ...')
#3 /home/host/public_html/magento2/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('core_layout_blo...', Array)
#4 /home/host/public_html/magento2/app/code/core/Mage/Core/Model/Layout.php(459): Mage::dispatchEvent('core_layout_blo...', Array)
#5 /home/host/public_html/magento2/app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('page/html', 'root')
#6 /home/host/public_html/magento2/app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('page/html', 'root')
#7 /home/host/public_html/magento2/app/code/core/Mage/Core/Model/Layout.php(205): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
#8 /home/host/public_html/magento2/app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()
#9 /home/host/public_html/magento2/app/code/core/Mage/Cms/Helper/Page.php(113): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#10 /home/host/public_html/magento2/app/code/core/Mage/Cms/Helper/Page.php(52): Mage_Cms_Helper_Page->_renderPage(Object(Mage_Cms_IndexController), 'home')
#11 /home/host/public_html/magento2/app/code/core/Mage/Cms/controllers/IndexController.php(45): Mage_Cms_Helper_Page->renderPage(Object(Mage_Cms_IndexController), 'home')
#12 /home/host/public_html/magento2/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Cms_IndexController->indexAction()
#13 /home/host/public_html/magento2/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index')
#14 /home/host/public_html/magento2/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#15 /home/host/public_html/magento2/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#16 /home/host/public_html/magento2/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#17 /home/host/public_html/magento2/index.php(84): Mage::run('', 'store')
#18 {main}";s:3:"url";s:19:"/magento2/";s:11:"script_name";s:28:"/magento2/index.php";s:4:"skin";s:7:"default";}

Another method to fix Exception printing is disabled by default for security reasons in Magento 2

You can fix Exception printing is disabled by default for security reasons in Magento 2 by only accessing your Magento installation folder, go to var/cache and delete all the files.

broken image

Then, refresh your Magento site to see if the error message is gone. This is 50/50.

Read Omnichannelgal for more great blog posts of E-commerce, for example:

Top 5 B2B Marketing Ideas in 2018 [Infographic]

B2B Call-to-action Button Examples

Thank you for keep reading.