Magento 2.2.7 404 on all front end product pages and 'This product doesn't exist' on back end products

magento.stackexchange https://magento.stackexchange.com/questions/262380

  •  19-02-2021
  •  | 
  •  

Question

After updating, all products on the front end give a 404 when trying to view. All the small views, search, categories etc. work fine and show the products. It's only when you try to visit the page.

The same on the back end - all products are visible but if you try to open one you get the error: This product doesn't exist.

Side note: when trying to reindex using PHP 7.0 the following error shows for search:

Notice: Undefined offset: 4 in /vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/Full.php on line 384

If we switch to PHP 7.1 it reindexes fine.

No errors are showing in any logs and all the products in 'catalog_product_entity' have their SKUs.

Tried installation on 2.2.6 and same thing.

Currently in developer mode and using duplicate db and content from live site but on a subdomain.

Also using MariaDB.

Have tried reindexing and clearing all caches.

/* Update */

Doing some more digging if I try to open a URL_rewrite (Marketing > URL Rewrites > Edit) I am getting this error:

1 exception(s): Exception #0 (Exception): Notice: Undefined index: media_type in /vendor/magento/module-product-video/Model/Plugin/Catalog/Product/Gallery/ReadHandler.php on line 60

Was it helpful?

Solution 2

After lots of file checking it turns out the issue was with PHP 7.0 and 7.1.

In this instance we were changing to PHP 7.1 in cPanel and it turns out the server was running multi-php. So we needed to set the PHP version in more than one location.

While we 'thought' the reindexing was working, it was only half working and not showing an error. Once we properly switched to 7.1 it reindexed correctly.

The issue was with the re_writes not indexing correctly.

So if you're coming up with similar issues as we have, I recommend making 100% sure you've completely switched to PHP 7.1

OTHER TIPS

when ever 404 error that means system is unable to find the path. Basic reason of this error is incorrect naming conventions or incorrect file names.

Check names of all files...is your flow sequence is right.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top