0

I am working on Magento 2.2 enterprise version. It is working fine on my local system but on live environment it throws an exception:

{"0":"Plugin class Magento\TargetRule\Model\Indexer\TargetRule\Plugin\StoreGroup doesn't exist","1":"#0 /vendor/magento/framework/Interception/PluginList/PluginList.php(268): Magento\Framework\Interception\PluginList\PluginList->_inheritPlugins('Magento\\Store\\M...')\n#1 /generated/code/Magento/Store/Model/ResourceModel/Group/Interceptor.php(35): Magento\Framework\Interception\PluginList\PluginList->getNext('Magento\\Store\\M...', 'getIdFieldName')\n#2 /vendor/magento/framework/Model/AbstractModel.php(215): Magento\Store\Model\ResourceModel\Group\Interceptor->getIdFieldName()\n#3 /vendor/magento/module-store/Model/Group.php(144): Magento\Framework\Model\AbstractModel->_init('Magento\\Store\\M...')\n#4 /vendor/magento/framework/Model/AbstractModel.php(194): Magento\Store\Model\Group->_construct()\n#5 /vendor/magento/framework/Model/AbstractExtensibleModel.php(68): Magento\Framework\Model\AbstractModel->__construct(Object(Magento\Framework\Model\Context), Object(Magento\Framework\Registry), NULL, NULL, Array)\n#6 /vendor/magento/module-store/Model/Group.php(133): Magento\Framework\Model\AbstractExtensibleModel->__construct(Object(Magento\Framework\Model\Context), Object(Magento\Framework\Registry), Object(Magento\Framework\Api\ExtensionAttributesFactory), Object(Magento\Framework\Api\AttributeValueFactory), NULL, NULL, Array)\n#7 /generated/code/Magento/Store/Model/Group/Interceptor.php(14): Magento\Store\Model\Group->__construct(Object(Magento\Framework\Model\Context), Object(Magento\Framework\Registry), Object(Magento\Framework\Api\ExtensionAttributesFactory), Object(Magento\Framework\Api\AttributeValueFactory), Object(Magento\Config\Model\ResourceModel\Config\Data), Object(Magento\Store\Model\ResourceModel\Store\CollectionFactory), Object(Magento\Store\Model\StoreManager), NULL, NULL, Array)\n#8 /vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(111): Magento\Store\Model\Group\Interceptor->__construct(Object(Magento\Framework\Model\Context), Object(Magento\Framework\Registry), Object(Magento\Framework\Api\ExtensionAttributesFactory), Object(Magento\Framework\Api\AttributeValueFactory), Object(Magento\Config\Model\ResourceModel\Config\Data), Object(Magento\Store\Model\ResourceModel\Store\CollectionFactory), Object(Magento\Store\Model\StoreManager), NULL, NULL, Array)\n#9 /vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Store\\M...', Array)\n#10 /vendor/magento/framework/ObjectManager/ObjectManager.php(56): Magento\Framework\ObjectManager\Factory\Compiled->create('Magento\\Store\\M...', Array)\n#11 /generated/code/Magento/Store/Model/GroupFactory.php(43): Magento\Framework\ObjectManager\ObjectManager->create('\\Magento\\Store\\...', Array)\n#12 /vendor/magento/module-store/Model/GroupRepository.php(66): Magento\Store\Model\GroupFactory->create(Array)\n#13 /vendor/magento/module-store/Model/StoreResolver/Website.php(61): Magento\Store\Model\GroupRepository->get('1')\n#14 /vendor/magento/module-store/Model/StoreResolver.php(140): Magento\Store\Model\StoreResolver\Website->getDefaultStoreId(NULL)\n#15 /vendor/magento/module-store/Model/StoreResolver.php(126): Magento\Store\Model\StoreResolver->readStoresData()\n#16 /vendor/magento/module-store/Model/StoreResolver.php(89): Magento\Store\Model\StoreResolver->getStoresData()\n#17 /vendor/magento/module-store/Model/StoreManager.php(157): Magento\Store\Model\StoreResolver->getCurrentStoreId()\n#18 /generated/code/Magento/Store/Model/StoreManagerInterface/Proxy.php(119): Magento\Store\Model\StoreManager->getStore(NULL)\n#19 /vendor/magento/module-store/Model/Resolver/Store.php(29): Magento\Store\Model\StoreManagerInterface\Proxy->getStore(NULL)\n#20 /vendor/magento/framework/App/Config/ScopeCodeResolver.php(49): Magento\Store\Model\Resolver\Store->getScope(NULL)\n#21 /vendor/magento/framework/App/Config.php(69): Magento\Framework\App\Config\ScopeCodeResolver->resolve('stores', NULL)\n#22 /vendor/magento/module-backend/App/Area/FrontNameResolver.php(102): Magento\Framework\App\Config->getValue('admin/url/use_c...', 'stores')\n#23 /vendor/magento/module-backend/App/Area/FrontNameResolver.php(85): Magento\Backend\App\Area\FrontNameResolver->isHostBackend()\n#24 /vendor/magento/framework/App/AreaList.php(73): Magento\Backend\App\Area\FrontNameResolver->getFrontName(true)\n#25 /vendor/magento/framework/App/Http.php(130): Magento\Framework\App\AreaList->getCodeByFrontName('adminqIAxcsi4Cc')\n#26 /vendor/magento/framework/App/Bootstrap.php(256): Magento\Framework\App\Http->launch()\n#27 /pub/index.php(37): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))\n#28 {main}","url":"/adminqIAxcsi4Cc","script_name":"/index.php"}

Main page of store does not throw any exception but when i navigate to other pages, it shows same exception. Admin panel also not working. I checked the directory:

Magento\TargetRule\Model\Indexer\TargetRule\Plugin

StoreGroup.php is present there.

any idea?

1

I'd experienced the same issue and after spending hours researching this I finally fixed it.

Could you tell me how did you deploy the module on production? Was it using the composer or FTP upload? IF it was composer, then I'd suggest reviewing it and making sure that it has the following information in your autoload section:

  "autoload": {
    "psr-4": {
        "Vendor\\ModuleName\\": ""
    },
    "files": [
        "registration.php"
    ]
}

You will need to add psr-4 to make it work. You can read more here: https://www.shoaibrehman.com/solved-fix-magento-2-plugin-class-vendormodulenameplugin-doesnt-exist/

Let me know if updating your composer file fixed the issue :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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