Problem/Motivation
Updating ultimate cron module on a Drupal 9 site then running drush updb will result in the following error:
[error] (Currently using Incompatible module The following module is installed, but it is incompatible with Drupal 9.5.11:
* Ultimate Cron
Review the suggestions for resolving this incompatibility [1] to repair your
installation, and then re-run update.php.
This is because there's a core version requirement mismatch between ultimate_cron.info.yml and composer.json introduced by Issue #3435200: Automated Drupal 11 compatibility fixes for ultimate_cron.
Composer will allow updating ultimate cron to 8.x-2.0-alpha8 on a Drupal 9 site while the info file has a different core version requirement.
Since I believe 8.x-2.0-alpha8 is still actually compatible with Drupal 9, we need to update the core_version_requirement in the info file to match what's in composer.json.
If I'm mistaken, and 8.x-2.0-alpha8 is incompatible with Drupal 9, then we need to do the opposite and update the required core version in composer.json.
Steps to reproduce
- With a Drupal 9 site.
- Update ultimate cron with composer.
- Notice how ultimate cron will be updated to
8.x-2.0-alpha8without any issue. - Run
drush updb. - Notice the error.
Proposed resolution
Match core version requirement in ultimate_cron.info.yml with what's in composer.json.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | ultimate_cron-3488161.patch | 1.31 KB | redwan jamous |
Issue fork ultimate_cron-3488161
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
redwan jamous commentedBased on the changes in the below commit, I think the correct version requirement should be
^9.3 || ^10.1 || ^11.https://git.drupalcode.org/project/ultimate_cron/-/commit/c003090f0c7352...
I also updated drush versions in composer.json based on Drupal X Drush compatibility table .
Comment #4
redwan jamous commentedUploading a static patch file to use with composer-patches...
Comment #5
berdirIt's not possible change a release, so that can't be undone, we can do a new release, but there is no way to tell composer that alpha8 is actually Drupal 9 compatible.
I assumed drupal.org overwrites the composer.json info but maybe not if it's already there. One option would be to just remove the line in composer.json.
Let me know if this actually works for you then, or also just stick to alpha7, keep in mind that Drupal is EOL since 1 year now.
Comment #6
redwan jamous commentedThank you @berdir!
I understand we cannot undo released changes, but I was thinking of doing a new release so that people who already faced this problem can resolve it by updating, and to ensure other Drupal 9 projects do not face this problem.
We can remove the line from composer.json, it should work, but what about the change in the info file? will we keep Drupal 9 unsupported?
We're trying our best to upgrade our project, but for some reasons we can't do it now, but thanks for mentioning it.
Comment #7
berdirIf it really is still compatible with D9 then I'm open to doing a new release with that fixed, but will need to review the changes in alpha8 to see if that's really the case.
> We're trying our best to upgrade our project, but for some reasons we can't do it now, but thanks for mentioning it.
Yeah, I can understand that this can happen with some dependencies and so on. But then I'd be very, very careful with contrib updates and only update what you have to. Because the opposite of this issue is sooner or later going to cause bigger issues for you than this, you saw this immediately. But a module that claims to be D9 compatible and actually isn't anymore is going to be annoying.
Comment #11
berdirDidn't see anything in alpha8 that would be broken on D9, so merging. There was an existing issue doing the opposite #3469076: D9 sites are fetching 2.0.0-alpha8 when running composer update but the advantage is that this actually fixes composer and you can by default get a valid version.
That said, #7 is still valid, if something breaks I'll just bump the min version, D9 isn't really supported anymore.