0

I just created a custom module to add a metatag in a category page of our Magento site by making use of event and observer. When reloading the category page, below is the error I see. I re-ran the upgrade command but the error persists.

1 exception(s):
Exception #0 (Magento\Framework\Exception\LocalizedException): Please upgrade your database: Run "bin/magento setup:upgrade" from the Magento root directory.
The following modules are outdated:
Perfectmakeupmirrors_PmmHead schema: current version - none, required version - 0.0.1
Perfectmakeupmirrors_PmmHead data: current version - none, required version - 0.0.1

Exception #0 (Magento\Framework\Exception\LocalizedException): Please upgrade your database: Run "bin/magento setup:upgrade" from the Magento root directory. The following modules are outdated: Perfectmakeupmirrors_PmmHead schema: current version - none, required version - 0.0.1 Perfectmakeupmirrors_PmmHead data: current version - none, required version - 0.0.1 <pre>#1 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception{closure}() called at [vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php:71] #2 Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135] #3 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception{closure}() called at [vendor/swissup/module-amp/Plugin/Framework/FrontController.php:48] #4 Swissup\Amp\Plugin\Framework\FrontController->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135] #5 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153] #6 Magento\Framework\App\FrontController\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:23] #7 Magento\Framework\App\FrontController\Interceptor->dispatch() called at [vendor/magento/framework/App/Http.php:116] #8 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:23] #9 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:263] #10 Magento\Framework\App\Bootstrap->run() called at [pub/index.php:29] </pre>

CodeForGood
  • 764
  • 7
  • 31
  • check in your database with below query SELECT * FROM setup_module where module = "Perfectmakeupmirrors_PmmHead" – S.P May 16 '22 at 06:57
  • delete it and execute setup:upgrade command. – S.P May 16 '22 at 06:57
  • You mean delete that record from the table? – CodeForGood May 16 '22 at 07:26
  • yes, forbackup rename records and execute setup:upgrade command – S.P May 16 '22 at 07:41
  • S.P, thanks a lot. It got fixed. Final thing is the code you wrote to set noindex nofollow. I created a new post here https://stackoverflow.com/questions/72258894/setting-noindex-nofollow-in-a-category-page-of-magento-site . $this->request->getActionName() is returning "View" when I open that category page. – CodeForGood May 16 '22 at 12:21

1 Answers1

1

Keep your database backup before do it.

delete your module entry from setup_module table. Ex.

SELECT * FROM setup_module where module = "Perfectmakeupmirrors_PmmHead";
delete  FROM setup_module where module = "Perfectmakeupmirrors_PmmHead";

and execute php bin/magento setup:upgrade

S.P
  • 1,534
  • 11
  • 16
  • S.P, could you please answer my post on setting the noindex nofollow. The code in execute method doesn't seem to be doing the job. https://stackoverflow.com/questions/72258894/setting-noindex-nofollow-in-a-category-page-of-magento-site – CodeForGood May 16 '22 at 13:41
  • Hi Dhiren, could you please have a look at the related post here https://magento.stackexchange.com/questions/358323/magento-2-4-2-unable-to-process-binding-ifnot-functionreturn-customer-fu I'm struggling to fix this for over 10 days now. I added as much information about the problem as possible. – CodeForGood Jul 27 '22 at 18:50