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):
MagentoFrameworkModuleDbVersionInfo->isModuleVersionEqual('MSP_AdminRestri...', '0.1.3')
#1 /home/ar26/projects/fv/html/vendor/magento/framework/Module/DbVersionInfo.php(79):
MagentoFrameworkModuleDbVersionInfo->isSchemaUpToDate('MSP_AdminRestri...')
#2 /home/ar26/projects/fv/html/vendor/magento/framework/Module/Plugin/DbStatusValidator.php(55):
MagentoFrameworkModuleDbVersionInfo->getDbVersionErrors()
#3 /home/ar26/projects/fv/html/vendor/magento/framework/Interception/Chain/Chain.php(67):
MagentoFrameworkModulePluginDbStatusValidator->aroundDispatch(Object(MagentoFrameworkAppFrontControllerInterceptor),
Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#4 /home/ar26/projects/fv/html/vendor/magento/framework/Interception/Chain/Chain.php(63):
MagentoFrameworkInterceptionChainChain->invokeNext('Magento\Framewo...', 'dispatch', Object(MagentoFrameworkAppFrontControllerInterceptor),
Array, 'front-controlle...')
#5 /home/ar26/projects/fv/html/vendor/magento/module-page-cache/Model/App/FrontController/VarnishPlugin.php(55):
MagentoFrameworkInterceptionChainChain->MagentoFrameworkInterceptionChain{closure}(Object(MagentoFrameworkAppRequestHttp))
#6 /home/ar26/projects/fv/html/vendor/magento/framework/Interception/Chain/Chain.php(67): MagentoPageCacheModelAppFrontControllerVarnishPlugin->aroundDispatch(Object(MagentoFrameworkAppFrontControllerInterceptor),
Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#7 /home/ar26/projects/fv/html/vendor/magento/framework/Interception/Interceptor.php(138):
MagentoFrameworkInterceptionChainChain->invokeNext('Magento\Framewo...', 'dispatch', Object(MagentoFrameworkAppFrontControllerInterceptor),
Array, 'front-controlle...')
#8 /home/ar26/projects/fv/html/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(73):
MagentoFrameworkAppFrontControllerInterceptor->MagentoFrameworkInterception{closure}(Object(MagentoFrameworkAppRequestHttp))
#9 /home/ar26/projects/fv/html/vendor/magento/framework/Interception/Interceptor.php(142): MagentoPageCacheModelAppFrontControllerBuiltinPlugin->aroundDispatch(Object(MagentoFrameworkAppFrontControllerInterceptor),
Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#10 /home/ar26/projects/fv/html/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26):
MagentoFrameworkAppFrontControllerInterceptor->___callPlugins('dispatch', Array, Array)
#11 /home/ar26/projects/fv/html/vendor/magento/framework/App/Http.php(135):
MagentoFrameworkAppFrontControllerInterceptor->dispatch(Object(MagentoFrameworkAppRequestHttp))
#12 /home/ar26/projects/fv/html/vendor/magento/framework/App/Bootstrap.php(258):
MagentoFrameworkAppHttp->launch()
#13 /home/ar26/projects/fv/html/pub/index.php(37): MagentoFrameworkAppBootstrap->run(Object(MagentoFrameworkAppHttp))
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):
MagentoFrameworkModuleDbVersionInfo->isModuleVersionEqual('MSP_AdminRestri...', '0.1.3')
#1 /home/ar26/projects/fv/html/vendor/magento/framework/Module/DbVersionInfo.php(79):
MagentoFrameworkModuleDbVersionInfo->isSchemaUpToDate('MSP_AdminRestri...')
#2 /home/ar26/projects/fv/html/vendor/magento/framework/Module/Plugin/DbStatusValidator.php(55):
MagentoFrameworkModuleDbVersionInfo->getDbVersionErrors()
#3 /home/ar26/projects/fv/html/vendor/magento/framework/Interception/Interceptor.php(142):
MagentoFrameworkModulePluginDbStatusValidator->aroundDispatch(Object(MagentoFrameworkAppFrontControllerInterceptor),
Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#4 /home/ar26/projects/fv/html/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26):
MagentoFrameworkAppFrontControllerInterceptor->___callPlugins('dispatch', Array, Array)
#5 /home/ar26/projects/fv/html/vendor/magento/framework/App/Http.php(135):
MagentoFrameworkAppFrontControllerInterceptor->dispatch(Object(MagentoFrameworkAppRequestHttp))
#6 /home/ar26/projects/fv/html/vendor/magento/framework/App/Bootstrap.php(258):
MagentoFrameworkAppHttp->launch()
#7 /home/ar26/projects/fv/html/pub/index.php(37): MagentoFrameworkAppBootstrap->run(Object(MagentoFrameworkAppHttp))
#8 {main}
10
Answers
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
Finally, run these commands to enable your module and upgrade setup (don’t forget to replace
Module_Name
with your module)Another Solution
You can also specify your module name directly into
app/etc/config.php
, ifMSP_AdminRestriction
is not specified inconfig.php
then by adding below lineand run the command
Hope this helps!
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
Find in your m2 database, table “setup_module”, delete record where module = ‘MSP_AdminRestriction’
Then, run:
php bin/magetno setup:upgrade
Maybe you miss some files of this module.
Copy them from git https://github.com/magespecialist/m2-MSP_AdminRestriction?files=1
And run
And if it’s not in developing mode run also
Open your database for this Magento and search the table
In this table remove the follwoig module MSP_AdminRestriction and after that run the following commands.
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.
You will need to create a registration.php file to register your module.
In app/code/MSP/AdminRestriction/registration.php.
And fire below commond
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
After verifying it run the commands :
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
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