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.
While upgrading a server from 3.4 to 3.5 debian package I noticed the error below.
The new platform was build OK, and the site was left running fine on the old platform.
PHP Fatal error: Cannot redeclare drush_provision_pre_provision_git_pull()
Workarounds
- Disable the hosting_git feature before upgrading ... and make sure the hostmaster site is re-verified.
- OR: Apply this patch to provision, after debian unpacked the code in a first attempt
- OR: use our unstable debian repo
deb http://debian.aegirproject.org unstable main
, where the patch from this issue is build in.
More log:
Do you wish to run all pending updates? (y/n): y
Performed update: hosting_update_7000 [ok]
'all' cache was cleared. [success]
Finished performing updates. [ok]
PHP Fatal error: Cannot redeclare drush_provision_pre_provision_git_pull() (previously declared in /data/aegir/hostmaster-7.x-3.4/profiles/hostmaster/modules/aegir/hosting_git/drush/provision_git.drush.inc:131) in /data/aegir/hostmaster-7.x-3.5/profiles/hostmaster/modules/aegir/hosting_git/pull/drush/provision_git_pull.drush.inc on line 27
Fatal error: Cannot redeclare drush_provision_pre_provision_git_pull() (previously declared in /data/aegir/hostmaster-7.x-3.4/profiles/hostmaster/modules/aegir/hosting_git/drush/provision_git.drush.inc:131) in /data/aegir/hostmaster-7.x-3.5/profiles/hostmaster/modules/aegir/hosting_git/pull/drush/provision_git_pull.drush.inc on line 27
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Cannot redeclare drush_provision_pre_provision_git_pull() (previously declared in /data/aegir/hostmaster-7.x-3.4/profiles/hostmaster/modules/aegir/hosting_git/drush/provision_git.drush.inc:131) in
/data/aegir/hostmaster-7.x-3.5/profiles/hostmaster/modules/aegir/hosting_git/pull/drush/provision_git_pull.drush.inc, line 27
The external command could not be executed due to an application error. [error]
Comment | File | Size | Author |
---|---|---|---|
#5 | debian_upgrade_error-2729891-5.patch | 1.08 KB | helmo |
#4 | debian_upgrade_error-2729891-4.patch | 2.02 KB | helmo |
Comments
Comment #2
helmo CreditAttribution: helmo at Initfour websolutions for Aegir Cooperative commentedRunning apt-get install again did not help.
One workaround can be to manually edit
~aegir/.drush/drushrc.php
and remove the line about 'git_pull' from the$options['include']
array.Comment #3
helmo CreditAttribution: helmo at Initfour websolutions for Aegir Cooperative commentedAnother workaround could be to disable the hosting_git feature before upgrading ... and make sure the hostmaster site is re-verified.
Comment #4
helmo CreditAttribution: helmo at Initfour websolutions for Aegir Cooperative commentedMy first workaround to manually edit
~aegir/.drush/drushrc.php
seems to fail .. disabling the hosting_git module worked.This untested patch might help in updating the ~aegir/.drush/drushrc.php earlier ...
Comment #5
helmo CreditAttribution: helmo at Initfour websolutions for Aegir Cooperative commented:(
PHP Fatal error: Call to undefined function hosting_get_features() in /usr/share/drush/commands/provision/Provision/Config/Drushrc/Aegir.php on line 22
hosting_get_features() will only be available after bootstrapping the hostmaster site, which is what I was trying to avoid here.
provision-deploy has DRUSH_BOOTSTRAP_DRUPAL_ROOT
When I add
require_once DRUPAL_ROOT . '/profiles/hostmaster/modules/aegir/hosting/hosting.features.inc';
it's missing the cache_get function ... then raising the level to DRUSH_BOOTSTRAP_DRUPAL_DATABASE gives:*
PHP Fatal error: Call to undefined function drupal_system_listing() in /var/aegir/hostmaster-7.x-3.x-2016-05-20-1406/profiles/hostmaster/modules/aegir/hosting/hosting.features.inc on line 275
Strange as it seemed ... bootstrapping to DRUSH_BOOTSTRAP_DRUPAL_FULL worked, see new patch.
Comment #6
omega8cc CreditAttribution: omega8cc commentedOuch, forgot to report this! We have seen this on BOA already.
It is a direct result of these two commits:
http://drupalcode.org/project/hosting_git.git/commit/4d88d2a
http://drupalcode.org/project/hosting_git.git/commit/be99788
This issue should be moved to https://www.drupal.org/project/hosting_git perhaps?
Comment #7
omega8cc CreditAttribution: omega8cc commentedPlus, https://www.drupal.org/project/hosting_git after these commits no longer works! The Git tasks are greyed out as unavailable.
We had to revert to previous version to make it work.
Comment #8
ergonlogictested, and confirmed that the patch in #5 works nicely.
Comment #9
ergonlogicRe. #6, this is really an issue about stability upgrading the hostmaster site in general. So this is a good change either way. As a follow-up, we should probably split out the common code into a separate function.
Re. #7, hosting_git works for me with those commits. But if you're seeing issues, then that would be a separate issue for hosting_git :)
Comment #10
helmo CreditAttribution: helmo at Initfour websolutions for Aegir Cooperative commentedComment #11
helmo CreditAttribution: helmo at Initfour websolutions for Aegir Cooperative commentedComment #12
ShaneOnABike CreditAttribution: ShaneOnABike commentedFor me I was receiving the following error when I do the apt-get upgrade because of this issue.
I can report that the patch in #2729891-5 to Drush works beautifully!
Comment #13
helmo CreditAttribution: helmo at Initfour websolutions for Aegir Cooperative commentedGrumbles ... on the manual install it has failed a bit earlier ... the just in the provision_drupal_push_site() call, called from drush_provision_drupal_pre_provision_deploy
Comment #14
helmo CreditAttribution: helmo at Initfour websolutions for Aegir Cooperative commentedI've published a 3.5.1 Debian package, fixing atleast part of the problem pending further investigation on the manual installs
Comment #15
gboudrias CreditAttribution: gboudrias at Praxis Labs Coop commentedI don't know if this warrants a new issue but the stable repo is upgrading things to unstable versions**:
Comment #16
memtkmcc CreditAttribution: memtkmcc commentedThis hotfix (in Provision) breaks upgrade from Aegir 2.x
http://cgit.drupalcode.org/provision/commit/?id=c4d8621
http://cgit.drupalcode.org/provision/commit/?id=424298a
It results with:
Comment #17
ergonlogicI think we may want to revert this patch, and just update the release notes to highlight the need to disable hosting_git (if it's in use) prior to the upgrade.
Comment #18
kenfordesign CreditAttribution: kenfordesign as a volunteer commentedRe #15, Has this issue been addressed?
I had the same problem when using apt-get upgrade from 7.x-3.4 to 7.x-3.5.
The script created a hostmaster using the 7.x-3.x dev branch similar to your output. Automated backups stopped working also. This happened on 2 different server instances. Both had identical behavior.
Comment #19
gboudrias CreditAttribution: gboudrias at Praxis Labs Coop commentedSeems like the upgrade removed the cron entry... Not sure if this is related to this issue though.
Comment #20
kenfordesign CreditAttribution: kenfordesign as a volunteer commentedHas the issue been addressed with aegir3 upgrade to unstable versions?
Comment #21
helmo CreditAttribution: helmo at Initfour websolutions for Aegir Cooperative commentedNo, but I don't think we have a proper issue to track that.
We should probably do a 3.6 soonish to get 7.44 in anyway.
Comment #22
helmo CreditAttribution: helmo at Initfour websolutions for Aegir Cooperative commented@ #16 (upgrade from 2.x)
The only alternative I could think of is to add a version check ... could we in that code determine it's an upgrade from 2.x?
Comment #23
memtkmcc CreditAttribution: memtkmcc commentedMaybe there are more reliable checks to use, but we could just check (early enough) if some D6 specific table exists, which doesn't exist in D7. Or if some D7 specific table already exists. Something like:
or
Comment #24
memtkmcc CreditAttribution: memtkmcc commentedHmm.. but in
function drush_provision_drupal_provision_deploy()
it is apparently too late for this type of check.Comment #25
ergonlogicThere's a
VERSION
constant: https://api.drupal.org/api/drupal/modules%21system%21system.module/const......Comment #26
memtkmcc CreditAttribution: memtkmcc commentedYes, checking
VERSION
is even simpler, just not sure which check will work reliably when we are already infunction drush_provision_drupal_provision_deploy()
.Comment #27
helmo CreditAttribution: helmo at Initfour websolutions for Aegir Cooperative commentedI've been thinking about this a bit more
The drush_provision_drupal_provision_deploy hook where the offending code is will be executing on the new platform in a 2.x to 3.x migration scenario ... so that would make VERSION == 7.44 having no distinction from a 3.4 to 3.5 upgrade.
I'll revert my hotfix tomorrow.
Comment #28
helmo CreditAttribution: helmo at Initfour websolutions for Aegir Cooperative commentedReverted yesterday before the 3.6 release ... http://cgit.drupalcode.org/provision/commit/?id=4b58ab2
A note about disabling the hosting_git is in the release notes.... upgrading 3.5 to 3.6 is not affected by this issue.