skip to Main Content

Problem after installing Magento 2 Module

{"0":"Please upgrade your database: Run "bin/magento setup:upgrade" from the Magento root directory.nThe following modules are outdated:nMageplaza_Osc data: current version - none, required version - 2.1.8","1":"<pre>
        #1 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(&Magento\Framework\App\Request\Http#0000000027a6560e000000003be33d23#) called at [vendor/magento/framework/Interception/Interceptor.php:153]n
        #2 Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', array(&Magento\Framework\App\Request\Http#0000000027a6560e000000003be33d23#), array(array('default_store_se...', 'page_cache_from_...', 'storeCookieValid...', 'install', 'configHash'))) called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:26]n
        #3 Magento\Framework\App\FrontController\Interceptor->dispatch(&Magento\Framework\App\Request\Http#0000000027a6560e000000003be33d23#) called at [vendor/magento/framework/App/Http.php:137]n
        #4 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:24]n
        #5 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:261]n
        #6 Magento\Framework\App\Bootstrap->run(&Magento\Framework\App\Http\Interceptor#0000000027a6567c000000003be33d23#) called at [index.php:39]n</pre>","url":"/admin/cms/block/index/key/217e2153035ab5a787197eadf29e158a213eab4011673d6a912ec463dd32f224/","script_name":"/index.php"}

 

3

Answers


  1. "Please upgrade your database: Run …" means that there is a module registered in the component registrar (MagentoFrameworkComponentComponentRegistrar) (either in app/code/ or vendor/) which may not be found in the setup_module table or the row in the setup_module table associated with that module contains an outdated version.

    In the setup_module table there are 3 columns, the module, schema_version and data_version column. schema_version and data_version are compared to the module registered in the component registrar. If these do not match the "Please upgrade your database: Run…" message is outputted.

    I recommend looking in MagentoFrameworkModulePluginDbStatusValidator::beforeDispatch(FrontController, RequestInterface) to get to know more about the comparisons with schema_version and data_version.

    In short, to resolve the error you’re getting you should run bin/magento setup:upgrade which will update your database according to various install / upgrade scripts, data / schema patches and db_schema.xml configurations.

    Login or Signup to reply.
  2. After installing the Magento module it always disables by default.

    You can run below command from your setup root path via terminal or ssh console

    bin/magento module:status it will show the newly installed module in the disables list in your case it was Mageplaza onepage checkout module and display named as Mageplaza_Oscafter running this command.

    to enable the module you can use the below command.

    bin/magento module:enable Mageplaza_Osc and then fire below command.

    bin/magento setup:upgrade

    bin/magento setup:di:compile

    bin/magento setup:static-content:deploy -f

    setup upgrade will run upgrade command then the module will register the current install version and install require DB update and it only promotes this again when you installed a newer version of the module as in that case if there is any database related change so they can perform as well.

    Login or Signup to reply.
  3. Find your module version in the database with

    SELECT * from setup_module WHERE module_name="Mageplaza_Osc"
    

    Then edit associated columns with the correct version.

    Alternate solution

    Find your module version in the database with

    SELECT * from setup_module WHERE module_name="Mageplaza_Osc"
    

    Delete the row.

    Then bin/magento se:up.

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