Magento2: Error Message Is Confusing When Code Base Is Behind Database Module Version

Created on 24 Mar 2017  路  7Comments  路  Source: magento/magento2

Please upgrade your database: Run "bin/magento setup:upgrade" from the Magento root directory.
The following modules are outdated: Foo_Bar schema: current version - 1.0.4, required version - 1.0.0

Preconditions

This can happen when...

  • You download a database dump from a staging environment that has had code deployed to it which upgrades schema version (e.g. "develop" brand(
  • In your local environment, you are on the "master" branch, which is behind the database.

In this case running bin/magento setup:upgrade does not resolve the issue, and upgrading the database is not really correct (you actually need to downgrade).

Fixed in 2.2.x Fixed in 2.3.x Format is not valid Ready for Work needs update

All 7 comments

@mpchadwick Agreed. +1

While I generally agree the message given in this case is severely misleading, I'd like to make the following remark.

you actually need to downgrade

Wasn't sure whether to laugh or cry tears at this moment. DB downgrade is a potentially destructive oeration (imagine destroying a column having important information in it) and I don't see how is it a good idea to promote something like that in the messages (read: "instructions") given to the user.

IMHO what you most likely need in such a situation is _upgrade the module itself_ (with composer or from repo branch or wherever it's source code is) to the version required by the DB, thus a relevant message should look similar to the following:
Please upgrade your modules: Run "composer install" from the Magento root directory. The following modules are outdated: Foo_Bar current version - 1.0.0, required version - 1.0.4

@mpchadwick thank you for your feedback.
Please, format this issue according to the Issue reporting guidelines: with steps to reproduce, actual result and expected result.
Please, also identify which version of Magento you are running.

According to contributor guide, tickets without response for two weeks should be closed.
If this issue still reproducible please feel free to create the new one: format new issue according to the Issue reporting guidelines: with steps to reproduce, actual result and expected result and specify Magento version.

BTW This is also a duplicate of #9981.

Internal ticket to track issue progress: MAGETWO-80225

Hi @mpchadwick. Thank you for your report.
The issue has been fixed in magento-engcom/magento2ce#1353 by @magento-engcom-team in 2.3-develop branch
Related commit(s):

  • 299109f1265fa15eeb3067e22c2638ff5907205e
  • 57318bf03bf6fe7f84b2956ffb5ecc1332bf41b3
  • 41cd961a217d30c4b7b051a775902c4fb40b84ea
  • 076b90398852478d93d1444f936ac483b4640a82
  • 435a6c200cd548b8765e5bc73b0458039a58645d
  • 5d174b873f8ba369d6504fb9d7ef30296816e2b1
  • a47b10dce854a2d21ead6b362b86ca3ddf595386
  • ab48cb176830ddab69fd1617cae96d76094ab167
  • 46be4c7ea59f6cfb9884f2bc5875245b1960edc6
  • eafc6f0a473547542c3ef80352dcd2be7128da87
  • 63b9e909f1173a51374d4cdfc68249baa66f0007
  • 2edfe9a30bb64f0a7e102bb335a89658b627bfad
  • ef5ddffb43a735627d09535b62fac2a41804a96a
  • 4ada797ece84c2f5eb55499e8bc3f75e0c7ef245
  • c5d9a019b0d51a51b452fd99b527e3b894874be2
  • 72e9e0732b98ea5b8f47bddc781dc47c688c3c58
  • 215180de0a3f6c4a16e02205732bfe8670293ad2
  • 685d50625b68dbb960988a6bfbbfc14455a6cb9e

The fix will be available with the upcoming 2.3.0 release.

Was this page helpful?
0 / 5 - 0 ratings