2

I drew a mysqldump from a site built with a composer.json file reading in relevant part:

     "require": {
        "composer-plugin-api": "^1.1",
         "civicrm/civicrm-asset-plugin": "^1.0",
         "civicrm/civicrm-drupal-8": "^5.24.0",
         "civicrm/civicrm-packages": "^5.24.0",

the footer indicates that it installed:

Powered by CiviCRM 5.28.alpha1

Reinstalling this same composer file is now giving me a footer reading:

Powered by CiviCRM 5.27.0.

and a 'CiviCRM System Status' page reading:

Database In Unexpected Version

Your database is marked with an unexpected version number: 5.28.alpha1. 
The v codebase may not be compatible with your database state. You will 
need to determine the correct version corresponding to your current 
database state. You may want to revert to the codebase you were using 
until you resolve this problem.

OR if this is a manual install from git, you might want to fix civicrm-version.php file. 

my attempts to update the composer.json and rebuild the site, with these settings:

     "require": {
        "composer-plugin-api": "^1.1",
         "civicrm/civicrm-asset-plugin": "^1.0",
         "civicrm/civicrm-drupal-8": "^5.28.alpha1",
         "civicrm/civicrm-packages": "^5.28.alpha1",

are resulting in an installation reporting in the footer, that:

Powered by CiviCRM 5.27.0.

and the same database is marked with an unexpected version number error.

Any thoughts on how I might resolve this would be appreciated. Several hours of work have been invested in the 5.28.alpha1 version of the database I am working to restore.

Thank you for your consideration, -- Hugh Esco

UPDATE:

I updated by composer.json to read:

        "civicrm/civicrm-drupal-8": "^5.28.x-dev",
        "civicrm/civicrm-packages": "^5.28.x-dev",

which yielded this output in my jenkins console:

Notice: /Stage[main]/Ymd_apache2::Drupal::Install::Composer/Exec
[composer_install_drupal_for-example.com]/returns:     - 
The requested package civicrm/civicrm-packages ^5.28.x-dev 
exists as civicrm/civicrm-packages[4.4.17, 4.4.18, 4.4.19, 
4.4.20, 4.4.21, 4.4.x-dev, 4.5.0, 4.5.1, 4.5.2, 4.5.3, 4.5.4, 
4.5.5, 4.5.6, 4.5.7, 4.5.8, 4.5.alpha1, 4.5.alpha2, 4.5.beta1, 
4.5.beta2, 4.5.beta3, 4.5.beta4, 4.5.beta5, 4.5.beta6, 4.5.beta7, 
4.5.beta8, 4.5.beta9, 4.5.x-dev, 4.7.31, 5.0.0, 5.0.1, 5.0.2, 
5.0.x-dev, 5.1.0, 5.1.1, 5.1.2, 5.1.x-dev, 5.10.0, 5.10.1, 
5.10.2, 5.10.3, 5.10.4, 5.10.x-dev, 5.11.0, 5.11.x-dev, 5.12.0, 
5.12.1, 5.12.2, 5.12.3, 5.12.4, 5.12.x-dev, 5.13.0, 5.13.1, 
5.13.2, 5.13.3, 5.13.4, 5.13.5, 5.13.x-dev, 5.14.0, 5.14.1, 
5.14.2, 5.14.x-dev, 5.15.0, 5.15.1, 5.15.2, 5.15.x-dev, 5.16.0, 
5.16.1, 5.16.2, 5.16.3, 5.16.4, 5.16.x-dev, 5.17.0, 5.17.1, 
5.17.2, 5.17.3, 5.17.4, 5.17.5, 5.17.x-dev, 5.18.0, 5.18.1, 
5.18.2, 5.18.3, 5.18.4, 5.18.x-dev, 5.19.0, 5.19.1, 5.19.2, 
5.19.3, 5.19.4, 5.19.x-dev, 5.2.0, 5.2.1, 5.2.2, 5.2.x-dev, 
5.20.0, 5.20.1, 5.20.2, 5.20.3, 5.20.x-dev, 5.21.0, 5.21.1, 
5.21.2, 5.21.x-dev, 5.22.0, 5.22.1, 5.22.x-dev, 5.23.0, 5.23.1, 
5.23.2, 5.23.3, 5.23.4, 5.23.x-dev, 5.24.0, 5.24.1, 5.24.2, 
5.24.3, 5.24.4, 5.24.5, 5.24.6, 5.24.x-dev, 5.25.0, 5.25.x-dev, 
5.26.0, 5.26.1, 5.26.2, 5.26.x-dev, 5.27.0, 5.27.x-dev, 

5.28.x-dev, 

5.3.0, 5.3.1, 5.3.2, 5.3.x-dev, 5.4.0, 5.4.1, 5.4.x-dev, 5.5.0, 
5.5.1, 5.5.2, 5.5.3, 5.5.x-dev, 5.6.0, 5.6.1, 5.6.x-dev, 5.7.0, 
5.7.1, 5.7.2, 5.7.3, 5.7.x-dev, 5.8.0, 5.8.1, 5.8.2, 5.8.x-dev, 
5.9.0, 5.9.1, 5.9.x-dev, dev-4.7.31-rc, dev-master] 
but these are rejected by your constraint.
Error: '/usr/bin/php -d memory_limit=512M 
/usr/local/bin/composer update \
  --ignore-platform-reqs \
  --no-plugins \
  && /usr/bin/php -d memory_limit=512M \
  /usr/local/bin/composer install' 
returned 2 instead of one of [0]
Error: /Stage[main]/Ymd_apache2::Drupal::Install::Composer/Exec
[composer_install_drupal_for-example.com]/returns: change from 
'notrun' to ['0'] failed: 
'/usr/bin/php -d memory_limit=512M \
/usr/local/bin/composer update \
  --ignore-platform-reqs \
  --no-plugins \
  && /usr/bin/php -d memory_limit=512M \
  /usr/local/bin/composer install' 
returned 2 instead of one of [0]

Next I will test with an explicit version, rather than the caret, to see if that works any better.

*UPDATE #2:

No, that does not seem to work, whether setting the CiviCRM versions in composer.json to ^5.28.x-dev or explicitly to 5.28.x-dev, I still get Powered by CiviCRM 5.27.0. in the footer and the System Status Error reporting: Database in Unexpected Version.

UPDATE #3:

. . . to provide slightly more context on my composer.json file. This is all it requires, package wise.

    "require": {
        "composer-plugin-api": "^1.1",
        "civicrm/civicrm-asset-plugin": "^1.0",
        "civicrm/civicrm-drupal-8": "5.28.x-dev",
        "civicrm/civicrm-packages": "5.28.x-dev",
        "civicrm/cv": "^0.3.2",
        "composer/installers": "^1.2",
        "cweagans/composer-patches": "^1.6.5",
        "drupal/core-composer-scaffold": "^8.8.4",
        "drupal/core-recommended": "^8.8.4"
    },
    "require-dev": {
        "drupal/core-dev": "^8.8.4"
    },
    "conflict": {
        "drupal/drupal": "*"
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "config": {
        "sort-packages": true,
        "preferred-install": "dist",
        "autoloader-suffix": "Drupal8"
    },

I wonder, does accessing: 5.28.x-dev requires that I add some repo other than: https://packages.drupal.org/8?

UPDATE #4:

Demerit: I regret only that I had but a single upvote to share with you, kind sir. composer require "civicrm/civicrm-core:5.28.x-dev" did the trick. Your coaching here has given me further insight into the operation of composer. Now instead of a 'System Status Error', I am seeing a 'System Status Alert' that a 'Database Upgrade (is) Required'. Now, that is something I know how to address. Thank you very much for walking me through this.

This seems to have done the trick.
Had to add civicrm-core explicitly to make things all happy.

composer require "civicrm/civicrm-core:5.28.x-dev"
composer require "civicrm/civicrm-drupal-8:5.28.x-dev"
composer require "civicrm/civicrm-packages:5.28.x-dev"
  • Just did another build with the composer specifying: "^5.28.beta1", and wound up with Powered by CiviCRM 5.27.0. in the footer and Database in Unexpected Version system error when I first open CiviCRM. The nightly build is at version 5.29.alpha1. Nightly builds tend to be a bit bleeding edge for my tastes, at least for a production site. Eager for other means for resolving this issue. – Hugh Esco Jul 5 at 1:12
2

Try "5.28.x-dev" instead of alpha1 or beta1. Packagist uses different ways to specify the version numbers. https://packagist.org/packages/civicrm/civicrm-drupal-8

| improve this answer | |
  • Thank you. That was helpful, but as described in the update above, did not get me to the promised land, although I am confused as to why now. Reading the error message in jenkins console suggests this should have worked. – Hugh Esco Jul 6 at 16:02
  • No, that does not seem to work, whether setting the CiviCRM versions in composer.json to ^5.28.x-dev or explicitly to 5.28.x-dev, I still get Powered by CiviCRM 5.27.0. in the footer and the 'System Status Error' reporting: 'Database in Unexpected Version'. – Hugh Esco Jul 6 at 16:56
  • Did you get past the jenkins error? Where it says but these are rejected by your constraint that might now be because you have entries in composer.lock for other packages that are conflicting, so you would need to add/update those in composer.json, e.g. possibly composer.lock has civicrm-core:5.27. You could also try my last-resort method of making a new blank site and copying stuff over: civicrm.stackexchange.com/a/33949/181 – Demerit Jul 6 at 17:09
  • To be clear, that message, but these are rejected by your constraint, is bubbling up from composer, through the puppet agent, and back to the jenkins console. The error really has nothing to do with either puppet nor jenkins. I just use those to wrap my deployment process so I get a repeatable and debug-able process. Every time I deploy this I am getting a fresh install. The code I deploy has a composer.json, but no composer.lock committed to the repository. The lock file created by the deployment shows: civicrm/civicrm-core at 5.27.0. – Hugh Esco Jul 6 at 21:01
  • I'd add civicrm-core:5.28.x-dev to composer.json, otherwise it might prefer 5.27 for core. – Demerit Jul 6 at 21:57

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.