0

I was recently trying to upgrade our Magento from 2.2.5 to Magento 2.2.7. I thought I succeeded but we're currently getting the following error:

There has been an error processing your request Exception printing is disabled by default for security reasons.

Error log record number: 335576744754

Having looked at this var log I can see the following message:

{"0":"Please update your modules: Run \"composer install\" from the Magento root directory.\nThe following modules are outdated:\nAmazon_Core db schema version: defined in codebase - 2.1.2, currently installed - 2.2.7\nAmazon_Core db data version: defined in codebase - 2.1.2, currently installed - 2.2.7\nAmazon_Login db schema version: defined in codebase - 2.1.1, currently installed - 2.2.7\nAmazon_Login db data version: defined in codebase - 2.1.1, currently installed - 2.2.7\nAmazon_Payment db schema version: defined in codebase - 2.1.1, currently installed - 2.2.7\nAmazon_Payment db data version: defined in codebase - 2.1.1, currently installed - 2.2.7\nKlarna_Core db schema version: defined in codebase - 4.5.2, currently installed - 4.5.6\nKlarna_Core db data version: defined in codebase - 4.5.2, currently installed - 4.5.6\nKlarna_Ordermanagement db schema version: defined in codebase - 4.4.1, currently installed - 4.4.2\nKlarna_Ordermanagement db data version: defined in codebase - 4.4.1, currently installed - 4.4.2\nKlarna_Kp db schema version: defined in codebase - 5.5.1, currently installed - 5.5.4\nKlarna_Kp db data version: defined in codebase - 5.5.1, currently installed - 5.5.4","1":"#0 /var/www/vhosts/mysite.com/httpdocs/vendor/magento/framework/Interception/Interceptor.php(121): Magento\Framework\Module\Plugin\DbStatusValidator->beforeDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Magento\Framework\App\Request\Http))\n#1 /var/www/vhosts/mysite.com/httpdocs/app/code/Infortis/Cgen/Plugin/Magento/Framework/App/FrontController.php(32): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))\n#2 /var/www/vhosts/mysite.com/httpdocs/vendor/magento/framework/Interception/Interceptor.php(135): Infortis\Cgen\Plugin\Magento\Framework\App\FrontController->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))\n#3 /var/www/vhosts/mysite.com/httpdocs/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))\n#4 /var/www/vhosts/mysite.com/httpdocs/generated/code/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)\n#5 /var/www/vhosts/mysite.com/httpdocs/vendor/magento/framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))\n#6 /var/www/vhosts/mysite.com/httpdocs/generated/code/Magento/Framework/App/Http/Interceptor.php(24): Magento\Framework\App\Http->launch()\n#7 /var/www/vhosts/mysite.com/httpdocs/vendor/magento/framework/App/Bootstrap.php(257): Magento\Framework\App\Http\Interceptor->launch()\n#8 /var/www/vhosts/mysite.com/httpdocs/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))\n#9 {main}","url":"/admin_adminname/","script_name":"/index.php"}

I've logged into SSH and tried to run "Composer install" but it says there is nothing to update.

I've tried numerous other commands including:

 php bin/magento setup:upgrade
 bin/magento cache:clean
 php -f bin/magento setup:static-content:deploy

Having looked in the "setup_module" table I can see that the versions in the table do not correspond with the versions in module manager as evidenced in the screenshot below

Screenshot

I could really use some advice if anyone knows how to resolve this

1

An easy solution to this, although it may not be conventional is to go to your websites database and find the setup_module table.

Find the modules that are causing the problems in the module column and change the schema_version and data_version columns appropriately.

Hope this helps.

You could also try having a look at your json.lock file, and changing the versions to what they should be and then deleting these modules and running composer install

  • Hi. Thanks. I'll look into that. I've uploaded a backup for now but obviously this is going to be an issue in the future. I'll continue to look into it. – CJNotts Jan 2 at 16:20
  • 1
    Hi. Tried to update again. Same thing happened but changing these values in the database seems to have fixed it. Thanks again for posting this solution. – CJNotts Jan 4 at 10:37
0

Your error message says your codebase is behind your database recorded version.

The following modules are outdated:\nAmazon_Core db schema version: defined in codebase - 2.1.2, currently installed - 2.2.7\nAmazon_Core db data version: defined in 

to remove the error, you need to tell your database that your versions are much earlier than this: In this case, do get n98-magerun2 script (from here)

and run n98-magerun2.phar sys:setup:downgrade-versions

Now, my worries is that your database was updated at a time you had another codebase and maybe there is another underlying issue.. but for now, the above should sort you out.

  • Hi. Thank you for replying but I'm afraid that this has not resolved the problem. – CJNotts Jan 2 at 15:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.