drush-ops / drush

Drush is a command-line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those who spend their working hours hacking away at the command prompt.
https://www.drush.org
2.34k stars 1.08k forks source link

"stat failed" warnings with 8.4.10 #4979

Closed txemapamundi9l closed 1 year ago

txemapamundi9l commented 2 years ago

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.

totten commented 2 years ago

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)

greg-1-anderson commented 2 years ago

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

Fonant commented 2 years ago

Can confirm same problem with drush 8.4.10 and PHP 7.3.

Drush 8.4.9 and PHP 7.3 work fine.

nevergone commented 2 years ago

Drush 8.4.10 and PHP 5.6 is affected.

John-B commented 2 years ago

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

rfay commented 2 years ago

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"

greg-1-anderson commented 2 years ago

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 commented 2 years ago

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

rfay commented 2 years ago

Thanks for all the maintenance you do everywhere!

rfay commented 2 years ago

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.
greg-1-anderson commented 2 years ago

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.

rfay commented 2 years ago

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.

seidler2547 commented 2 years ago

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 commented 2 years ago

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.

ghost commented 2 years ago

What is the recommended path forward:

mcdruid commented 2 years ago

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 commented 2 years ago

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

Is it the weekend yet? :)

mcdruid commented 2 years ago

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.

rfay commented 1 year ago

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.

nevergone commented 1 year ago

@weitzman Please create new release, thanks! :)

rfay commented 1 year ago

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

rfay commented 1 year ago

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

I think this can be closed, thanks so much!

nevergone commented 1 year ago

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
  3. 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
  4. 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
  5. 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
rfay commented 1 year ago

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?

nevergone commented 1 year ago

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

greg-1-anderson commented 1 year ago

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 commented 1 year ago

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.

skyred commented 1 year ago

tested. v8.4.12 fixed the problem