5

We've recently upgraded a site from CE 1.5.0.1 to CE 1.7.0.2, and now all product pages just resolve to a 404 page. This applies for direct links, with the product-url.html after the domain, and also full canonical links. It also applies when we try to access the product by using the full /catalog/product/view/id/1000 URL.

There is, and I imagine its related, an issue with indexing on the site. There are 72k products so indexing is slow at best, but I've still been unable to get all indexes to complete without errors, and currently the Catalog URL Rewrites index is stuck on Processing.

We've tried truncating the core_url_rewrites table, and obviously reindexing everything. We've also created simple plain test products which also don't work.

.htaccess file matches the live, working site, is there anything else we may have missed?


I've now discovered that the product object is still available for me on the 404 page - weird huh? I can access all of the product data using Mage::registry('current_product');, this led me to look at the product view controller, and I discovered that commenting out Mage::dispatchEvent('catalog_controller_product_view', array('product' => $product)); showed the product page.

So I can only think that something is hooked onto this event and causing the page to die - obviously leaving this line commented out isn't a solution as its causing other issues with the product, but should point us in the right direction?

Any ideas would be greatly appreciated, there are no custom modules that listen for this event.


Thanks.

9
  • The failed indexing could indeed be the problem, could you put the errors in your question? Also did you remove all lock files from var/locks and check the permissions? Commented Jun 19, 2013 at 17:05
  • Hi Toon, thanks for the reply. I've since removed all of the lock files and ran the indexing via SSH, as the index was initially failing due to exceeding memory limit. I'm still struggling to get the indexes to complete properly though. Is there any specific folder permissions I need to check?
    – thebluefox
    Commented Jun 20, 2013 at 9:52
  • Well if you don't have enough permissions over your locks folder your indexing won't start, otherwise you will probably get some error, if its the second case post it here... Otherwise a chmod 755 of your locks folder might help Commented Jun 20, 2013 at 16:03
  • Those folders are all ok, and created on the fly by the indexer. I've since narrowed down the issue, I shall update my post...
    – thebluefox
    Commented Jun 21, 2013 at 8:42
  • 1
    On a default Magento instance, these are the observers hooked on catalog_controller_product_view: Mage_Reports_Model_Event_Observer::catalogProductView() and Mage_Sendfriend_Model_Observer::register(). Maybe that helps.
    – Marius
    Commented Jun 21, 2013 at 8:58

6 Answers 6

7

I had a problem that responded well to commenting out the line you suggest too.:

Mage::dispatchEvent('catalog_controller_product_view', array('product' => $product));

so this got me thinking to look for anything using that event, so i did a grep on app/code for catalog_controller_product_view

my results:

not, much, considering the first one is just that which has the line we commented. then i see something in Reports, and that jogs my memory... i didnt think it was necessary but i had emptied the report_* tables during a database merge, this must have been it,

so after restoring those tables from a backup its working again even with the line uncommented... !

1
  • 1
    Strangely (or maybe not so as we were both making our way there) we arrived at the same solution too. Our reporting tables must have been emptied, or changed during the update. Weird behaviour to occur though. Thanks for all the help everyone.
    – thebluefox
    Commented Aug 6, 2013 at 16:25
7

Looks like the table report_event_types is empty. If yes, run the following query and it will work.

    CREATE TABLE IF NOT EXISTS `report_event_types` (
  `event_type_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Event Type Id',
  `event_name` varchar(64) NOT NULL COMMENT 'Event Name',
  `customer_login` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Customer Login',
  PRIMARY KEY (`event_type_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Reports Event Type Table' AUTO_INCREMENT=7 ;



INSERT INTO `report_event_types` (`event_type_id`, `event_name`, `customer_login`) VALUES
(1, 'catalog_product_view', 0),
(2, 'sendfriend_product', 0),
(3, 'catalog_product_compare_add_product', 0),
(4, 'checkout_cart_add_product', 0),
(5, 'wishlist_add_product', 0),
(6, 'wishlist_share', 0);
1
  • 1
    This should be mark as correct solution...
    – Martin
    Commented Nov 30, 2015 at 15:45
3

Thanks !!! I had the same problem after a reindex crash ! All product pages returned 404 error page !!

So i opened Mage_Reports_Model_Event_Observer and added a

return true;

In the begening of this observer method:

public function catalogProductView(Varien_Event_Observer $observer)

And it worked !!

You saved my day/life !!

2
  • This also work for me !!!! Commented Jan 13, 2016 at 5:25
  • Better way to this is go to system -> configuration -> general-> reports -> Commented Mar 17, 2016 at 10:32
1

For more better use, go to system->configuration->reports->general and change the setting for enabling report. Switch to No and your problem will be solved.

1

i have the same problem but now it's solved. I hope my experience can help others who have the same issue.

After truncated some log tables in database yesterday, all product detail pages were blank, not any errors, other pages works well. my hosting simplehelix disabled Compilation, pages loaded but all product pages returned to 404 page. simplehelix was not helpful at all, after 2 hours they asked me to pay 25usd to restore my site. today i searched in google and checked the exception.log and found the error, report_event table not exist, so i copied this table to the database, everything works well now. I also noticed that the privious database had report_event_types table, but after i imported report_event table, this table disappeared, i don't know why.

1

I also face same error 404 not found. I checked the exception.log and found the error:

main.CRITICAL: exception 'Magento\Framework\Exception\LocalizedException' with message 'Object DOMDocument should be created.' in C:\xampp\htdocs\camptest\vendor\magento\framework\View\Element\UiComponent\Config\DomMerger.php:408

One of my custom module was overriding catalog_product, so it includes catalog_product_price.xml in layout directory. but there was no block and other dependent things which I have declared in xml file. So I created each block, clear static content, upgrade the setup, clear the cache and it start working.

This error was also logged in system.log file also with more clarity of error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.