Shell output in code tags so it's a bit easier to read.

root:/home/drupal5# ls -al
total 284
drwxrwxr-x 12 drupal developers  4096 2009-03-16 13:09 ./
drwxr-xr-x 61 root   root        4096 2009-02-26 11:03 ../
drwxr-xr-x  3 root   root        4096 2008-12-12 10:12 backup/
-rw-rw-r--  1 drupal developers 32996 2009-01-15 08:32 CHANGELOG.txt
-rw-rw-r--  1 drupal developers   262 2006-08-09 15:42 cron.php
-rwxrwxr-x  1 drupal developers   822 2007-05-03 01:00 favicon.ico*
drwxrwxrwx 12 drupal developers  4096 2009-02-26 21:55 files/
-rw-rw-r--  1 drupal developers  4005 2008-12-11 05:12 .htaccess
drwxr-xr-x  4 root   root        4096 2009-03-16 12:56 imagefield/
drwxrwxr-x  2 drupal developers  4096 2009-01-15 08:40 includes/
-rw-rw-r--  1 drupal developers   872 2006-12-12 18:32 index.php
-rw-rw-r--  1 drupal developers  1431 2006-09-09 00:29 INSTALL.mysql.txt
-rw-rw-r--  1 drupal developers  1073 2006-09-09 00:29 INSTALL.pgsql.txt
-rw-rw-r--  1 drupal developers 22305 2008-07-10 05:48 install.php
-rw-rw-r--  1 drupal developers  9263 2008-01-11 07:14 INSTALL.txt
-rw-rw-r--  1 drupal developers 18049 2009-01-14 14:56 LICENSE.txt
-rw-rw-r--  1 drupal developers  1778 2006-12-12 02:09 MAINTAINERS.txt
drwxrwxr-x  3 drupal developers  4096 2009-01-15 08:40 misc/
drwxrwxr-x 31 drupal developers  4096 2009-01-15 08:40 modules/
drwxrwxr-x  3 drupal developers  4096 2009-01-15 08:40 profiles/
-rw-rw-r--  1 drupal developers  1591 2008-12-11 05:24 robots.txt
drwxrwxr-x  2 drupal developers  4096 2009-01-15 08:40 scripts/
drwxrwxr-x 14 drupal developers  4096 2009-02-19 15:27 sites/
drwxrwxr-x  7 drupal developers  4096 2009-01-15 08:40 themes/
-rw-rw-r--  1 drupal developers 30842 2008-12-11 07:21 update.php
-rw-rw-r--  1 drupal developers  2941 2007-01-09 18:16 UPGRADE.txt
-rw-rw-r--  1 drupal developers   352 2005-12-11 03:26 xmlrpc.php
root:/home/drupal5# cp -a sites sitesbackup
root:/home/drupal5# drush -l http://example.com pm update
PHP Warning:  Module 'json' already loaded in Unknown on line 0
Update information last refreshed: Mon, 03/16/2009 - 04:12

Update status information on all installed and enabled Drupal modules:
  Name                                  Installed version       Recommended version     Status                   
  ----                                  -----------------       -------------------     ------
  Content Construction Kit (CCK)        5.x-1.10                5.x-1.10                OK                       
  contemplate                           5.x-1.9                 Unknown                 Ignored:                 
  CVS deploy                            5.x-1.1                 5.x-1.1                 OK                       
  Drupal                                5.15                    5.16                    SECURITY UPDATE available
  Drush                                 5.x-1.4                 5.x-1.4                 OK                       
  FileField                             5.x-2.3                 5.x-2.4                 Update available         
  ImageAPI                              5.x-1.2                 5.x-1.4                 Update available         
  ImageCache                            5.x-2.2                 5.x-2.3                 Update available         
  ImageField                            5.x-2.1                 5.x-2.5                 Update available         
  jQuery Update                         5.x-1.0                 5.x-1.0                 OK                       
  MimeDetect                            5.x-1.0                 5.x-1.0                 OK                       
  Pathauto                              5.x-2.3                 5.x-2.3                 OK                       
  Token                                 5.x-1.11                5.x-1.11                OK                       
  Update Status                         5.x-2.3                 5.x-2.3                 OK                       
  Views                                 5.x-1.6                 5.x-1.6                 OK                       
  Webform                               5.x-2.3                 5.x-2.6                 Update available         

NOTE: An update for the Drupal core is available. 
Drupal itself can't yet be updated by this tool. Please update Drupal manually.

Updates will be made to the following projects:
FileField [filefield-5.x-2.4], ImageAPI [imageapi-5.x-1.4], ImageCache [imagecache-5.x-2.3], ImageField [imagefield-5.x-2.5], Webform [webform-5.x-2.6]

Note: Updated modules can potentially break your site. It's not recommended to update production sites without prior testing.
Note: If you have made any modifications to any file that belongs to one of these projects, you will have to migrate those modifications after updating.
Do you really want to continue? (y/n): y
Project filefield was updated successfully. Installed version is now 5.x-2.4.
Project imageapi was updated successfully. Installed version is now 5.x-1.4.
Project imagecache was updated successfully. Installed version is now 5.x-2.3.
Project imagefield was updated successfully. Installed version is now 5.x-2.5.
drush: Failed to backup project directory /home/drupal5.15/sites/all/modules/webform to /home/drupal5.15/backup/modules/20090316121405/webform
root:/home/drupal5# ls -al                                                                                                                                                                                         < bender >
total 284
drwxrwxr-x 12 drupal developers  4096 2009-03-16 13:14 ./
drwxr-xr-x 61 root   root        4096 2009-02-26 11:03 ../
drwxr-xr-x  3 root   root        4096 2008-12-12 10:12 backup/
-rw-rw-r--  1 drupal developers 32996 2009-01-15 08:32 CHANGELOG.txt
-rw-rw-r--  1 drupal developers   262 2006-08-09 15:42 cron.php
-rwxrwxr-x  1 drupal developers   822 2007-05-03 01:00 favicon.ico*
drwxrwxrwx 12 drupal developers  4096 2009-02-26 21:55 files/
-rw-rw-r--  1 drupal developers  4005 2008-12-11 05:12 .htaccess
drwxr-xr-x  4 root   root        4096 2009-03-16 13:14 imagefield/
drwxrwxr-x  2 drupal developers  4096 2009-01-15 08:40 includes/
-rw-rw-r--  1 drupal developers   872 2006-12-12 18:32 index.php
-rw-rw-r--  1 drupal developers  1431 2006-09-09 00:29 INSTALL.mysql.txt
-rw-rw-r--  1 drupal developers  1073 2006-09-09 00:29 INSTALL.pgsql.txt
-rw-rw-r--  1 drupal developers 22305 2008-07-10 05:48 install.php
-rw-rw-r--  1 drupal developers  9263 2008-01-11 07:14 INSTALL.txt
-rw-rw-r--  1 drupal developers 18049 2009-01-14 14:56 LICENSE.txt
-rw-rw-r--  1 drupal developers  1778 2006-12-12 02:09 MAINTAINERS.txt
drwxrwxr-x  3 drupal developers  4096 2009-01-15 08:40 misc/
drwxrwxr-x 31 drupal developers  4096 2009-01-15 08:40 modules/
drwxrwxr-x  3 drupal developers  4096 2009-01-15 08:40 profiles/
-rw-rw-r--  1 drupal developers  1591 2008-12-11 05:24 robots.txt
drwxrwxr-x  2 drupal developers  4096 2009-01-15 08:40 scripts/
drwxrwxr-x 14 drupal developers  4096 2009-02-19 15:27 sitesbackup/
drwxrwxr-x  7 drupal developers  4096 2009-01-15 08:40 themes/
-rw-rw-r--  1 drupal developers 30842 2008-12-11 07:21 update.php
-rw-rw-r--  1 drupal developers  2941 2007-01-09 18:16 UPGRADE.txt
-rw-rw-r--  1 drupal developers   352 2005-12-11 03:26 xmlrpc.php
root:/home/drupal5# cp -a sitesbackup sites
root:/home/drupal5# 

I will leave the server in its current state so I can reproduce the problem if there are specific debug steps you need me to take, but right now, this is looking like a pretty serious goddamn problem. I had to restore my original sites folder from backup. So you know, drupal5 is a symlink to drupal5.15, this shouldn't matter though, as it works perfectly well with the same setup in the drupal6 -> drupal6.9 directory.

Oh. The backup dir is being created fine. Here's the ls...

root:/home/drupal5# ls -al /home/drupal5.15/backup/modules/20090316121405/
total 24
drwxr-xr-x  6 root   root       4096 2009-03-16 13:14 ./
drwxr-xr-x  6 root   root       4096 2009-03-16 13:14 ../
drwxrwxr-x  6 drupal developers 4096 2008-06-12 13:45 filefield/
drwxrwxr-x  3 drupal developers 4096 2008-08-19 15:24 imageapi/
drwxr-xr-x  4 root   root       4096 2008-12-12 11:43 imagecache/
drwxrwxr-x 14 drupal developers 4096 2009-02-19 15:27 imagefield/

It seems to be failing when it has a crack at backing up webform, but then instead of not deleting the entire sites folder, it seems to just go right on ahead and delete the entire sites folder. No big deal or anything.

Comments

moshe weitzman’s picture

Please use HEAD drush and D5 dev snapshot of drush_extras. We will soon be releasing all that code.

moshe weitzman’s picture

And we will unsupport all old releases.

moshe weitzman’s picture

Status: Active » Fixed

all that code has changed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Andric Villanueva’s picture

Too bad it happens on version 6. I am on Drupal 6 and did it. I did some fixes on some custom code that I have and it couldn't find a file then everything was deleted. No big deal it's just the entire sites folder. It's not like I need it or anything.

This has effectively soured me on drush. And I loved doing everything through the terminal ...

Refreshing update status information ...
Done.
Update information last refreshed: Tue, 05/11/2010 - 15:43

Update status information on all installed and enabled Drupal modules:
 Name                                          Installed version  Proposed version  Status                    
 Administration menu                           6.x-1.5            6.x-1.5           Up to date                
 Advanced help                                 6.x-1.2            6.x-1.2           Up to date                
 Drupal                                        6.16               6.16              Up to date                
 Autocomplete Widgets for CCK Text and Number  6.x-1.3            6.x-1.3           Up to date                
 Content Management Filter                     6.x-2.0            6.x-2.0           Up to date                
 Content Construction Kit (CCK)                6.x-2.6            6.x-2.6           Up to date                
 Context                                       6.x-2.0-rc2        6.x-2.0-rc4       SECURITY UPDATE available 
 Chaos tool suite                              6.x-1.3            6.x-1.3           Up to date                
 Devel                                         6.x-1.19           6.x-1.20          Update available          
 Drush Module Manager                          6.x-2.x-dev        6.x-2.x-dev       Update available          
 element themehook                             6.x-1.1            6.x-1.1           Up to date                
 FileField                                     6.x-3.3            6.x-3.3           Up to date                
 Filter Permissions                            6.x-1.1            6.x-1.1           Up to date                
 Image                                         6.x-1.0-beta5      6.x-1.0-beta5     Up to date                
 ImageAPI                                      6.x-1.6            6.x-1.8           Update available          
 ImageCache                                    6.x-2.0-beta10     6.x-2.0-beta10    Up to date                
 ImageField                                    6.x-3.3            6.x-3.3           Up to date                
 IMCE                                          6.x-1.3            6.x-1.3           Up to date                
 Imce CCK Image                                6.x-1.0-beta2      6.x-1.0-beta2     Up to date                
 Lightbox2                                     6.x-1.9            6.x-1.9           Up to date                
 Panels                                        6.x-3.3            6.x-3.3           Up to date                
 Pathauto                                      6.x-1.2            6.x-1.3           Update available          
 Preprocess Order Corrector                    6.x-1.1            6.x-1.1           Up to date                
 Quick Tabs                                    6.x-2.0-rc4        6.x-2.0-rc4       Up to date                
 Schema                                        6.x-1.7            6.x-1.7           Up to date                
 Sections                                      6.x-1.4            6.x-1.4           Up to date                
 Shadowbox                                     6.x-4.1            6.x-4.1           Up to date                
 Token                                         6.x-1.12           6.x-1.12          Up to date                
 Feeds                                         6.x-1.0            6.x-1.0-alpha14   Update available          
 Table Wizard                                  6.x-1.x-dev        6.x-1.1           Up to date                
 Vertical Tabs                                 6.x-1.0-rc1        6.x-1.0-rc1       Up to date                
 Views                                         6.x-2.10           6.x-2.10          Up to date                
 Views Examples                                6.x-1.0-alpha1     6.x-1.0-alpha1    Up to date                
 Views Schema                                  6.x-1.x-dev        6.x-1.x-dev       Up to date                
 Zero Point                                    6.x-1.10           6.x-1.10          Up to date                
 Acquia Marina                                 6.x-2.0            6.x-2.0           Up to date                

Code updates will be made to the following projects:
Context [context-6.x-2.0-rc4], Devel [devel-6.x-1.20], Drush Module Manager [drush_mm-6.x-2.x-dev], ImageAPI [imageapi-6.x-1.8], Pathauto [pathauto-6.x-1.3], Feeds [feeds-6.x-1.0-alpha14]

Note: Updated modules can potentially break your site. It's not recommended to update production sites without prior testing.
Note: A backup of your package will be stored to backups directory if it is not managed by a supported version control system.
Note: If you have made any modifications to any file that belongs to one of these projects, you will have to migrate those modifications after updating.
Do you really want to continue? (y/n): y
Project context was updated successfully. Installed version is now 6.x-2.0-rc4.
Project devel was updated successfully. Installed version is now 6.x-1.20.
Project drush_mm was updated successfully. Installed version is now 6.x-2.x-dev.
Project imageapi was updated successfully. Installed version is now 6.x-1.8.
Project pathauto was updated successfully. Installed version is now 6.x-1.3.
Project feeds was updated successfully. Installed version is now 6.x-1.0-alpha14.
Backups were saved into the directory                                                              [ok]
/Users/avillanueva/Projects/Web-Applications/drupal/backup/modules/20100511154351.

Fatal error: require_once(): Failed opening required 'sites/all/modules/bullpen/bullpen_brackets/brackets/installs/getMenuArray.php' (include_path='.:sites/all/modules/:sites/all/libraries/:sites/default/files/libraries/') in /Users/avillanueva/Projects/Web-Applications/drupal/sites/all/modules/bullpen/bullpen_brackets/brackets/brackets.module on line 54

Call Stack:
    0.0009     102992   1. {main}() /Users/avillanueva/.drush/drush.php:0
    0.0094     768284   2. drush_main() /Users/avillanueva/.drush/drush.php:37
    0.8475   18393392   3. drush_dispatch() /Users/avillanueva/.drush/drush.php:78
    0.8475   18394992   4. call_user_func_array() /Users/avillanueva/.drush/includes/drush.inc:23
    0.8475   18395216   5. drush_command() /Users/avillanueva/.drush/includes/drush.inc:0
    0.8476   18396504   6. call_user_func_array() /Users/avillanueva/.drush/includes/command.inc:288
    0.8476   18396632   7. drush_invoke() /Users/avillanueva/.drush/includes/command.inc:0
    0.8481   18402476   8. call_user_func_array() /Users/avillanueva/.drush/includes/command.inc:240
    0.8481   18402700   9. drush_pm_update() /Users/avillanueva/.drush/includes/command.inc:0
    0.8481   18403124  10. call_user_func_array() /Users/avillanueva/.drush/commands/pm/pm.drush.inc:486
    0.8481   18403408  11. drush_invoke() /Users/avillanueva/.drush/commands/pm/pm.drush.inc:0
    0.8498   18488756  12. call_user_func_array() /Users/avillanueva/.drush/includes/command.inc:240
    0.8498   18488984  13. drush_pm_updatecode() /Users/avillanueva/.drush/includes/command.inc:0
   10.9454   19741596  14. pm_update_packages() /Users/avillanueva/.drush/commands/pm/updatecode.inc:87
   52.6051   19815392  15. drush_invoke() /Users/avillanueva/.drush/commands/pm/updatecode.inc:175
   52.6058   19818868  16. call_user_func_array() /Users/avillanueva/.drush/includes/command.inc:240
   52.6058   19819100  17. drush_core_cache_clear() /Users/avillanueva/.drush/includes/command.inc:0
   52.6059   19819492  18. drupal_flush_all_caches() /Users/avillanueva/.drush/commands/core/core.drush.inc:429
   52.6313   19819940  19. menu_rebuild() /Users/avillanueva/Projects/Web-Applications/drupal/includes/common.inc:3705
   52.6343   19820548  20. menu_router_build() /Users/avillanueva/Projects/Web-Applications/drupal/includes/menu.inc:1701
   52.6619   20166700  21. call_user_func() /Users/avillanueva/Projects/Web-Applications/drupal/includes/menu.inc:1728
   52.6619   20166828  22. brackets_menu() /Users/avillanueva/Projects/Web-Applications/drupal/includes/menu.inc:0

Drush command could not be completed.                                                              [error]
avillanueva: [[drupal]]: drush up
Could not find a Drupal settings.php file at ./sites/default/settings.php.                         [error]
Command update needs a higher bootstrap level to run - you will need invoke drush from a more      [error]
functional Drupal environment to run this command.
Command update needs the following modules installed/enabled to run: update.                       [error]
The command 'drush.php up' could not be executed.                                                  [error]

EvanDonovan’s picture

Title: Drush 5.x-1.4 deletes entire sites folder, no big deal, it's just the entire sites folder. » Drush deletes entire sites folder if it hits fatal error during "drush up"
Version: 5.x-1.4 » All-versions-3.x-dev
Component: Code » PM (dl, en, up ...)
Status: Closed (fixed) » Active

Looks like the issue should be reopened if it happens on 6 as well. Andric, could you report what version you were using when this occurred?

EvanDonovan’s picture

Apparently from the source output it was 2.x-dev (module manager). Maybe this won't happen on 3.x, so if so, feel free to close again. Just wanted to confirm.

greg.1.anderson’s picture

Status: Active » Fixed

I believe this has been fixed in drush-3.x. Please re-open if reproducible on drush-HEAD (drush-4).

themselves’s picture

I'm not 100% sure on this, but I think the problem arose in my case because of some of the modules in my sites/all directory being simlinks and not actual directories. Maybe someone who knows the guts of drush can see how that might result in deleting sites/

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.