cancel
Showing results for 
Search instead for 
Did you mean: 

An error has happened during application run. See exception log for details.

An error has happened during application run. See exception log for details.

Hello ,

 

i am getting this error in exception.log

 

#18 {main} {"exception":"[object] (Error(code: 0): Call to a member function getCode() on null at /home/uraircon/public_html/vendor/magento/module-store/App/Action/Plugin/Context.$

2 REPLIES 2

Re: An error has happened during application run. See exception log for details.

Hello @anandimhere 

 

This error is pointing to vendor/magento/module-store/App/Action/Plugin/Context. This plugin is part of Magento’s multi-store functionality and is used to retrieve the store information during execution. If the store or context is null, the error will occur.

Go to Stores > Configuration > General > Web in the Magento admin panel:

         Ensure Add Store Code to URLs is properly set under URL Options.

 

Check if custom or third-party modules/plugins are overriding or interfering with the Context plugin.

 

Check your database to ensure the store table has valid data:

        Open your database using a tool like phpMyAdmin or MySQL CLI.

        SELECT * FROM store;

 

 

 

​Hope it helps ! 

If you find our reply helpful, please give us kudos.

 

Thank You,


WebDesk Solution Support Team
Get a Free Quote | Email | Adobe Commerce Partner | Hire Us | Call Us 877.536.3789


Location: 150 King St. W. Toronto, ON M5H 1J9

Re: An error has happened during application run. See exception log for details.

Hello @anandimhere, To resolve this you should follow this steps.

 

Open the exception.log or system.log file in the var/log/ directory of your Magento installation.

Look for the complete stack trace to identify what triggered the error (e.g., a custom module or third-party extension).

Verify that all stores and store views are properly configured in the Magento admin panel:

Admin Panel > Stores > All Stores.

 

Ensure that no store view is disabled or has incomplete data (e.g., missing store codes).

Navigate to the file /vendor/magento/module-store/App/Action/Plugin/Context.php

Check if getStore() is returning null. Add a check like this:

if ($this->storeManager->getStore()) {

    $storeCode = $this->storeManager->getStore()->getCode();

} else {

    $storeCode = 'default'; // Or handle it appropriately

}


If you aren't already in developer mode, enable it to get more detailed error messages:

php bin/magento deploy:mode:set developer

 

If the issue will be resolved, Click Kudos & Accept as a Solution.