Reputation: 619
Yesterday I have tried to install Magento 2. When trying to access the front end I got plenty of errors both on the front end of the site and the Magento 2 admin. Since this is my first time I am not quite sure what are those errors and how to resolve them. Can you please help?
Storefront:
1 exception(s):
Exception #0 (UnexpectedValueException): Setup version for module 'MSP_AdminRestriction' is not specified
Exception #0 (UnexpectedValueException): Setup version for module 'MSP_AdminRestriction' is not specified #0 /home/ar26/projects/fv/html/vendor/magento/framework/Module/DbVersionInfo.php(56):
Magento\Framework\Module\DbVersionInfo->isModuleVersionEqual('MSP_AdminRestri...', '0.1.3')
#1 /home/ar26/projects/fv/html/vendor/magento/framework/Module/DbVersionInfo.php(79):
Magento\Framework\Module\DbVersionInfo->isSchemaUpToDate('MSP_AdminRestri...')
#2 /home/ar26/projects/fv/html/vendor/magento/framework/Module/Plugin/DbStatusValidator.php(55):
Magento\Framework\Module\DbVersionInfo->getDbVersionErrors()
#3 /home/ar26/projects/fv/html/vendor/magento/framework/Interception/Chain/Chain.php(67):
Magento\Framework\Module\Plugin\DbStatusValidator->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor),
Object(Closure), Object(Magento\Framework\App\Request\Http))
#4 /home/ar26/projects/fv/html/vendor/magento/framework/Interception/Chain/Chain.php(63):
Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor),
Array, 'front-controlle...')
#5 /home/ar26/projects/fv/html/vendor/magento/module-page-cache/Model/App/FrontController/VarnishPlugin.php(55):
Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http))
#6 /home/ar26/projects/fv/html/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\PageCache\Model\App\FrontController\VarnishPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor),
Object(Closure), Object(Magento\Framework\App\Request\Http))
#7 /home/ar26/projects/fv/html/vendor/magento/framework/Interception/Interceptor.php(138):
Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor),
Array, 'front-controlle...')
#8 /home/ar26/projects/fv/html/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(73):
Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#9 /home/ar26/projects/fv/html/vendor/magento/framework/Interception/Interceptor.php(142): Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor),
Object(Closure), Object(Magento\Framework\App\Request\Http))
#10 /home/ar26/projects/fv/html/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26):
Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
#11 /home/ar26/projects/fv/html/vendor/magento/framework/App/Http.php(135):
Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#12 /home/ar26/projects/fv/html/vendor/magento/framework/App/Bootstrap.php(258):
Magento\Framework\App\Http->launch()
#13 /home/ar26/projects/fv/html/pub/index.php(37): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
Magento Admin:
1 exception(s): Exception
#0 (UnexpectedValueException): Setup version for module 'MSP_AdminRestriction' is not specified
Exception #0 (UnexpectedValueException): Setup version for module 'MSP_AdminRestriction' is not specified
#0 /home/ar26/projects/fv/html/vendor/magento/framework/Module/DbVersionInfo.php(56):
Magento\Framework\Module\DbVersionInfo->isModuleVersionEqual('MSP_AdminRestri...', '0.1.3')
#1 /home/ar26/projects/fv/html/vendor/magento/framework/Module/DbVersionInfo.php(79):
Magento\Framework\Module\DbVersionInfo->isSchemaUpToDate('MSP_AdminRestri...')
#2 /home/ar26/projects/fv/html/vendor/magento/framework/Module/Plugin/DbStatusValidator.php(55):
Magento\Framework\Module\DbVersionInfo->getDbVersionErrors()
#3 /home/ar26/projects/fv/html/vendor/magento/framework/Interception/Interceptor.php(142):
Magento\Framework\Module\Plugin\DbStatusValidator->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor),
Object(Closure), Object(Magento\Framework\App\Request\Http))
#4 /home/ar26/projects/fv/html/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26):
Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
#5 /home/ar26/projects/fv/html/vendor/magento/framework/App/Http.php(135):
Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#6 /home/ar26/projects/fv/html/vendor/magento/framework/App/Bootstrap.php(258):
Magento\Framework\App\Http->launch()
#7 /home/ar26/projects/fv/html/pub/index.php(37): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#8 {main}
Upvotes: 0
Views: 1068
Reputation: 21
We have 3 ways to resolve this issue.
You can disable the module by command
php bin/magento module:disable Module_Name
php bin/magento setup:upgrade
php bin/magento setup:di:compile
you can edit app/etc/config.xml file and find your module by name and change status.
example:- 'Namespace_Modulename => 0,
Open Database and find "setup_module" table and remove your module entry Then you need to run below command
php bin/magento module:disable Module_Name
php bin/magento setup:upgrade
php bin/magento setup:di:compile
Upvotes: 1
Reputation: 106
Go to setup_module in DB, find MSP_AdminRestriction in records. either set version or just remove the record. then run php bin/magento setup:upgrade
Upvotes: 0
Reputation: 111
Check the setup_version node in the file module.xml of MSP_AdminRestriction Extension, whether its define correctly or not.
Here is an example of the module.xml file for the extension Flat_Toy
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" `xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">`
<module name="Flat_Toy" setup_version="1.0.0"/>
</config>
After verifying it run the commands :
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento s:s:d -f
Upvotes: 0
Reputation: 129
Please execute this command one by one,
php bin/magento setup:upgrade
If Magento version > 2.2
php bin/magento setup:static-content:deploy -f
If Magento version < 2.2
php bin/magento setup:static-content:deploy
Upvotes: 0
Reputation: 50
You will need to create a registration.php file to register your module.
In app/code/MSP/AdminRestriction/registration.php.
<?php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'MSP_AdminRestriction',
__DIR__
);
And fire below commond
php bin/magento module:enable MSP_AdminRestriction
php -f bin/magento setup:upgrade
Upvotes: 1
Reputation: 21
It is possible if you have a fail attempt with same root directory name. You can try it with different root directory name or flush browser cache and retry.
I was facing similar problem and it was resolved by following above steps.
Upvotes: 0
Reputation: 61
Open your database for this Magento and search the table
setup_module
In this table remove the follwoig module MSP_AdminRestriction and after that run the following commands.
php bin/magetno setup:upgrade
php bin/magetno setup:static-content:deploy -f
Upvotes: 3
Reputation: 315
Maybe you miss some files of this module.
Copy them from git https://github.com/magespecialist/m2-MSP_AdminRestriction?files=1
And run
bin/magento module:enable m2-MSP_AdminRestriction
bin/magento setup:upgrade
And if it's not in developing mode run also
bin/magento setup:di:compile
Upvotes: 0
Reputation: 93
Find in your m2 database, table "setup_module", delete record where module = 'MSP_AdminRestriction' Then, run: php bin/magetno setup:upgrade
Upvotes: 0
Reputation: 2959
I hope you have already added /app/code/Namespace/Module/registration.php
and /app/code/Namespace/Module/composer.json
files in your module folder.
So in your case, may be the file/folder permission is an error that could be resolved by changing the permission of the module folder
chmod 775 <module path> -R
Finally, run these commands to enable your module and upgrade setup (don't forget to replace Module_Name
with your module)
php -f bin/magento module:enable --clear-static-content Module_Name
bin/magento setup:upgrade
Another Solution
You can also specify your module name directly into app/etc/config.php
, if MSP_AdminRestriction
is not specified in config.php
then by adding below line
'MSP_AdminRestriction' => 1,
and run the command
bin/magento setup:upgrade
Hope this helps!
Upvotes: 0