After updating drush to 4.5 prior to upgrading from Drupal 7.7. to 7.8, I ran "drush up drupal" and got the following error message, while claiming (erroneously) that the version had been upgraded to 7.8.

Destination directory /home/dgfumc/www/test/drupal-7.8 already [error]
exists.
Project drupal was updated successfully. Installed version is now 7.8.
Backups were saved into the directory [ok]
/home/dgfumc/drush-backups/dgfumc_test/20110903035651/drupal.
Backups were restored successfully. [ok]

There was no test/drupal-7.8 directory before or after running the upgrade command and Drupal core was still in 7.7.

At first, I assumed this was the same as #1196972: Drush pm-update (up) rollbacks changes if fetching updates fails, and, in fact, I had to disable a couple of modules to avoid that particular error (imce_search for example), but I get this directory error without any prior errors.

It's an issue with version 4.5, because the upgrade worked without a hitch after downgrading drush to 4.4 again.

Comments

randallkent’s picture

Experiencing the same issue ... Subscribing!

steinmb’s picture

Priority: Normal » Major

Confirming the problem. Also did a quick test with 4.x-dev, with the same result. It fails and then rolls back the last backed up release, that on this server is Drupal 7.7.

System: Centos 4.8
PHP: 5.2.6

Executing: mkdir '/something/drupal/drupal-7.8'
Executing: svn info '/something/drupal/drupal-7.8'
Executing: bzr root '/something/drupal/drupal-7.8'
Executing: mkdir '/home/something/drush-backups/smbjorklund/20110905093242'
Executing: wget -P . 'http://ftp.drupal.org/files/projects/drupal-7.8.tar.gz'
Downloading drupal-7.8.tar.gz was successful.              [notice]
Md5 checksum of drupal-7.8.tar.gz verified.        [notice]
Executing: tar -C '/something/drupal' -xzf 'drupal-7.8.tar.gz'
Executing: tar -tf 'drupal-7.8.tar.gz'
Destination directory /something/drupal/drupal-7.8 already exists.      [error]
Project drupal was updated successfully. Installed version is now 7.8.
Backups were saved into the directory /home/something/drush-backups/smbjorklund/20110905093242/drupal.            [ok]
Rolling back update of Drupal core code ...            [notice]
Executing: svn info 'drupal-7.8'
Executing: bzr root 'drupal-7.8'
Backups were restored successfully.                                                      [ok]
Command dispatch complete                                       [notice]
moshe weitzman’s picture

Assigned: Unassigned » jonhattan
steinmb’s picture

Any ideas guys?

jonhattan’s picture

Status: Active » Postponed (maintainer needs more info)

unable to reproduce. Pls post the complete log output, and use <code> markup.

steinmb’s picture

Status: Postponed (maintainer needs more info) » Active
StatusFileSize
new70.92 KB

Rather long log, attaching as file. I replaced the real server path in the logfile with "/myserverpath" .

kruser’s picture

subscribing - same issue here. it goes back and restores everything after running a drush up "
Backups were restored successfully. "

5n00py’s picture

same issue ... Subscribing!

cothrun’s picture

StatusFileSize
new44.76 KB

I'm experiencing this as well.

PHP 5.3.6
CentOS release 4.7

lukaswhite’s picture

I'm experiencing this while trying to update an old site from 6.13 to 6.22...

decibel.places’s picture

Upgrading Drush to All-versions-5.x-dev fixed this for me

as suggested on a different thread, but I lost track of where

EWB’s picture

StatusFileSize
new38.59 KB

I am experiencing a similar issue - in this case with Drupal 6.20 to 6.22. Output attached...

steinmb’s picture

Title: Destination directory .../drupal-7.8 already exists. » Destination directory .../drupal-7.9 already exists.

Regarding #11. Tested with the latest 5.x-dev release and it does not work as an workaround on my system.

Downloading drupal-7.9.tar.gz was successful. [15.52 sec, 23.63 MB]                                   [notice]
Calling md5_file(/var/www/secret/place/drupaldrupal-7.9.tar.gz) [15.52 sec, 23.64 MB]                 [debug]
Md5 checksum of drupal-7.9.tar.gz verified. [15.58 sec, 23.64 MB]                                     [notice]
Calling chdir(/var/www/secret/place) [15.58 sec, 23.64 MB]                                            [debug]
Executing: tar -C /var/www/secret/place/drupal -xzf drupaldrupal-7.9.tar.gz                        
Calling chdir(/var/www/secret/place/drupal) [16.66 sec, 23.64 MB]                                     [debug]
Calling chdir(/var/www/secret/place) [16.66 sec, 23.64 MB]                                            [debug]
Executing: tar -tf drupaldrupal-7.9.tar.gz                                                         
  tar: This does not look like a tar archive                                                       
  tar: Skipping to next header                                                                     
  tar: Archive contains obsolescent base-64 headers                                                
  tar: Error exit delayed from previous errors                                                     
Calling chdir(/var/www/secret/place/drupal) [16.71 sec, 23.64 MB]                                     [debug]
Destination directory /var/www/secret/place/drupal/drupal-7.9 already exists. [16.71 sec, 23.64 MB]   [error]

What I do not get, drush is running 'tar -xzf drupaldrupal-7.9.tar.gz' and that is seems to work, but then it tries to list the content of the archive by running 'tar -tf' but this do not work on a zipped tar archive, it have to be 'tar -tfz'. Have not looked into the drush code yet so I do not know why it does this.

hoersche’s picture

Had same error.

Working off of #13 (steinmb), I modified my drush/includes/drush.inc file, changing line 1511 to include the 'z' option:

<?php
//WAS
1511:   drush_shell_cd_and_exec(dirname($path), "tar -tf %s", basename($path));
//NOW
1511:     drush_shell_cd_and_exec(dirname($path), "tar -tzf %s", basename($path));
?>

and things got back to working smoothly on my CentOS 4.8 machine.

dca123’s picture

Same issue here upgrading 6.13-6.22

decibel.places’s picture

dca123:

I also upgraded an installation for D 6.14 - 6.22 so I might be able to give you some tips.

But I don't see what this has to do with Drush?

dca123’s picture

@decibel.places

I used

#>drush up drupal

to try and update only drupal and it gave me the error from the OP.

I ended up doing in manually to get it working but it would be nice to have this working so i can use it in the future.

randallkent’s picture

Component: PM (dl, en, up ...) » Base system (internal API)
Status: Active » Needs review
StatusFileSize
new592 bytes

I can confirm the solution provided by @hoersche in #14 resolves the issue going from 7.0 -> 7.10 on a CentOS 4.9 machine running cPanel/WHM. The attached patch implements this on the 7.x-4.x branch (line 1575) but requires further testing to ensure it

  1. doesn't break any other calls to drush_tarball_extract()
  2. is compatible with operating systems other than CentOS (per the comment on 1573-1574)

It looks like this function drush_tarball_extract() was added on July 9 by Moshe Weitzman in 2f28b7f244225a1db5306405a1cf522b5cec107a who I've pinged via IRC to have a look.

moshe weitzman’s picture

Needs review by Owen and Greg who worked on cross db compatibility for un tar.

greg.1.anderson’s picture

master already has the patch from #18 applied. I don't remember the history of why there was no 'z' there; seems like an error, but maybe there was some reason. No time to test it without right now, but since the 'z' exists in master, I'd guess this is safe to apply to the 4.x branch.

steinmb’s picture

#18 applied to drush 4.5, though did not apply cleanly, Hunk #1 succeeded at 1508 (offset -64 lines).
Seemed to to work fine for me on CentOS release 4.9 and OS X 10.7.x.

jonhattan’s picture

Version: 7.x-4.5 » All-versions-4.x-dev
Assigned: jonhattan » Unassigned
Status: Needs review » Reviewed & tested by the community

Sure, it seems an error.

+++ b/includes/drush.inc
@@ -1572,7 +1572,7 @@ function drush_tarball_extract($path, $destination = FALSE, $listing = FALSE) {
       // We use a separate tar -tf instead of -xvf above because

Comment must change in concordance.

biocode’s picture

I had this same issue upgrading from 6.20 to 6.24. hoersche's work-around was spot on. Everything went smooth after that one character change.

greg.1.anderson’s picture

giorgio79’s picture

Thanks patch worked fine here as well...

randallkent’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new864 bytes

Attached patch contains the fix from #22 as well as corrects the comment per @jonhattan in #22

moshe weitzman’s picture

Do folks think this is correct?

randallkent’s picture

Moshe -

Seems to fix the issue and as Greg said in #20, it's present in master. Still would be nice to have more people test :)

moshe weitzman’s picture

Assigned: Unassigned » jonhattan
Status: Needs review » Fixed

Committed to 4.x

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Corrected reference to the prior issue.