X
    Categories: Knowledgebase

Magento there has been an error processing your request

As a Magento developer, we need to know the common errors of Magento 1.x and Magento 2.x, how to debug, how to fix bugs. In this tutorial for beginners, we’ll show you how to troubleshoot and fix one of the most common errors in Magento 1.x and Magento 2: ” There has been an error processing your request, Exception printing is disabled by default for security reasons. ”

  1. There has been an error processing your request
  2. Exception printing is disabled by default for security reasons.
  3. Error log record number: xxxxxxxxxx

Cause

When working with Magento, you will usually see a message ( normally you will see this when installing Magento, installing new themes / extensions). This is usually caused by conflicts in theme, extensions or database/resource shortage…

Solutions for Magento 1.x

Now, I will provide several solutions to this errors, you can try every or all solution until you can fix your issue.

1. Delete/rename cache folder

Do this first, 90% you will get the error fixed.

First, go to root folder var/cache

Now you can rename or just remove all cache files, and refresh your Magento site to see if the error is gone.

2. Check error log record

As you can see the error message: Error log record number: xxxxxxxxxx, here xxxxxxxxxx is the name of log file we need to check. All error log files are located in Magento/var/report folder, just open file manager and go to that folder and find the corresponding file and read the log to find solution.

3. Enable printing errors

If the solution above doesn’t help, you can enable printing errors to check what problems caused the error. To do this follows these steps:

Step 1: go to folder  Magento/errors

There you will see  local.xml.sample  file, just rename it to  local.xml , the purpose of this action is to enable error printing in Magento

Step 2: Reload the error page and you will see the full list of error message, this will help you fix the issue

4. Enable Magento exception printing

We can also enable Magento exception printing to get more details report on the error. To do this,

Step 1: in admin panel of Magento go to System > Configuration > Developer > Log Settings. Now change Log Setting to “Yes”

Step 2: You can find system.log and exception.log in Magento/var/log. As per my experience, you will see the following error in exception.log

 Now we need to specify a cache_dir for Magento, go to the file /lib/Zend/Cache/Backend/File.php, find:
  1.  ‘cache_dir’ => null,

change it to;

  1. ‘cache_dir’ => ‘tmp/,


Next, go to Magento root folder and create: /tmp folder

Finally, refresh the page to see if the issue is fixed.

For Magento 2

You may also see this error in Magento 2, just like Magento 1, we will need to enable exception printing in Magento 2. The local.xml file in Magento 2 is located in pub/errors/, now we will rename local.xml.sample  to   local.xml .

Now reload your error page to see debug messages on the page rather than just  Exception printing is disabled by default for security reasons, something like this

  1. Recoverable Error: Argument 1 passed to Mage_Eav_Model_Attribute_Data::factory() must be an instance of Mage_Eav_Model_Attribute, instance of Mage_Eav_Model_Entity_Attribute given, called in /magento/app/code/core/Mage/Customer/Block/Address/Renderer/Default.php on line 114 and defined  in /magento/app/code/core/Mage/Eav/Model/Attribute/Data.php on line 59
  2. #0 /magento/app/code/core/Mage/Eav/Model/Attribute/Data.php(59): mageCoreErrorHandler(4096, ‘Argument 1 pass…’, ‘/var/www/vhosts…’, 59, Array)
  3. #1 /magento/app/code/core/Mage/Customer/Block/Address/Renderer/Default.php(114): Mage_Eav_Model_Attribute_Data::factory(Object(Mage_Eav_Model_Entity_Attribute), Object(Mage_Sales_Model_Order_Address))
  4. #2 /magento/app/code/core/Mage/Customer/Model/Address/Abstract.php(337): Mage_Customer_Block_Address_Renderer_Default->render(Object(Mage_Sales_Model_Order_Address))
  5. #3 /magento/app/code/core/Mage/Customer/Model/Address/Abstract.php(326): Mage_Customer_Model_Address_Abstract->format(‘html’)
  6. #4 /magento/app/design/adminhtml/default/quickcheckout/template/sales/order/view/info.phtml(163): Mage_Customer_Model_Address_Abstract->getFormated(true)
  7. #5 /magento/app/code/core/Mage/Core/Block/Template.php(241): include(‘/var/www/vhosts…’)

Now you will see what you need to do next, normally we will have to clear Magento cache as in Magento 1, in some case you will need to repair corrupted table in your Magento 2 Databse, that depends on the error logs you see.

Conclusion

All the solutions I mentioned in this tutorial is based on my personal experience, if you have more solutions please let us know by dropping a line comment section below. Hope you find this article helpful.

Cao Hồng Quang: