Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Running drush cache rebuild gives an error with Drupal core before 8.7.7.
drush cr
In InfoParserDynamic.php line 29:
Missing required keys (core) in modules/contrib/stage_file_proxy/stage_file_proxy.info.yml
Breaks config import as well.
Solution: upgrade your core or downgrade stage_file_proxy.
* use stage_file_proxy 8.x-1.0-beta1 for core < 8.7
* use stage_file_proxy 8.x-1.0-rc1 for core > 8.7.0 < 8.7.7
* use stage_file_proxy 8.x-1.0-rc2 for core >= 8.7.7
If drush won't enable stage_file_proxy saying "stage_file_proxy is incompatible with the Drupal version." then see this drush bug.
Comment | File | Size | Author |
---|---|---|---|
#19 | 3086276-core-dependency-like-this.patch | 619 bytes | greggles |
Comments
Comment #2
gregglesWhat version of core are you using?
Comment #3
gregglesFrom the release notes "Prevents some conflicts with outdated versions of core. If you need to use this module on an 8.6 site please use the 8.x-1.0-beta1 release."
Comment #4
davidburnsI'm also getting this error w/ Drupal core 8.7.7
Comment #5
SpokjeSeen it too on Core 8.7.8, then did a
composer require 'drupal/stage_file_proxy:1.0.0-rc1
explicitly to get a working version.Somehow after that
composer require 'drupal/stage_file_proxy:^1.0'
upgraded me to1.0.0-rc2
without the error.Thought I had made a mistake/typo/upset-the-composer-gods-somehow and thought nothing more of it.
Our agency has around around 25 other sites waiting for me to do this update, will see if it re-occurs.
Comment #6
greggles@davidburns and @Spokje - thanks for your insights. You're getting this with 8.x-1.0-rc1 or 8.x-1.0-rc2 release of this module?
Comment #7
gregglesHere's the steps I followed to start with a fresh site and rc1 on Drupal 8.7.9-dev, clear cache, move to rc2, clear cache and I didn't observe the problem. I wonder if it happens with core 8.7.7? If you upgrade core does the problem go away?
Comment #8
jespermb CreditAttribution: jespermb commentedWe have just experienced the same issue. We are using Drupal core 8.7.5 and after upgrading to RC2 we got this error. We upgraded from beta1.
Comment #9
gregglesUnfortunately, upgrading the code to be compatible with Drupal 9 means it's incompatible with Drupal <8.7.7. So the info file has been made incompatible with <8.7.7 to give an early notice of the problem.
I will try today to repeat my test steps with 8.7.5.
@jespermb I suggest upgrading to 8.7.7 if you can or downgrading stage file proxy to beta1.
Comment #10
Spokje@greggles FWIW: I've looked it up and I was at fault.
I did an update for stage_file_proxy beta1 => rc2 but the site was on D8.7.6, so there's why it gave the error message.
So you're absolutely on the money there ^
I've downgraded stage_file_proxy rc2 => rc1, that worked.
After that I've upgraded Core D8.7.6 => D8.7.8
Then I've upgraded stage_file_proxy rc1 => rc2 which then worked.
TLDR: I changed too much too fast.
Here's the root cause of _my_ problem, the module is fine, use rc1 when < 8.7.7, rc2 works flawlessly >= 8.7.7
Comment #11
gregglesThanks for the clarification/insight @Spokje.
One more thought: the #3084611: prepareDirectory vs file_prepare_directory breaks with core <8.7 issue is about conflicts with rc1 and <8.7. So a slight amendment to your last line:
* use beta1 when < 8.7
* use rc1 when > 8.7.0 < 8.7.7
* use rc2 >= 8.7.7
For the other people reporting issues - does that guide help? If so I'll put this on the project page and release notes.
Comment #12
jennypanighetti CreditAttribution: jennypanighetti commentedI just tried to enable 8.x-1.0-rc2 for my 8.7.7 site per your notes above, but it keeps telling me "stage_file_proxy is incompatible with the Drupal version."
Comment #13
gregglesThanks for the feedback, @jennypanighetti. I followed these steps just now to try to debug this issue:
0. In a Drupal core git working copy,
git checkout 8.7.7
1.
composer require 'drupal/stage_file_proxy:1.0.0-rc2
2.
drush site-install -y
3.
drush user-login
4. as admin, visit admin/modules
5. Confirm stage_file_proxy is 8.x-1.0-rc2
6. Enable stage_file_proxy via admin/modules in the web ui
7. I did not observe any errors
8. Ran a
drush cr
9. I did not observe any errors
Is there something more I should do?
I was able to get the issue to occur very quickly on 8.7.6:
Comment #14
larowlanFWIW the issue here is with 8.7.6
The .info.yml says system >=8.7 but it needs to be >=8.7.7
Composer facade shows rc1 compatible with any version of 8.7
Comment #15
greggles@larowlan, are you saying:
Should be:
And in composer.json
should be:
Comment #16
larowlanI think so, but pretty sure the composer.json is based off the .info.yml via the project composer facade
Comment #17
smazI'm getting this issue too (Drupal 8.7.8, stage file proxy 8.x-1.0-rc2). I'm just digging into it some more, but as an initial note:
The module only fails to install when being enabled via drush en stage_file_proxy. The module installs fine via the UI, or when enabled during a config import (we use config_split to only enable it on local versions).
Comment #18
smazYep, I've looked into this some more & can confirm it is a drush issue. Drush is explicitly requiring the core: key, which is wrong as it is no longer a fixed requirement.
Also note the string 'stage_file_proxy is incompatible with the Drupal version' is generated by drush, and not core (drush_pm_enable_validate(), '!name is incompatible with the !component version.').
I've opened an issue with drush for this:
https://github.com/drush-ops/drush/issues/4219
For those experiencing the issue, try enabling the module via the UI rather than with drush. You might also be able to try using Drupal Console, I had it work with the following:
I'm going to mark this as 'works as designed'.
Comment #19
gregglesx-posted with #18, agreed with it.
@smaz, I think that's a slightly different issue. I can also observe that on an 8.7.7 or 8.7.8 core when I enable via the web UI it installs fine, but enabling via drush gives the error "stage_file_proxy is incompatible with the Drupal version. [error]". That is apparently https://github.com/drush-ops/drush/issues/4219 as you've filed it over there :)
I think the issue that larowlan describes (the info and composer state compatability with >=8.7, although really only >=8.7.7 are supported) seem a bit different than the focus of the title of this issue, but it does seem worth fixing regardless.
I just asked in #contribute and per mglaman, mixologic, jhodgdon it seems that modules should generally provide their own composer.json files, though obviously they should be in sync with the info.yml. Attached patch attempts to make the files consistent with themselves and each other.
I also cleaned up the issue summary a bit to be a bit more helpful for folks who land on this issue.
Comment #20
smazAh, I got sidetracked as to drush being the issue because of everyone having the same error message.
Sorry for the title change again, but the core key isn't required & the patch is now just fixing up the info/composer requirements :)
Patch applies cleanly & looks good to me!
Comment #21
gregglesThanks for the review, @Smaz. I'll keep this at RTBC for a bit for more review/feedback.
Also I'm adjusting the title. I'd like to keep that error message in the title since even after this issue is "fixed" people are going to be searching for that error and wondering what to do (which is now in the issue summary).
Comment #22
DamienMcKennaFor anyone who wants to add it to their site's composer.json file's patches list, this just adds the 'core' line.
Comment #24
greggles@damienmckenna - can you clarify how that helps as opposed to just following one of these strategies:
* upgrade core to > 8.7.7 and use latest stage_file_proxy OR:
* use stage_file_proxy 8.x-1.0-beta1 for core < 8.7
* use stage_file_proxy 8.x-1.0-rc1 for core > 8.7.0 < 8.7.7
* use stage_file_proxy 8.x-1.0-rc2 for core >= 8.7.7
I've now committed this patch and updated the project page and the most recent releases.
Comment #25
gregglesForgot to update the status. I think this is as "fixed" as it can be. There are still situations where people need to take manual actions.
Comment #26
DamienMcKennaIt was meant as a stop-gap I needed while setting up a new project that also needed core updates, I wasn't intending it to be committed.
Comment #27
vuilThe issue still exists (Drupal core 8.2.6, stage_file_proxy: 8.x-1.0-rc2) before Drupal core update.
Please just add the required line
core: 8.x
in your main
.info
file. (A similar as #22)Thank you!
I post the error message after
drush cr
:Please see more here:
https://www.drupal.org/docs/8/creating-custom-modules/let-drupal-8-know-...
Comment #28
smazIf anyone is still having this issue, you'll need to use the patch from #22 until there is a new release of the module (rc3 I'm guessing). If you're using composer, take a look at https://github.com/cweagans/composer-patches for applying patches,
Comment #29
vuil#22 patch is wrong and it couldn't help.
The
.info.yml
file needscore: 8.x
instead ofcore: 8
only.I create a new one which works. Thank you!
Comment #30
DamienMcKennaThanks Vuil.
Of course, if you're still using Drupal core 8.2.6 you have other problems.
Comment #31
gregglesHi,
The info file is now right :) Please don't suggest changing it. Here are the solutions:
* upgrade core to > 8.7.7 and use latest stage_file_proxy OR:
* use stage_file_proxy 8.x-1.0-beta1 for core < 8.7
* use stage_file_proxy 8.x-1.0-rc1 for core > 8.7.0 < 8.7.7
* use stage_file_proxy 8.x-1.0-rc2 for core >= 8.7.7