Open jlariza opened 3 years ago
If you run with --no-backup
does it work, or do you just get a different error?
@greg-1-anderson running it with that flag raise the same error
Unable to load class \Drush\VersionControl\Backup
Just wondering if there has been any addition resolution to this issue. I am on Drupal 7.91 with Drush 8.4.11 and receiving the same error:
Unable to load class \Drush\VersionControl\Backup
composer remove drush/drush and then composer global require drush/drush:8.x
Find where drush is installed then by running composer global show drush/drush
composer global require
is deprecated; see Fixing the Composer Global Command.
Does this bug only happen on site-local installs of Drush 8?
I have the same error too!
Drush 8.4.11 / Drupal 7.91 on PHP 7.4.
The debug say :
Verifying signature for svn version control engine. [6.51 sec, 30.89 Mo] [debug]
Executing: svn info /var/www/fedae-d7/drupal-7.93
sh: 1: svn: not found
Verifying signature for bzr version control engine. [6.52 sec, 30.89 Mo] [debug]
Executing: bzr root /var/www/fedae-d7/drupal-7.93
sh: 1: bzr: not found
Unable to load class \Drush\VersionControl\Backup [6.52 sec, 30.89 Mo] [error]
Returned from hook drush_pm_updatecode [6.52 sec, 18.23 Mo] [debug]
When I install bzr, it say :
Verifying signature for svn version control engine. [23.93 sec, 30.9 Mo] [debug]
Executing: svn info /var/www/fedae-d7/drupal-7.93
svn: E155007: '/var/www/fedae-d7/drupal-7.93' is not a working copy
Verifying signature for bzr version control engine. [23.94 sec, 30.89 Mo] [debug]
Executing: bzr root /var/www/fedae-d7/drupal-7.93
brz: ERROR: Not a branch: "/var/www/fedae-d7/drupal-7.93/".
Unable to load class \Drush\VersionControl\Backup [24.05 sec, 30.9 Mo] [error]
Returned from hook drush_pm_updatecode [24.05 sec, 18.23 Mo] [debug]
I use Drush in local (with Drush launcher) because we have a D9 in other folder and we need to have 2 versions of drush in the same server.
@greg-1-anderson For me it fails with the project-locally installed drush. But works with global installed drush.
Also I can not install cgr -> Found this https://github.com/consolidation/cgr/issues/40
~~ doesn't work with php8 apparently? See error quoted below.~~ ~~ > webmaster@shell:~$ composer global require consolidation/cgr
Info from https://repo.packagist.org: #StandWithUkraine Cannot use consolidation/cgr's latest version 2.0.5 as it requires php ^5.3.2 || ^7.0 which is not satisfied by your platform.
Installation failed, deleting ./composer.json.
In RequireCommand.php line 218: No composer.json present in the current directory (./composer.json), this may be the cause of the following exception.
In PackageDiscoveryTrait.php line 313:
Package consolidation/cgr has requirements incompatible with your PHP version, PHP extensions and Composer version:
- consolidation/cgr 2.0.5 requires php ^5.3.2 || ^7.0 which does not match your installed version 8.0.25. ~~
My server manager say it's possible that Drupal was installed or updated manually and it's possibly the reason of this bug.
I will try to uninstall Drupal manually and reinstall it with Drush to verify if it's a possible resolution to that situation.
Yeah, cgr needs some love; you don't need to use it directly, but you should install each component (e.g. Drush) in a separate folder, e.g. via composer require
.
If anyone has any ideas as to why that class cannot be found, please let me know.
We were having the same issue and fixed upgrading the Drush version to 8.4.12. Hope this helps.
@bdalomgir: Using Drupal 8.4.12 with Drupal 7, still same problem.
@nerdoc Mostly it's a Drush versioning problem so please try another Drush version, it might be a workaround.
@bdalomgir but Drush 9 isn't compatible with D7 (which I am stuck with...)
For me it fails with the project-locally installed drush. But works with global installed drush.
Somehow I missed this comment in the past, or failed to note its significance. Is everyone on this thread having problems with using the pm commands with a project-local Drush? That is not a supported configuration; if you have a project-local Drush, then you are supposed to use Composer to manage your site, not Drush pm.
What is the use case for using Drush pm with a site-local Drush? Could you switch to a global Drush if you want to use the pm commands? I would consider an enhancement to pm to allow for site-local Drush, but I don't have the bandwidth to implement it myself.
Also, if anyone wants to try to isolate the problem, it might be useful to know if older versions of Drush 8 work correctly in this configuration -- presuming that your environment allows you to use the older versions.
I am using Drush via composer, not locally, and having the problem.
I have tested many versions of Drush and the problem stay the same.
I'm obliged to work with a local version of Drush because I have other websites in Drupal 9 in the same server.
For the moment I'm obliged to update Drupal 7 manually and it's not pratical... :-(
Thanks for your work!
@nerdoc For my case I can see in the d7 document root drush version did not work perfectly, so I had to run the up command from outside the d7 document root. my document root was /var/www/projectName/src and I run the drush command from /var/www/projectName Command drush up drupal --root=src and my drush version was 8.4.12 Please try this way hope it will help you.
If you have other Durpal sites that are Drupal 9 or 10, then you may use a site-local Drush for those versions, and use a global install of Drush 8 with your Drupal 7 sites. If you want to use a site-local Drush with Drupal 7, you could also make your Drupal 7 site Composer-managed; then you wouldn't need to use pm:update
.
Describe the bug using drush 8.4.8 for Drupal 7.78 When running
drush up drupal
on a localmachine, It raisesand do not allow to update core
System Configuration