skip to Main Content

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


  1. 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!

    Login or Signup to reply.
  2. 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

    Login or Signup to reply.
  3. Find in your m2 database, table “setup_module”, delete record where module = ‘MSP_AdminRestriction’
    Then, run:
    php bin/magetno setup:upgrade

    Login or Signup to reply.
  4. 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
    
    Login or Signup to reply.
  5. 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

    Login or Signup to reply.
  6. 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.

    Login or Signup to reply.
  7. You will need to create a registration.php file to register your module.

    In app/code/MSP/AdminRestriction/registration.php.

    <?php
    MagentoFrameworkComponentComponentRegistrar::register(
        MagentoFrameworkComponentComponentRegistrar::MODULE,
        'MSP_AdminRestriction',
        __DIR__
    );
    

    And fire below commond

     php bin/magento module:enable MSP_AdminRestriction
     php -f bin/magento setup:upgrade
    
    Login or Signup to reply.
  8. 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
    
    Login or Signup to reply.
  9. 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

    Login or Signup to reply.
  10. We have 3 ways to resolve this issue.

    1. 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

    2. you can edit app/etc/config.xml file and find your module by name and change status.

      example:- ‘Namespace_Modulename => 0,

    3. 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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search