When testing Aegir, we often end up with broken sites that cannot access their own database or their own files. In fact, this could happen in production if a third party would disturb the conditions Aegir assumes (vandalism, manual edition, data corruption, crash, etc).

We should be able to disable and delete those sites even if they are broken. Right now, if the site cannot be accessed because of GRANT issues, for example, the backup will fail and rollback the disable, which will block the delete.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

anarcat’s picture

Status: Active » Needs review
FileSize
4.4 KB

Assuming this is only related to the backup system, here's a patch that adds a --force flag.

anarcat’s picture

Horrible patch, here's a reroll.

anarcat’s picture

Status: Needs review » Fixed

I committed a modified patch.

ac’s picture

Works if database is missing, fails to disable if settings.php is chmod 0

ac’s picture

Status: Fixed » Needs work
ac’s picture

Task starts processing
Running: php /var/aegir/drush/drush.php --root='/var/aegir/drupal-6.11' 'provision' 'disable' 'breakme.pagebuild.net' --backend
Drush bootstrap phase : _drush_bootstrap_drush()
Drush bootstrap phase : _drush_bootstrap_drupal_root()
Loading drushrc "/var/aegir/drupal-6.11/drushrc.php" into "drupal" scope.
Initialized Drupal 6.11 root directory at /var/aegir/drupal-6.11
Found command: provision disable
Initializing drush commandfile: provision_mysql
Initializing drush commandfile: provision_drupal
Initializing drush commandfile: provision_apache
Including /home/aegir/.drush/provision/platform/disable.provision.inc
Including /home/aegir/.drush/provision/web_server/disable.provision.inc
Drush bootstrap phase : _drush_bootstrap_drupal_site()
Initialized Drupal site breakme.pagebuild.net at sites/breakme.pagebuild.net
Loading drushrc "/var/aegir/drupal-6.11/sites/breakme.pagebuild.net/drushrc.php" into "site" scope.
Including /home/aegir/.drush/provision/db_server/backup.provision.inc
Including /home/aegir/.drush/provision/platform/backup.provision.inc
Generating mysql dump for breakme.pagebuild.net.
mysqldump -hdb.pagebuild.net -usite_149 -ppkLkS7Yurv -rsites/breakme.pagebuild.net/database.sql site_149
Adding sites directory to /var/aegir/backups/breakme.pagebuild.net-2009-05-12.tar
cd /var/aegir/drupal-6.11/sites/breakme.pagebuild.net; tar -rf /var/aegir/backups/breakme.pagebuild.net-2009-05-12.tar *
Could not back up sites directory for drupal
An error occurred at function : drush_provision_drupal_provision_backup
Deleted mysql dump from sites directory
Changes for drush_provision_mysql_pre_provision_backup module have been rolled back.
An error occurred at function : drush_provision_drupal_pre_provision_disable
Command dispatch complete
Removing task from hosting queue
An error occurred at function : drush_hosting_hosting_task
Changes for drush_hosting_hosting_task module have been rolled back.
Command dispatch complete

anarcat’s picture

Status: Needs work » Fixed

I confirm the bug is still there. It's as if the 'force' option was not propagated through the drush_invoke call from drush_provision_drupal_pre_provision_disable to drush_provision_drupal_provision_backup().

Update: it was a typo, fixed...

ac’s picture

Status: Fixed » Needs work

This issue still seems to be in HEAD for an external DB server when the database is messed up

Task starts processing
Running: php /var/aegir/drush/drush.php --root='/var/aegir/DRUPAL-6-12-DEV' 'provision' 'disable' 'themetest16.pagebuild.net' --backend
Drush bootstrap phase : _drush_bootstrap_drush()
Drush bootstrap phase : _drush_bootstrap_drupal_root()
Loading drushrc "/var/aegir/DRUPAL-6-12-DEV/drushrc.php" into "drupal" scope.
Initialized Drupal 6.12 root directory at /var/aegir/DRUPAL-6-12-DEV
Found command: provision disable
Initializing drush commandfile: provision_apache
Initializing drush commandfile: provision_drupal
Initializing drush commandfile: provision_mysql
Including /home/aegir/.drush/provision/web_server/disable.provision.inc
Including /home/aegir/.drush/provision/platform/disable.provision.inc
Drush bootstrap phase : _drush_bootstrap_drupal_site()
Initialized Drupal site themetest16.pagebuild.net at sites/themetest16.pagebuild.net
PROVISION_DRUPAL_SITE_FOUND
An error occurred at function : drush_provision_drupal_provision_disable_validate
Command dispatch complete
Removing task from hosting queue
An error occurred at function : drush_hosting_hosting_task
Changes for drush_hosting_hosting_task module have been rolled back.
Command dispatch complete

anarcat’s picture

Status: Needs work » Postponed (maintainer needs more info)

Well, how messed up? Here I completely dropped the database of a site but could still disable it.

ac’s picture

Title: disabling a site doesn't work if the database is broken or not accessible » disabling a site doesn't work if the database is broken
Version: 5.x-0.2-alpha1 »
Priority: Critical » Normal
Status: Postponed (maintainer needs more info) » Active

To recreate this you need to use an install profile and make a call to an undefined function in it (We came across this issue using aegir to provision sites to test install profiles we were writing - if your profile works then this will not affect you). Use the faulty install profile to provision a site. The site is created in aegir however it can not be disabled or deleted.

anarcat’s picture

Title: disabling a site doesn't work if the database is broken » disabling a site doesn't work if the install profile misfired
Version: » 6.x-0.2
anarcat’s picture

Version: 6.x-0.2 »
Issue tags: +aegir-0.4
anarcat’s picture

Status: Active » Postponed (maintainer needs more info)

I fixed some stuff in disable recently in #529348: disable can still fail disabling damaged sites could you test this again?

ac’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)

see above issue

  • Commit 897577c on debian, dev-dns, dev-envobject, dev-koumbit, dev-log_directory, dev-migrate_aliases, dev-multiserver-install, dev-newhooks, dev-nginx, dev-platform_management, dev-ports, dev-purgebackup, dev-restore, dev-services, dev-simplerinstaller, dev-site_rename, dev-ssl, dev_716166_apache_conf, dev_dns, dev_server_verify, prod-koumbit, ssl, dev-ssl-ip-allocation-refactor, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-subdir-multiserver, 6.x-2.x-backports, dev-helmo-3.x authored by anarcat:
    add a new --force flag for backups that allows disable and delete to...
  • Commit 3d65c19 on debian, dev-dns, dev-envobject, dev-koumbit, dev-log_directory, dev-migrate_aliases, dev-multiserver-install, dev-newhooks, dev-nginx, dev-platform_management, dev-ports, dev-purgebackup, dev-restore, dev-services, dev-simplerinstaller, dev-site_rename, dev-ssl, dev_716166_apache_conf, dev_dns, dev_server_verify, prod-koumbit, ssl, dev-ssl-ip-allocation-refactor, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-subdir-multiserver, 6.x-2.x-backports, dev-helmo-3.x authored by anarcat:
    fix a typo: properly set force option before backing up in disable...

  • anarcat authored 897577c on dev-1995506
    add a new --force flag for backups that allows disable and delete to...
  • anarcat authored 3d65c19 on dev-1995506
    fix a typo: properly set force option before backing up in disable...

  • anarcat authored 897577c on 7.x-3.x-1966886-context-to-entity
    add a new --force flag for backups that allows disable and delete to...
  • anarcat authored 3d65c19 on 7.x-3.x-1966886-context-to-entity
    fix a typo: properly set force option before backing up in disable...

  • anarcat authored 897577c on 6.x-2.x-1995506-profile-option
    add a new --force flag for backups that allows disable and delete to...
  • anarcat authored 3d65c19 on 6.x-2.x-1995506-profile-option
    fix a typo: properly set force option before backing up in disable...