When I try to run drush on 2 of my sites; I get the following output. When it finishes, my sites directory is gone. It makes a backup so I can at least get things back. Considering that this deletes working websites; I think this should be a high priority issue.

This always worked just fine; but now it's not doing so great.

Updating sd.ubuntu-us.org
Refreshing update status information ...
Done.
Update information last refreshed: Sat, 11/28/2009 - 20:28

Update status information on all installed and enabled Drupal modules:
Name Installed version Proposed version Status
Drupal 6.14 6.14 Up to date
Event 6.x-2.x-dev 6.x-2.x-dev Up to date
Pathauto 6.x-1.2 6.x-1.2 Up to date
Signup 6.x-1.0-rc6 6.x-1.0-rc6 Up to date
Ubuntu Drupal Countdown 6.x-5.5 6.x-5.5 Up to date
Ubuntu Drupal Header 6.x-5.4 6.x-5.4 Up to date
Ubuntu Drupal Planet 6.x-5.4 6.x-5.4 Up to date
Ubuntu Drupal Sidebar 6.x-5.3 6.x-5.3 Up to date
Ubuntu Drupal Theme 6.x-5.4 6.x-5.6 Update available

Code updates will be made to the following projects:
Ubuntu Drupal Theme [udtheme-6.x-5.6]

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): Module udtheme path is not available, perhaps the module is enabled but has been deleted from disk. [error]
Cache cleared.
An error occurred at function : drush_core_cache_clear [error]
An error occurred at function : drush_pm_updatecode [error]
An error occurred at function : drush_pm_update [error]

Comments

MTecknology’s picture

Refreshing update status information ...
Done.
Update information last refreshed: Sun, 11/29/2009 - 03:46

Update status information on all installed and enabled Drupal modules:
Name Installed version Proposed version Status
Drupal 6.14 6.14 Up to date
Event 6.x-2.x-dev 6.x-2.x-dev Up to date
Pathauto 6.x-1.2 6.x-1.2 Up to date
Signup 6.x-1.0-rc6 6.x-1.0-rc6 Up to date
Ubuntu Drupal Countdown Unknown 6.x-5.5 Installed version not supported
Ubuntu Drupal Header 6.x-5.4 6.x-5.4 Up to date
Ubuntu Drupal Planet Unknown 6.x-5.4 Installed version not supported
Ubuntu Drupal Sidebar Unknown 6.x-5.3 Installed version not supported
Ubuntu Drupal Theme 6.x-5.6 6.x-5.6 Up to date

Code updates will be made to the following projects:
Ubuntu Drupal Countdown [udcountdown-6.x-5.5], Ubuntu Drupal Planet [udplanet-6.x-5.4], Ubuntu Drupal Sidebar [udsidebar-6.x-5.3]

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): Project udcountdown was updated successfully. Installed version is now 6.x-5.5.
Module udplanet directory could not be found at /var/www/d6/sites, perhaps the module is enabled but has been deleted from disk. [error]
Module udsidebar directory could not be found at /var/www/d6/sites, perhaps the module is enabled but has been deleted from disk. [error]
Backups were saved into the directory /var/www/d6/backup/modules/20091129024611. [ok]
Cache cleared.
An error occurred at function : drush_core_cache_clear [error]
An error occurred at function : drush_pm_updatecode [error]
An error occurred at function : drush_pm_update [error]

MTecknology’s picture

I tried to run this with -s and got the following..

root@insto:/var/www/d6# /usr/local/sbin/drush/drush -r "/var/www/d6" -l "sd.ubuntu-us.org" cache clear -s
Cache cleared.
root@insto:/var/www/d6# /usr/local/sbin/drush/drush -r "/var/www/d6" -l "sd.ubuntu-us.org" update -s
Refreshing update status information ...
Done.
Update information last refreshed: Sun, 11/29/2009 - 04:04

Update status information on all installed and enabled Drupal modules:
Name Installed version Proposed version Status
Drupal 6.14 6.14 Up to date
Event 6.x-2.x-dev 6.x-2.x-dev Up to date
Pathauto 6.x-1.2 6.x-1.2 Up to date
Signup 6.x-1.0-rc6 6.x-1.0-rc6 Up to date
Ubuntu Drupal Countdown Unknown 6.x-5.5 Installed version not supported
Ubuntu Drupal Header 6.x-5.4 6.x-5.4 Up to date
Ubuntu Drupal Planet Unknown 6.x-5.4 Installed version not supported
Ubuntu Drupal Sidebar Unknown 6.x-5.3 Installed version not supported
Ubuntu Drupal Theme 6.x-5.6 6.x-5.6 Up to date

Code updates will be made to the following projects:
Ubuntu Drupal Countdown [udcountdown-6.x-5.5], Ubuntu Drupal Planet [udplanet-6.x-5.4], Ubuntu Drupal Sidebar [udsidebar-6.x-5.3]

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
Calling mkdir(/var/www/d6/backup, 511)
Calling mkdir(/var/www/d6/backup/modules, 511)
Calling mkdir(/var/www/d6/backup/modules/20091129030413, 511)
Calling rename(/var/www/d6/sites, /var/www/d6/backup/modules/20091129030413/udcountdown)
Calling unlink(udcountdown-6.x-5.5.tar)
Project udcountdown was updated successfully. Installed version is now 6.x-5.5.
Calling mkdir(/var/www/d6/backup, 511)
Calling mkdir(/var/www/d6/backup/modules, 511)
Calling mkdir(/var/www/d6/backup/modules/20091129030413, 511)
Calling rename(/var/www/d6/sites, /var/www/d6/backup/modules/20091129030413/udplanet)
Calling unlink(udplanet-6.x-5.4.tar)
Project udplanet was updated successfully. Installed version is now 6.x-5.4.
Calling mkdir(/var/www/d6/backup, 511)
Calling mkdir(/var/www/d6/backup/modules, 511)
Calling mkdir(/var/www/d6/backup/modules/20091129030413, 511)
Calling rename(/var/www/d6/sites, /var/www/d6/backup/modules/20091129030413/udsidebar)
Calling unlink(udsidebar-6.x-5.3.tar)
Project udsidebar was updated successfully. Installed version is now 6.x-5.3.
Backups were saved into the directory /var/www/d6/backup/modules/20091129030413. [ok]
Cache cleared.
md5_file(udcountdown-6.x-5.5.tar.gz): failed to open stream: No such file or directory in /usr/local/sbin/drush/commands/pm/package_handler/wget.inc on line 36. [warning]
md5_file(udplanet-6.x-5.4.tar.gz): failed to open stream: No such file or directory in /usr/local/sbin/drush/commands/pm/package_handler/wget.inc on line 36. [warning]
md5_file(udsidebar-6.x-5.3.tar.gz): failed to open stream: No such file or directory in /usr/local/sbin/drush/commands/pm/package_handler/wget.inc on line 36. [warning]
No database updates required [success]
Cache cleared.
Finished performing updates. [ok]
root@insto:/var/www/d6#

MTecknology’s picture

Ok..... what happened is that somehow one directory was nested inside of another. When this happened, it seems to have freaked out and deleted the entire sites directory and copied it into a folder for the module it was updating. This shouldn't happen but when it does this can be a massive issue.

moshe weitzman’s picture

Assigned: Unassigned » owen barton
henrrrik’s picture

This just bit me too, running drush update.

Code updates will be made to the following projects:
Embedded Media Field [emfield-6.x-1.18], Vertical Tabs [vertical_tabs-6.x-1.0-beta6], Views [views-6.x-2.8]

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 emfield was updated successfully. Installed version is now 6.x-1.18.
Project vertical_tabs was updated successfully. Installed version is now 6.x-1.0-beta6.
Module views directory could not be found at                         [error]
/mnt/persist/www/docroot/paradox/sites/all/modules/contrib/views,
perhaps the module is enabled but has been deleted from disk.
Backups were saved into the directory                                [ok]
/mnt/persist/www/docroot/paradox/backup/modules/20091208083249.

Fatal error: require_once(): Failed opening required './sites/all/modules/contrib/views/includes/view.inc' (include_path='.:/usr/share/php:/usr/share/pear') in /mnt/persist/www/docroot/paradox/sites/all/modules/contrib/views/views.module on line 511
Drush command could not be completed.         

Boom, /sites gone. Thank Baby Jesus for version control...

henrrrik’s picture

I reverted using bzr and updated again, this time one module at a time, e.g. drush update vertical_tabs. No problem.

danbuntu’s picture

I've just tried this method of updating one module at a time and it works a few times and then deleted the sites folder

I guess I'm going to have to abandon drush for updates for a while

greg.1.anderson’s picture

By #2, it looks like $release['path'] is 'sites' instead of the path to the module being updated.

Calling rename(/var/www/d6/sites, /var/www/d6/backup/modules/20091129030413/udcountdown)

I'm not sure why this is, but I might suggest that you add some seatbelts to pm_update_packages() in pm/updatecode.inc. The backup code is assuming that $release['path'] is the module directory; enforcing that assumption would be a very good idea. Minimally, change:

if (empty($release['path']))

to

if ((empty($release['path'])) || (basename($release['path']) != $release['name']))

Haven't tried this; I can't reproduce the problem, so I'm useless here. Best case, this fix changes an error condition that deletes 'sites' to an error condition that fails to upgrade a module; not perfect, but an improvement. But don't give up, guys! If you can reproduce the problem, try to collect some information to see why the project path is going wacky. More info will lead to a fix.

mcurry’s picture

subscribe

moshe weitzman’s picture