drush icon indicating copy to clipboard operation
drush copied to clipboard

"stat failed" warnings with 8.4.10

Open AohRveTPV opened this issue 3 years ago • 18 comments

PHP 7.3.29, Drupal 7. Warnings do not occur with Drush 8.4.9.

[redacted@redacted drupal]$ drush ws
stat(): stat failed for phar:///home/redacted/.local/bin/drush/.box/bin/sites/all/modules/webform/webform.drush.inc PharStreamWrapper.php:487                                        [warning]
stat(): stat failed for phar:///home/redacted/.local/bin/drush/.box/bin/sites/all/modules/browscap/browscap.drush.inc PharStreamWrapper.php:487                                      [warning]
stat(): stat failed for phar:///home/redacted/.local/bin/drush/.box/bin/sites/all/modules/ctools/drush/ctools.drush.inc PharStreamWrapper.php:487                                    [warning]
stat(): stat failed for phar:///home/redacted/.local/bin/drush/.box/bin/sites/all/modules/filefield_paths/filefield_paths.drush.inc PharStreamWrapper.php:487                        [warning]
stat(): stat failed for phar:///home/redacted/.local/bin/drush/.box/bin/sites/all/modules/rules/rules_scheduler/rules_scheduler.drush.inc PharStreamWrapper.php:487                  [warning]
stat(): stat failed for phar:///home/redacted/.local/bin/drush/.box/bin/sites/all/modules/security_review/security_review.drush.inc PharStreamWrapper.php:487                        [warning]
stat(): stat failed for phar:///home/redacted/.local/bin/drush/.box/bin/sites/all/modules/token/token.drush.inc PharStreamWrapper.php:487                                            [warning]
stat(): stat failed for phar:///home/redacted/.local/bin/drush/.box/bin/sites/all/modules/update_advanced/update_advanced.drush.inc PharStreamWrapper.php:487                        [warning]
stat(): stat failed for phar:///home/redacted/.local/bin/drush/.box/bin/sites/all/modules/views/drush/views.drush.inc PharStreamWrapper.php:487                                      [warning]
stat(): stat failed for phar:///home/redacted/.local/bin/drush/.box/bin/sites/all/modules/rules/rules.drush.inc PharStreamWrapper.php:487                                            [warning]
 ID      Date          Type      Severity  Message                              
 615749  04/Jan 08:17  cron      notice    Cron run completed.                  
 615748  04/Jan 08:17  browscap  notice    No new version of browscap to import 
 615747  04/Jan 08:17  browscap  notice    Checking for new browscap version... 
 615746  04/Jan 07:17  cron      notice    Cron run completed.                  
 615745  04/Jan 07:17  browscap  notice    No new version of browscap to import 
 615744  04/Jan 07:17  browscap  notice    Checking for new browscap version... 
 615743  04/Jan 06:17  cron      notice    Cron run completed.                  
 615742  04/Jan 06:17  browscap  notice    No new version of browscap to import 
 615741  04/Jan 06:17  browscap  notice    Checking for new browscap version... 
 615740  04/Jan 05:17  cron      notice    Cron run completed.

I'd be glad to provide any other information that might be helpful.

AohRveTPV avatar Jan 04 '22 14:01 AohRveTPV

Same problem. Appears to only affect PHAR builds of 8.4.10 on some versions of php 7.x:

Outcome PHP drush
✅ OK php 7.2.23 8.4.9 , drush.phar
🛑 Bug php 7.2.23 8.4.10, drush.phar
✅ OK php 7.2.23 8.4.10, drush extracted (phar extract -f drush-8.4.10.phar)
✅ OK php 7.4.26 8.4.10, drush.phar
✅ OK php 8.0.5 8.4.10, drush.phar

I don't currently have a 7.2.x interpreter on my local dev-env, but I hacked a test VM to get a backtrace:

#0  TYPO3\PharStreamWrapper\PharStreamWrapper->invokeInternalStreamWrapper(stat, phar:///home/jenkins/bknix-min/build/tmp-1-1/web/tmp-8.4.10.phar/.box/bin/sites/all/modules/civicrm/drupal/drush/civicrm.drush.inc) called at [/home/jenkins/bknix-min/build/tmp-1-1/web/misc/typo3/phar-stream-wrapper/src/PharStreamWrapper.php:410]
#1  TYPO3\PharStreamWrapper\PharStreamWrapper->url_stat(phar:///home/jenkins/bknix-min/build/tmp-1-1/web/tmp-8.4.10.phar/.box/bin/sites/all/modules/civicrm/drupal/drush/civicrm.drush.inc, 0) called at [phar:///home/jenkins/bknix-min/build/tmp-1-1/web/tmp-8.4.10.phar/lib/Drush/Command/Commandfiles.php:63]
#2  require_once() called at [phar:///home/jenkins/bknix-min/build/tmp-1-1/web/tmp-8.4.10.phar/lib/Drush/Command/Commandfiles.php:63]
#3  Drush\Command\Commandfiles->add(sites/all/modules/civicrm/drupal/drush/civicrm.drush.inc) called at [phar:///home/jenkins/bknix-min/build/tmp-1-1/web/tmp-8.4.10.phar/includes/command.inc:1658]
#4  _drush_add_commandfiles(Array ([0] => modules/block,[1] => sites/all/modules/civicrm/tools/drupal/modules/civicrm_webtest,[2] => modules/color,[3] => modules/comment,[4] => modules/contextual,[5] => modules/dashboard,[6] => modules/field,[7] => modules/field/modules/field_sql_storage,[8] => modules/field_ui,[9] => modules/file,[10] => modules/filter,[11] => modules/help,[12] => modules/image,[13] => modules/field/modules/list,[14] => modules/locale,[15] => modules/menu,[16] => modules/node,[17] => modules/field/modules/number,[18] => modules/field/modules/options,[19] => modules/path,[20] => modules/rdf,[21] => modules/search,[22] => modules/shortcut,[23] => modules/system,[24] => modules/taxonomy,[25] => modules/field/modules/text,[26] => modules/toolbar,[27] => modules/update,[28] => modules/user,[29] => sites/all/modules/civicrm/drupal,[30] => modules/dblog,[31] => themes/bartik,[32] => themes/garland,[33] => themes/seven), 5) called at [phar:///home/jenkins/bknix-min/build/tmp-1-1/web/tmp-8.4.10.phar/includes/command.inc:1595]
#5  _drush_find_commandfiles(5, 7) called at [phar:///home/jenkins/bknix-min/build/tmp-1-1/web/tmp-8.4.10.phar/includes/bootstrap.inc:358]
#6  drush_bootstrap(5, 7) called at [phar:///home/jenkins/bknix-min/build/tmp-1-1/web/tmp-8.4.10.phar/includes/bootstrap.inc:509]
#7  drush_bootstrap_max() called at [phar:///home/jenkins/bknix-min/build/tmp-1-1/web/tmp-8.4.10.phar/includes/bootstrap.inc:456]
#8  drush_bootstrap_to_phase(-2) called at [phar:///home/jenkins/bknix-min/build/tmp-1-1/web/tmp-8.4.10.phar/lib/Drush/Boot/BaseBoot.php:59]
#9  Drush\Boot\BaseBoot->bootstrap_and_dispatch() called at [phar:///home/jenkins/bknix-min/build/tmp-1-1/web/tmp-8.4.10.phar/includes/preflight.inc:67]
#10 drush_main() called at [phar:///home/jenkins/bknix-min/build/tmp-1-1/web/tmp-8.4.10.phar/includes/startup.inc:465]
#11 drush_run_main(, /, Phar detected. Proceeding to drush_main().) called at [phar:///home/jenkins/bknix-min/build/tmp-1-1/web/tmp-8.4.10.phar/includes/startup.inc:369]
#12 drush_startup(Array ([0] => ./tmp-8.4.10.phar,[1] => ev,[2] => echo "123\n";)) called at [phar:///home/jenkins/bknix-min/build/tmp-1-1/web/tmp-8.4.10.phar/drush:114]
#13 require(phar:///home/jenkins/bknix-min/build/tmp-1-1/web/tmp-8.4.10.phar/drush) called at [/home/jenkins/bknix-min/build/tmp-1-1/web/tmp-8.4.10.phar:14]
stat(): stat failed for phar:///home/jenkins/bknix-min/build/tmp-1-1/web/tmp-8.4.10.phar/.box/bin/sites/all/modules/civicrm/drupal/drush/civicrm.drush.inc            [warning]
PharStreamWrapper.php:488

To my eye, the path is somehow misinterpreted between line #3 and line #1:

#1 ... PharStreamWrapper->url_stat(phar:///home/jenkins/bknix-min/build/tmp-1-1/web/tmp-8.4.10.phar/.box/bin/sites/all/modules/civicrm/drupal/drush/civicrm.drush.inc ...
#3 ... Commandfiles->add(sites/all/modules/civicrm/drupal/drush/civicrm.drush.inc ...

i.e. the relative path (sites/all/modules/...) gets converted to an absolute path, but the absolute form has the wrong base (phar:///path/to/drush.phar)

totten avatar Jan 06 '22 04:01 totten

Perhaps caused by https://github.com/drush-ops/drush/pull/4860, or the upgrade to box 3.

greg-1-anderson avatar Jan 06 '22 13:01 greg-1-anderson

Can confirm same problem with drush 8.4.10 and PHP 7.3.

Drush 8.4.9 and PHP 7.3 work fine.

Fonant avatar Jan 13 '22 11:01 Fonant

Drush 8.4.10 and PHP 5.6 is affected.

nevergone avatar Feb 04 '22 23:02 nevergone

Can reproduce with drush 8.4.10, Drupal 7, PHP cli version 7.4.28.

John-B avatar Mar 16 '22 08:03 John-B

I was surprised to see this. I imagine it's not an actual problem? Seems to happen with drush cron always. It's ironic that the release of 8.4.10 was for "Fix problems with .phar build on PHP 8.0 and 8.1"

rfay avatar May 18 '22 12:05 rfay

I haven't had a lot of time to maintain Drush 8. The new phar build was a community contribution; it made the phar a lot smaller. I could go back to the old phar builder.

greg-1-anderson avatar May 18 '22 13:05 greg-1-anderson

Not sure if that's actually an option, though; the old phar might not work on PHP 8+

greg-1-anderson avatar May 18 '22 13:05 greg-1-anderson

Thanks for all the maintenance you do everywhere!

rfay avatar May 18 '22 13:05 rfay

This is not fixed in 8.4.11; this is installed with download of drush.phar and installing as /usr/local/bin/drush and making it executable, nothing else.

$ drush --version
 Drush Version   :  8.4.11

$ drush cron
stat(): stat failed for                                                                                      [warning]
phar:///usr/local/bin/drush/.box/bin/sites/all/modules/backup_migrate/includes/backup_migrate.drush.inc
PharStreamWrapper.php:487
stat(): stat failed for phar:///usr/local/bin/drush/.box/bin/sites/all/modules/ctools/drush/ctools.drush.inc [warning]
PharStreamWrapper.php:487
stat(): stat failed for phar:///usr/local/bin/drush/.box/bin/sites/all/modules/token/token.drush.inc         [warning]
PharStreamWrapper.php:487
stat(): stat failed for                                                                                      [warning]
phar:///usr/local/bin/drush/.box/bin/sites/all/modules/views_bulk_operations/views_bulk_operations.drush.inc
PharStreamWrapper.php:487
stat(): stat failed for phar:///usr/local/bin/drush/.box/bin/sites/all/modules/views/drush/views.drush.inc   [warning]
PharStreamWrapper.php:487
stat(): stat failed for                                                                                      [warning]
phar:///usr/local/bin/drush/.box/bin/sites/all/themes/adaptivetheme/at_core/adaptivetheme.drush.inc
PharStreamWrapper.php:487
Cron run successful.

rfay avatar Jun 02 '22 22:06 rfay

8.4.11 just has one fix for drush make. Not sure what the cause of the stat failed errors are. Note that the .box directory is not needed by Drush and not requested to be added to the drush.phar file. PRs welcome if anyone has any ideas.

greg-1-anderson avatar Jun 02 '22 23:06 greg-1-anderson

I was thinking about rolling back the DDEV drush-in-web-container version to 8.4.9 (drush8 is provided in DDEV only for D6/D7 really, it's not linked in later versions). But would that deprive people of the new drush make fix? A user reports in https://github.com/drud/ddev/issues/1999 that drush vget is also fixed by 8.4.11, but I'm not sure when it would have been broken.

rfay avatar Jun 03 '22 00:06 rfay

I would guess this is a box incompatibility with PHP < 7.4. When I run an strace on PHP 7.3 and 7.4, I get this:

...
stat("/usr/local/bin/drush-8.4.11.phar/commands/core/views.d8.drush.inc", 0x7ffeda8bd7a0) = -1 ENOTDIR (Not a directory)
stat("/usr/local/bin/drush-8.4.11.phar/commands/core", 0x7ffeda8bd7a0) = -1 ENOTDIR (Not a directory)
stat("/usr/local/bin/drush-8.4.11.phar/commands", 0x7ffeda8bd7a0) = -1 ENOTDIR (Not a directory)
stat("/usr/local/bin/drush-8.4.11.phar", {st_mode=S_IFREG|0755, st_size=1344027, ...}) = 0
access("profiles/hostmaster/modules/contrib/views_bulk_operations/views_bulk_operations.drush.inc", F_OK) = 0
stat("/usr/local/bin/drush-8.4.11.phar/.box/bin/profiles/hostmaster/modules/contrib/views_bulk_operations/views_bulk_operations.drush.inc", 0x7ffeda8bb7a0) = -1 ENOTDIR (Not a directory)
stat("/usr/local/bin/drush-8.4.11.phar/.box/bin/profiles/hostmaster/modules/contrib/views_bulk_operations", 0x7ffeda8bb7a0) = -1 ENOTDIR (Not a directory)
stat("/usr/local/bin/drush-8.4.11.phar/.box/bin/profiles/hostmaster/modules/contrib", 0x7ffeda8bb7a0) = -1 ENOTDIR (Not a directory)
stat("/usr/local/bin/drush-8.4.11.phar/.box/bin/profiles/hostmaster/modules", 0x7ffeda8bb7a0) = -1 ENOTDIR (Not a directory)
stat("/usr/local/bin/drush-8.4.11.phar/.box/bin/profiles/hostmaster", 0x7ffeda8bb7a0) = -1 ENOTDIR (Not a directory)
stat("/usr/local/bin/drush-8.4.11.phar/.box/bin/profiles", 0x7ffeda8bb7a0) = -1 ENOTDIR (Not a directory)
stat("/usr/local/bin/drush-8.4.11.phar/.box/bin", 0x7ffeda8bb7a0) = -1 ENOTDIR (Not a directory)
stat("/usr/local/bin/drush-8.4.11.phar/.box", 0x7ffeda8bb7a0) = -1 ENOTDIR (Not a directory)
stat("/usr/local/bin/drush-8.4.11.phar", {st_mode=S_IFREG|0755, st_size=1344027, ...}) = 0
write(2, "stat(): stat failed for         "..., 341stat(): stat failed for                                                                                                                             ESC[1;33;40mESC[1m[warning]ESC[0m
phar:///usr/local/bin/drush-8.4.11.phar/.box/bin/profiles/hostmaster/modules/contrib/views_bulk_operations/views_bulk_operations.drush.inc
PharStreamWrapper.php:487
) = 341
getcwd("/var/aegir/hostmaster-7.x-3.192", 4096) = 32
lstat("/var/aegir/hostmaster-7.x-3.192/./profiles/hostmaster/modules/contrib/views_bulk_operations/views_bulk_operations.drush.inc", {st_mode=S_IFREG|0644, st_size=7331, ...}) = 0lstat("/var/aegir/hostmaster-7.x-3.192/./profiles/hostmaster/modules/contrib/views_bulk_operations", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/var/aegir/hostmaster-7.x-3.192/./profiles/hostmaster/modules/contrib", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/var/aegir/hostmaster-7.x-3.192/./profiles/hostmaster/modules", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/var/aegir/hostmaster-7.x-3.192/./profiles/hostmaster", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/var/aegir/hostmaster-7.x-3.192/./profiles", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/var/aegir/hostmaster-7.x-3.192/profiles/hostmaster/modules/contrib/views_bulk_operations/views_bulk_operations.drush.inc", {st_mode=S_IFREG|0644, st_size=7331, ...}) = 0
openat(AT_FDCWD, "/var/aegir/hostmaster-7.x-3.192/profiles/hostmaster/modules/contrib/views_bulk_operations/views_bulk_operations.drush.inc", O_RDONLY) = 5
fstat(5, {st_mode=S_IFREG|0644, st_size=7331, ...}) = 0
...

and with PHP 7.4 I get this:

...
stat("/usr/local/bin/drush-8.4.11.phar/commands/core/views.d8.drush.inc", 0x7ffc360bdd70) = -1 ENOTDIR (Not a directory)
stat("/usr/local/bin/drush-8.4.11.phar/commands/core", 0x7ffc360bdd70) = -1 ENOTDIR (Not a directory)
stat("/usr/local/bin/drush-8.4.11.phar/commands", 0x7ffc360bdd70) = -1 ENOTDIR (Not a directory)
stat("/usr/local/bin/drush-8.4.11.phar", {st_mode=S_IFREG|0755, st_size=1344027, ...}) = 0
access("profiles/hostmaster/modules/contrib/views_bulk_operations/views_bulk_operations.drush.inc", F_OK) = 0
stat("/usr/local/bin/drush-8.4.11.phar/.box/bin/profiles/hostmaster/modules/contrib/views_bulk_operations/views_bulk_operations.drush.inc", 0x7ffc360bbd20) = -1 ENOTDIR (Not a directory)
stat("/usr/local/bin/drush-8.4.11.phar/.box/bin/profiles/hostmaster/modules/contrib/views_bulk_operations", 0x7ffc360bbd20) = -1 ENOTDIR (Not a directory)
stat("/usr/local/bin/drush-8.4.11.phar/.box/bin/profiles/hostmaster/modules/contrib", 0x7ffc360bbd20) = -1 ENOTDIR (Not a directory)
stat("/usr/local/bin/drush-8.4.11.phar/.box/bin/profiles/hostmaster/modules", 0x7ffc360bbd20) = -1 ENOTDIR (Not a directory)
stat("/usr/local/bin/drush-8.4.11.phar/.box/bin/profiles/hostmaster", 0x7ffc360bbd20) = -1 ENOTDIR (Not a directory)
stat("/usr/local/bin/drush-8.4.11.phar/.box/bin/profiles", 0x7ffc360bbd20) = -1 ENOTDIR (Not a directory)
stat("/usr/local/bin/drush-8.4.11.phar/.box/bin", 0x7ffc360bbd20) = -1 ENOTDIR (Not a directory)
stat("/usr/local/bin/drush-8.4.11.phar/.box", 0x7ffc360bbd20) = -1 ENOTDIR (Not a directory)
stat("/usr/local/bin/drush-8.4.11.phar", {st_mode=S_IFREG|0755, st_size=1344027, ...}) = 0
getcwd("/var/aegir/hostmaster-7.x-3.192", 4096) = 32
lstat("/var/aegir/hostmaster-7.x-3.192/./profiles/hostmaster/modules/contrib/views_bulk_operations/views_bulk_operations.drush.inc", {st_mode=S_IFREG|0644, st_size=7331, ...}) = 0
lstat("/var/aegir/hostmaster-7.x-3.192/./profiles/hostmaster/modules/contrib/views_bulk_operations", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/var/aegir/hostmaster-7.x-3.192/./profiles/hostmaster/modules/contrib", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/var/aegir/hostmaster-7.x-3.192/./profiles/hostmaster/modules", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/var/aegir/hostmaster-7.x-3.192/./profiles/hostmaster", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/var/aegir/hostmaster-7.x-3.192/./profiles", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/var/aegir/hostmaster-7.x-3.192/profiles/hostmaster/modules/contrib/views_bulk_operations/views_bulk_operations.drush.inc", {st_mode=S_IFREG|0644, st_size=7331, ...}) = 0
openat(AT_FDCWD, "/var/aegir/hostmaster-7.x-3.192/profiles/hostmaster/modules/contrib/views_bulk_operations/views_bulk_operations.drush.inc", O_RDONLY) = 5
fstat(5, {st_mode=S_IFREG|0644, st_size=7331, ...}) = 0
...

The only difference being:

 stat("/usr/local/bin/drush-8.4.11.phar", {st_mode=S_IFREG|0755, st_size=1344027, ...}) = 0
+write(2, "stat(): stat failed for         "..., 341stat(): stat failed for                                                                                                                             ESC[1;33;40mESC[1m[warning]ESC[0m
+phar:///usr/local/bin/drush-8.4.11.phar/.box/bin/profiles/hostmaster/modules/contrib/views_bulk_operations/views_bulk_operations.drush.inc
+PharStreamWrapper.php:487
+) = 341
 getcwd("/var/aegir/hostmaster-7.x-3.192", 4096) = 32

So I would think it's some kind of code issue in box that triggers a warning on 7.3 because the actual steps it goes through looks pretty much the same.

seidler2547 avatar Jun 17 '22 18:06 seidler2547

Looking at this a little more, I think that drush actually works fine. These are warnings, but until now, any drush command I tried with drush 8.4.11 on PHP 7.3 worked despite the warnings. So maybe @greg-1-anderson there's a way to just use the old box version to produce a PHP <7.4 build in addition to the newer, smaller build? Unless it's really a bug or it's just a matter of adding a @ in front of a function call.

seidler2547 avatar Jun 17 '22 18:06 seidler2547

What is the recommended path forward:

  • Create a .box directory
  • Ignore warnings
  • Other Screen Shot 2022-09-08 at 1 56 37 PM Screen Shot 2022-09-08 at 1 58 51 PM

ghost avatar Sep 08 '22 18:09 ghost

PR linked above that works around this; AFAICS the problem happens when relative paths to command files are processed when drush runs as a phar e.g. sites/all/modules/contrib/views/drush/views.drush.inc turns into phar:///usr/local/bin/drush/.box/bin/sites/all/modules/contrib/views/drush/views.drush.inc when require_once is called in \Drush\Command\Commandfiles::add.

I'm not exactly sure why that happens but we can avoid it by pre-pending DRUPAL_ROOT to the path.

Not sure if that might cause other problems? I've tried to add quite a few checks before applying the workaround.

This works in local testing (using box to build a phar) where I was getting the warning before in earlier versions of PHP 7.

Apologies for the yuk whitespace; looks like this file wants tabs? None of my editors are set up to play nicely I'm afraid.

mcdruid avatar Sep 16 '22 15:09 mcdruid

Link above was the commit to my fork... now there's a PR.

Is it the weekend yet? :)

mcdruid avatar Sep 16 '22 15:09 mcdruid

I suppose another approach would be to ensure that the cwd is DRUPAL_ROOT as it looks like perhaps it's phar:///usr/local/bin/drush/.box/bin when this problem happens?

Either way, hopefully this gets us a bit closer to a fix for the problem.

mcdruid avatar Sep 16 '22 15:09 mcdruid

It seems like this may have been resolved in https://github.com/drush-ops/drush/commit/f167114e429e7472f6dec8545aecf55a7ad417ba, would it be possible to get a release for that? Thanks for keeping on with this! It helps when people stumble into older projects they have to upgrade.

rfay avatar Jan 03 '23 01:01 rfay

@weitzman Please create new release, thanks! :)

nevergone avatar Jan 11 '23 18:01 nevergone

Thanks for the new release @greg-1-anderson !

rfay avatar Mar 15 '23 16:03 rfay

Tested D7 project with ddev drush ws (reported originally in https://github.com/drush-ops/drush/issues/4979 ) and it worked on php7.3 7.4 8.0, 8.2.

Upgrade in

  • https://github.com/ddev/ddev/pull/4754

I think this can be closed, thanks so much!

rfay avatar Mar 15 '23 19:03 rfay

Tested PHP versions (drush cron; drush cc all; drush ws):

  1. PHP 7.2.24 (OK)

  2. PHP 7.0.33 (Error)

PHP Fatal error:  Uncaught TypeError: Return value of HumbugBox436\KevinGH\RequirementChecker\RequirementCollection::add() must be an instance of HumbugBox436\KevinGH\RequirementChecker\void, none returned in phar:///var/www/web/drush.phar/.box/src/RequirementCollection.php:26
Stack trace:
#0 phar:///var/www/web/drush.phar/.box/src/RequirementCollection.php(29): HumbugBox436\KevinGH\RequirementChecker\RequirementCollection->add(Object(HumbugBox436\KevinGH\RequirementChecker\Requirement))
#1 phar:///var/www/web/drush.phar/.box/src/Checker.php(85): HumbugBox436\KevinGH\RequirementChecker\RequirementCollection->addRequirement(Object(HumbugBox436\KevinGH\RequirementChecker\IsPhpVersionFulfilled), 'The application...', 'The application...')
#2 phar:///var/www/web/drush.phar/.box/src/Checker.php(14): HumbugBox436\KevinGH\RequirementChecker\Checker::retrieveRequirements()
#3 phar:///var/www/web/drush.phar/.box/bin/check-requirements.php(22): HumbugBox436\KevinGH\RequirementChecker\Checker::checkRequirements()
#4 /var/www/web/drush.ph in phar:///var/www/web/drush.phar/.box/src/RequirementCollection.php on line 26
PHP Fatal error:  Uncaught TypeError: Return value of HumbugBox436\KevinGH\RequirementChecker\RequirementCollection::add() must be an instance of HumbugBox436\KevinGH\RequirementChecker\void, none returned in phar:///var/www/web/drush.phar/.box/src/RequirementCollection.php:26
Stack trace:
#0 phar:///var/www/web/drush.phar/.box/src/RequirementCollection.php(29): HumbugBox436\KevinGH\RequirementChecker\RequirementCollection->add(Object(HumbugBox436\KevinGH\RequirementChecker\Requirement))
#1 phar:///var/www/web/drush.phar/.box/src/Checker.php(85): HumbugBox436\KevinGH\RequirementChecker\RequirementCollection->addRequirement(Object(HumbugBox436\KevinGH\RequirementChecker\IsPhpVersionFulfilled), 'The application...', 'The application...')
#2 phar:///var/www/web/drush.phar/.box/src/Checker.php(14): HumbugBox436\KevinGH\RequirementChecker\Checker::retrieveRequirements()
#3 phar:///var/www/web/drush.phar/.box/bin/check-requirements.php(22): HumbugBox436\KevinGH\RequirementChecker\Checker::checkRequirements()
#4 /var/www/web/drush.ph in phar:///var/www/web/drush.phar/.box/src/RequirementCollection.php on line 26
PHP Fatal error:  Uncaught TypeError: Return value of HumbugBox436\KevinGH\RequirementChecker\RequirementCollection::add() must be an instance of HumbugBox436\KevinGH\RequirementChecker\void, none returned in phar:///var/www/web/drush.phar/.box/src/RequirementCollection.php:26
Stack trace:
#0 phar:///var/www/web/drush.phar/.box/src/RequirementCollection.php(29): HumbugBox436\KevinGH\RequirementChecker\RequirementCollection->add(Object(HumbugBox436\KevinGH\RequirementChecker\Requirement))
#1 phar:///var/www/web/drush.phar/.box/src/Checker.php(85): HumbugBox436\KevinGH\RequirementChecker\RequirementCollection->addRequirement(Object(HumbugBox436\KevinGH\RequirementChecker\IsPhpVersionFulfilled), 'The application...', 'The application...')
#2 phar:///var/www/web/drush.phar/.box/src/Checker.php(14): HumbugBox436\KevinGH\RequirementChecker\Checker::retrieveRequirements()
#3 phar:///var/www/web/drush.phar/.box/bin/check-requirements.php(22): HumbugBox436\KevinGH\RequirementChecker\Checker::checkRequirements()
#4 /var/www/web/drush.ph in phar:///var/www/web/drush.phar/.box/src/RequirementCollection.php on line 26
  1. PHP 5.6.40 (Error)
PHP Warning:  Unsupported declare 'strict_types' in phar:///var/www/web/drush.phar/.box/src/Checker.php on line 3
PHP Parse error:  syntax error, unexpected ':', expecting ';' or '{' in phar:///var/www/web/drush.phar/.box/src/Checker.php on line 12
PHP Warning:  Unsupported declare 'strict_types' in phar:///var/www/web/drush.phar/.box/src/Checker.php on line 3
PHP Parse error:  syntax error, unexpected ':', expecting ';' or '{' in phar:///var/www/web/drush.phar/.box/src/Checker.php on line 12
PHP Warning:  Unsupported declare 'strict_types' in phar:///var/www/web/drush.phar/.box/src/Checker.php on line 3
PHP Parse error:  syntax error, unexpected ':', expecting ';' or '{' in phar:///var/www/web/drush.phar/.box/src/Checker.php on line 12
  1. PHP 5.5.9 (Error)
Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running 5.5.9-1ubuntu4.29, please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.
PHP Fatal error:  Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running 5.5.9-1ubuntu4.29, please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.
 in phar:///var/www/web/drush.phar/.box/vendor/autoload.php on line 20
Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running 5.5.9-1ubuntu4.29, please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.
PHP Fatal error:  Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running 5.5.9-1ubuntu4.29, please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.
 in phar:///var/www/web/drush.phar/.box/vendor/autoload.php on line 20
Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running 5.5.9-1ubuntu4.29, please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.
PHP Fatal error:  Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running 5.5.9-1ubuntu4.29, please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.
 in phar:///var/www/web/drush.phar/.box/vendor/autoload.php on line 20
  1. PHP 5.3.10 (Error)
PHP Parse error:  syntax error, unexpected '[' in phar:///var/www/web/drush.phar/.box/bin/check-requirements.php on line 10
PHP Parse error:  syntax error, unexpected '[' in phar:///var/www/web/drush.phar/.box/bin/check-requirements.php on line 10
PHP Parse error:  syntax error, unexpected '[' in phar:///var/www/web/drush.phar/.box/bin/check-requirements.php on line 10

nevergone avatar Mar 15 '23 19:03 nevergone

I don't think drush 8 has claimed to support really, really ancient PHP versions has it? I wouldn't think it would support drupal < than traditionally supported D7 versions?

rfay avatar Mar 15 '23 19:03 rfay

OK, but Drupal 7 system requirements: https://www.drupal.org/docs/7/system-requirements/php-requirements-for-drupal-7

nevergone avatar Mar 15 '23 19:03 nevergone

  • By policy, Drush 8 has not explicitly dropped support for any previously-supported version of PHP.
  • Technically, EOL PHP versions are not supported once they go EOL.
  • Practically, there's a limit to how much time I can put into support for EOL versions of PHP.

The issue here is that Box, the software used to build the Drush PHAR, does not support really old versions of PHP. I don't think that I am going to build multiple Drush PHARs, which would be the only way to span PHP 5.4 through 8.2.

So, new policy: the PHAR is only supported for supported PHP versions. Some older EOL PHP versions may also work, but this is up to the BOX project. If you want to use Drush on an EOL PHP version, then install with git clone + composer install.

greg-1-anderson avatar Mar 15 '23 21:03 greg-1-anderson

Also, n.b. At some point in the past, Drush dropped support for PHP 5.3, even though Drupal 7 still supports it. PHP 5.3 users must continue to use Drush 7. The Drush 7 phar is also an option for folks running PHP 7.1 and earlier, but nobody maintains it, idk if drush dl works in drush 7 tbh.

greg-1-anderson avatar Mar 15 '23 22:03 greg-1-anderson

tested. v8.4.12 fixed the problem

skyred avatar Apr 01 '23 12:04 skyred