disabling a site doesn't work if the install profile misfired
anarcat - May 9, 2009 - 15:28
| Project: | Provision |
| Version: | HEAD |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | duplicate |
| Issue tags: | aegir-0.4 |
Description
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.

#1
Assuming this is only related to the backup system, here's a patch that adds a --force flag.
#2
Horrible patch, here's a reroll.
#3
I committed a modified patch.
#4
Works if database is missing, fails to disable if settings.php is chmod 0
#5
#6
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
#7
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...
#8
This issue still seems to be in HEAD for an external DB server when the database is messed up
#9
Well, how messed up? Here I completely dropped the database of a site but could still disable it.
#10
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.
#11
#12
#13
I fixed some stuff in disable recently in #529348: disable can still fail disabling damaged sites could you test this again?
#14
see above issue