drush-ops / drush-launcher

A small wrapper around Drush for your global $PATH.
GNU General Public License v2.0
237 stars 50 forks source link

Warning: stat(): stat failed for phar #67

Closed attrib closed 5 years ago

attrib commented 5 years ago

Since the latest security update for Drupal I see a lot of messages like the following in our log:

[warning] stat(): stat failed for phar:///Users/karl.fritsche/workspace/bio.logis_dev/scripts/drush.phar/bin/modules/contrib/igbinary/src/Component/Cache/MemoryBackendFactory.php PharStreamWrapper.php:453

It seems it happens when inside the drush command the igbinary stuff is included. This happens for custom command but also for drush cron. It seems like the new introduced PharStreamWrapper.php somehow breaks functionality here.

As a workaround I extracted the drush launcher phar now and call the drush.php, that works, but somehow feels messy.

phar extract -f drush_launcher.phar drush_launcher
php drush_launcher/bin/drush.php cron

At least this is not producing this warning.

Anyone has some ideas whats going wrong here and how we could fix this?

webflo commented 5 years ago

This is not the 1.x branch of igbinary. Do you use https://cgit.drupalcode.org/igbinary/log/?h=serialization.objectaware.default ?

webflo commented 5 years ago

I can not reproduce this in any of my sites and D8 standard profile.

attrib commented 5 years ago

Yes, https://cgit.drupalcode.org/igbinary/log/?h=serialization.objectaware.default is used, wasn't aware of it.

Thanks for the feedback, then it seems a problem with this branch of the module. I will investigate further and give feedback here.

attrib commented 5 years ago

Stupid me. Sorry for the issue here. Just if somebody comes across a similar issue, here what I fixed on our side.

We had the following in our settings.php

// Manually add the classloader path, this is required for the container cache
// bin definition below and allows to use it without the redis and igbinary
// modules being enabled.
$class_loader->addPsr4('Drupal\\redis\\', 'modules/contrib/redis/src');
$class_loader->addPsr4('Drupal\\igbinary\\', 'modules/contrib/igbinary/src');

this is wrong as the path is not absolute so drush will fail here now. It should be:

$class_loader->addPsr4('Drupal\\redis\\', DRUPAL_ROOT . '/modules/contrib/redis/src');
$class_loader->addPsr4('Drupal\\igbinary\\', DRUPAL_ROOT . '/modules/contrib/igbinary/src');
webflo commented 5 years ago

👍