Troubleshooting
Error "Shop not found at line xxx in file classes/shop/Shop.php"
Shop not found at line xxx in file classes/shop/Shop.php means PrestaShop could not load a valid shop. The exception alone does not prove that PS_SHOP_DEFAULT is the original cause.
In the front office, PrestaShop first tries to identify the shop that matches the requested domain and path. If that shop is not resolved, does not load or is not active, it tries to open the shop defined by PS_SHOP_DEFAULT; the exception appears when it cannot load that fallback either.
// No shop found ... too bad, let's redirect to default shop $default_shop = new Shop((int) Configuration::get('PS_SHOP_DEFAULT')); // Hmm there is something really bad in your Prestashop ! if (!Validate::isLoadedObject($default_shop)) { throw new PrestaShopException('Shop not found'); }
Keep the exact URL and the trace before changing the database. In a multistore installation, check these relationships using the real table prefix:
- In
PREFIX_shop_url, checkdomain,domain_ssl,physical_uri,virtual_uri,mainandactivefor the host and path that fail. - In
PREFIX_shop, confirm that the shop obtained and the default shop exist, are active and are not marked as deleted. - In
PREFIX_configuration, list all thePS_SHOP_DEFAULTrows together withid_shop_groupandid_shop. The effective value can depend on the group or shop context.
Do not edit the first row you find or copy an ID from another shop without checking the context. Make a database backup first and test the fix on a clone; a wrong URL or default shop can affect every front office request.
If you cannot work out which scope Configuration::get() resolves, contact support and give the domain, the failing path, the approximate time and the trace. Do not send credentials in the ticket.
Check domain and path before touching data
If it happened after a domain change, first confirm which server the request reaches and which document root it uses. A correct database does not prevent the error if you are opening another copy of the shop with a host it does not have registered.
After the minimal fix, test HTTP/HTTPS, the chosen variant with or without www, an inner page and the back office. In multistore, also check the shops that were not supposed to change and that the fallback does not send the visitor to another catalogue.
You may also find useful
- PrestaShopException: diagnosing Invalid address Find the exact reference behind Invalid address and clean up only carts with no order, preserving th...
- GLPI time zone error with MariaDB or MySQL Tell apart time zone data that has not been loaded from the permission that only GLPI versions earli...
- PrestaShop, layered_filter_block table grows too large Measure and clear the Faceted search cache, tell it apart from its price index and update the module...
- SQLSTATE 2026 error when installing or updating PrestaShop Diagnose the SSL connection to MySQL that prevents Doctrine from querying the server version, withou...
Something wrong or out of date? Tell us and we will review it.