4

I transferred my database to a new site and now get an error message when I open product page in admin dashboard "Invalid entity_type specified:" and other products have this error "No such entity with id=9". I'm using Magento CE 2.1.9

How do I fix that? Can anyone help me?

[2018-01-30 12:51:56] main.CRITICAL: Magento\Framework\Exception\LocalizedException: Invalid entity_type specified:  in /home/storesah/public_html/m4/vendor/magento/module-eav/Model/Config.php:350

[2018-02-06 07:33:04] main.WARNING: Magento\Framework\Exception\FileSystemException: Cannot gather stats! Warning!stat(): stat failed for /home/storesah/public_html/m4/pub/media/catalog/product/r/y/ryobi_chain_saw_cs-2240.jpg in /home/storesah/public_html/m4/vendor/magento/framework/Filesystem/Driver/File.php:71

1 Answer 1

0

[2018-02-06 07:33:04] main.WARNING: Magento\Framework\Exception\FileSystemException: Cannot gather stats! Warning!stat(): stat failed for /home/storesah/public_html/m4/pub/media/catalog/product/r/y/ryobi_chain_saw_cs-2240.jpg in /home/storesah/public_html/m4/vendor/magento/framework/Filesystem/Driver/File.php:71

Typically this error means that image has been deleted from the media directory, but the link to it still exists in the database. I'll recommend you to upload image anew.

[2018-01-30 12:51:56] main.CRITICAL: Magento\Framework\Exception\LocalizedException: Invalid entity_type specified: in /home/storesah/public_html/m4/vendor/magento/module-eav/Model/Config.php:350

This error means that you trying to work with the unexistent entity (like a customer or product in the base Magento, but added by third-party module). This entity used in the edit product page, but does not exist in the database. You can debug it in the corresponding class:

  1. Open product edit page.

  2. Open magento/module-eav/Model/Config.php on your server and change this code:

    if (!$entityType->getId()) {
        throw new \Magento\Framework\Exception\LocalizedException(__('Invalid entity_type specified: %1', $code));
    }
    

    to this one:

    if (!$entityType->getId()) {
        $e = new \Magento\Framework\Exception\LocalizedException(__('Invalid entity_type specified: %1', $code));
        var_dump($e->getTraceAsString());
        die();
    }
    

or if you have xDebug on your server use it, it's preferred way.

Reload the recently opened product edit page in your browser and check exception trace. From it you can find a module which trying to load empty \ nonexistent entity (or update your question - add trace and I'll try to help you).

PS: after debugging do not forget to remove debug code which you added!

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.