Drush 3.0-alpha1 fails when upting a D6 site with various errors.

Code updates will be made to the following projects:
NodeReferrer [nodereferrer-6.x-1.0-rc1], Pathauto [pathauto-6.x-2.x-dev], Feeds [feeds-6.x-1.0-alpha11]
(...)
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 nodereferrer was updated successfully. Installed version is now 6.x-1.0-rc1.
Backups were saved into the directory /var/www/drupal/backup/modules/20100212174544/nodereferrer.                                          [ok]

Looking good so far.

Project pathauto was updated successfully. Installed version is now 6.x-2.x-dev.
Backups were saved into the directory /var/www/drupal/backup/modules/20100212174544/pathauto.                                              [ok]

Seems still OK...

The feeds directory could not be found within the disabled-modules directory at /var/www/drupal/sites/all/modules/feeds, perhaps the       [error]
project is enabled but has been deleted from disk.

What is an "disabled-modules directory"? /var/www/drupal/sites/all/modules/ is my enabled modules directory...

The 'feeds' module exists at /var/www/drupal/sites/all/modules/feeds, but the module is disabled.

An error occurred at function : drush_pm_updatecode                                                                                        [error]
WD php: rename(/var/www/drupal/backup/modules/20100212174544/pathauto,/var/www/drupal/sites/all/modules/pathauto): Directory not empty in  [error]
/root/drush/includes/drush.inc on line 305.

What is Drush trying here? Restore an backup over an successfull (as stated above) update?

Could not restore backup and rollback from failed upgrade. You will need to resolve manually.                                              [error]

What is supposed to have failed? updating pathauso succeeded...

WD php: rename(/var/www/drupal/backup/modules/20100212174544/nodereferrer,/var/www/drupal/sites/all/modules/nodereferrer): Directory not   [error]
empty in /root/drush/includes/drush.inc on line 305.
Could not restore backup and rollback from failed upgrade. You will need to resolve manually.                                              [error]
An error occurred at function : drush_pm_update

The same bogus again, Drush seems to try to restore an backup over an successfull update and is failing while doing so.

The backup directory was being created, but it doesn't include the 'feeds' module:

# ls /var/www/drush/backup/modules/20100212174544/
nodereferrer  pathauto

Repeating this procedure, Drush still fails:

Code updates will be made to the following projects:
Feeds [feeds-6.x-1.0-alpha11]
(...)
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
The feeds directory could not be found within the disabled-modules directory at /var/www/drupal/sites/all/modules/feeds, perhaps the       [error]
project is enabled but has been deleted from disk.
An error occurred at function : drush_pm_updatecode                                                                                        [error]
An error occurred at function : drush_pm_update

All this sounds a bit as if Drush would feel like running amok a bit. I don't quite understand what it is trying and why it is failing. On the same server, Drush works without these issues on other D6 installations (separate codebase).

Thanks & greetings, -asb

Comments

moshe weitzman’s picture

Assigned: Unassigned » owen barton
jonhattan’s picture

Component: Code » PM (dl, en, up ...)

it seems a problem related to the fact that feeds is disabled. It is theorically imposible because drush 3.x should show:

 feeds                           Unknown            Unknown           No version information found (if you have a CVS 
                                                                      checkout you should install CVS Deploy module)  

the disabled-modules thing comes because of the interaction of update_advanced when drush is unable to find the project on disk and hits:

commands/pm/updatecode.pm.inc:      return drush_set_error('DRUSH_PM_UPDATING_PATH_NOT_FOUND', dt('The !project directory could not be found within the !types directory at !full_project_path, perhaps the project is enabled but has been deleted from disk.', array('!project' => $project['name'], '!type' => $project['project_type'], '!full_project_path' => $project['full_project_path'])));

It seems to me the project was disabled in a second terminal when pm-update was fetching data from updates.drupal.org and before the call to update_advanced_update_projects_alter(), that sets the project type to disabled-modules if it is disabled. Or perhaps older versions of drupal 6.x checked also for disabled modules.

jonhattan’s picture

Title: Various errors: drush_pm_updatecode fails » pm-updatecode unable to update disabled projects (update_advanced enabled)
Version: All-versions-3.0-alpha1 »

I haven't used update_advanced before. Now I've seen it adds this option to update settings: Check for updates of disabled modules and themes. With that checked the problem is reproducible.

The basic project path is not available, perhaps the disabled-theme is enabled but has been deleted from disk.     [error]
An error occurred at function : drush_pm_updatecode                                                                [error]
asb’s picture

asb’s picture

Yes, I have 'update_advanced' installed & enabled usually.

oskar_calvo’s picture

Great job jonhatthan, thanks ;)

I love drush :)

Oskar

marthinal’s picture

Yes jonhattan thanks for your time and your help !!

greg.1.anderson’s picture

Component: PM (dl, en, up ...) » Documentation
Assigned: owen barton » Unassigned
Category: bug » task
Priority: Normal » Minor

I think this just needs some documentation somewhere to instruct users to not use "Check for updates of disabled modules and themes" when using update_advanced.

jonhattan’s picture

StatusFileSize
new1.99 KB

Wow it seems I have a fanclub :p

We already check for disabled projects requested but it is neutralized by update_advanced. With attached patch (untested) this situation is improved, but I think it will still fail if a disabled project has a update available, although it was not explicitly requested.

I also think pm-updatecode is almost ready to be compatible with update_advanced. It is only needed to have the path to the extensions in $project['includes'] (or similar).

mlncn’s picture

Priority: Minor » Major
Status: Active » Needs work

Now that this feature of update_advanced is in Drupal 7 core's Update Manager module (admin/reports/updates/settings), this is a major bug.

My error message is slightly garbled but it's definitely the same situation:
"The ctools project path is not available, perhaps the module-disabled[error]
is enabled but has been deleted from disk."

Drupal is checking the status of disabled modules, and drush attempts but is unable to update disabled modules and so the entire drush upc fails (or actually, succeeds up to that point, but tells you it fails, and further tells you its rollbacks fail).

The patch from #9 breaks drush for me.

In any case i think the approach should be to have drush upc update disabled modules, or do not list them as needing updates at all.

moshe weitzman’s picture

Assigned: Unassigned » jonhattan

I can confirm that D7 with that checkbox (admin/reports/updates/settings) is broken. Here is a replay script.

check the box at admin/reports/updates/settings
drush dl ctools-7.x-1.0-alpha1 -y
drush en ctools -y
drush dis ctools -y
drush upc ctools

Note that pm-updatecode fails with the message above.

jonhattan’s picture

Status: Needs work » Needs review
StatusFileSize
new1018 bytes

I still think we are pretty near of being able to update disabled projects.
This patch is conservative and just get rid of disabled projects to continue with pm-updatecode as usual.

moshe weitzman’s picture

IIRC, drupal's update.php does update disabled modules so we should ideally match its behavior.

jonhattan’s picture

StatusFileSize
new1.74 KB

patch to update disabled projects. It works if the box is checked (d6 and d7).

moshe weitzman’s picture

Status: Needs review » Fixed

Worked for the ctools test. Committed.

dhbanes’s picture

Status: Fixed » Needs work

Just tested in D6 with latest HEAD and still receive the following error when running "drush upc" with update_advanced enabled and "Check for updates of disabled modules and themes" checked:

The views_bulk_operations project path is not available, perhaps the -module is enabled but has been deleted [error] from disk.

jonhattan’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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

daniorama’s picture

Status: Closed (fixed) » Active

I use D7 with "Check for updates of disabled modules and themes" enabled. Using both drush 5 and 4 dev versions I still experience the error:"The xxx project path is not available, perhaps the -module is enabled but has been deleted [error] from disk." Does it happen to anyone else?

jonhattan’s picture

Status: Active » Fixed

woops I have failed badly several times to correctly implement basic arithmetics. Now fixed in HEAD.

jonhattan’s picture

Version: » All-versions-4.x-dev
Component: Documentation » PM (dl, en, up ...)
Assigned: jonhattan » msonnabaum
Category: task » bug
Status: Fixed » Patch (to be ported)
StatusFileSize
new0 bytes

to be backported.

msonnabaum’s picture

Maybe that patch is supposed to have something in it? :)

jonhattan’s picture

daniorama’s picture

Tested on version 5 and now it updates disabled modules perfectly. Thanks! :) there is still the problem of just updating a random number of modules and not all of them once. It needed passing 6 times "drush up" to make sure all modules were updated.

msonnabaum’s picture

Status: Patch (to be ported) » Fixed

Status: Fixed » Closed (fixed)

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