I am getting this error using Drush under windows

drush pm-download services-7.x-3.x-dev --yes --verbose --debug

Downloading project services to C:\Users\James2\AppData\Local\Temp/drush_tmp_1349249507_506be9e3d4b04 ... [0.95 sec, 18.58 MB] [notice]
Executing: curl --fail -s -L --connect-timeout 30 -o ""C:\\Users\\James2\\AppData\\Local\\Temp\\dowB636.tmp"" ""http://ftp.drupal.org/files/projects/services-7.x-3.x-dev.tar.gz?date=13...""
Calling is_readable(C:\Users\James2\AppData\Local\Temp\dowB636.tmp) [2.23 sec, 18.67 MB] [debug]
Calling is_writable(C:\Users\James2\AppData\Local\Temp/drush_tmp_1349249507_506be9e3d4b04) [2.23 sec, 18.67 MB] [debug]
Calling rename(C:\Users\James2\AppData\Local\Temp\dowB636.tmp, C:\Users\James2\AppData\Local\Temp/drush_tmp_1349249507_506be9e3d4b04\services-7.x-3.x-dev.tar.gz?date=1344949467) [2.23 sec, [debug]
18.67 MB]
Calling _drush_recursive_copy(C:\Users\James2\AppData\Local\Temp\dowB636.tmp, [debug]
C:\Users\James2\AppData\Local\Temp/drush_tmp_1349249507_506be9e3d4b04\services-7.x-3.x-dev.tar.gz?date=1344949467) [2.23 sec, 18.67 MB]
Unable to copy C:\Users\James2\AppData\Local\Temp\dowB636.tmp to C:\Users\James2\AppData\Local\Temp/drush_tmp_1349249507_506be9e3d4b04\services-7.x-3.x-dev.tar.gz?date=1344949467. [2.23 [error]
sec, 18.67 MB]
Unable to move C:\Users\James2\AppData\Local\Temp\dowB636.tmp to C:\Users\James2\AppData\Local\Temp/drush_tmp_1349249507_506be9e3d4b04\services-7.x-3.x-dev.tar.gz?date=1344949467. [2.23 [error]
sec, 18.67 MB]
Downloading services-7.x-3.x-dev.tar.gz?date=1344949467 was successful. [2.23 sec, 18.59 MB] [notice]
Calling md5_file(C:\Users\James2\AppData\Local\Temp/drush_tmp_1349249507_506be9e3d4b04\services-7.x-3.x-dev.tar.gz?date=1344949467) [2.23 sec, 18.59 MB] [debug]
md5_file(C:\Users\James2\AppData\Local\Temp/drush_tmp_1349249507_506be9e3d4b04\services-7.x-3.x-dev.tar.gz?date=1344949467): failed to open stream: No such file or directory drush.inc:792 [warning]
[2.23 sec, 18.6 MB]
File services-7.x-3.x-dev.tar.gz?date=1344949467 is corrupt (wrong md5 checksum). [2.23 sec, 18.59 MB] [error]
Error downloading services [2.23 sec, 18.59 MB] [notice]

Only seems to be for some modules

If I use pm-download with the --dev option I don't get this issue.

drush pm-download services --dev --yes --verbose --debug

So I'm guessing it have something to do with the ?date=XXXXXX part being somehow included in the file name being generated?

Comments

DrMiaow’s picture

Issue summary: View changes

In the end my solution turned out to not be the solution.... So I'm a little stuck now.

moshe weitzman’s picture

Assigned: Unassigned » dmitry_bezer
Issue tags: +Windows
mmcdougall’s picture

Issue tags: -Windows

Not a windows only issue, occurs in linux also.

I think I have a fix for this which occurs when dev update versions are requested.

In drush/commands/pm/package_handler/wget,inc, on line 52, there is:

  // Add <date> to URL so it is part of the cache key . Dev snapshots can then be cached forever.
  if (strpos($release['download_link'], '-dev') !== FALSE) {
    $release['download_link'] .= '?date=' . $release['date'];
  }
  $filename = basename($release['download_link']);

should probably be replaced with this:

  $filename = basename($release['download_link']);
  // Add <date> to URL so it is part of the cache key . Dev snapshots can then be cached forever.
  if (strpos($release['download_link'], '-dev') !== FALSE) {
    $release['download_link'] .= '?date=' . $release['date'];
  }

so that "?date=", which is not removed with the basename() function, is not appended to the file name also.
Windows and Linux don't like to copy or move files when the destination file name contains a "?" char.

jonhattan’s picture

I'm unable to reproduce this in ubuntu.

cgmonroe’s picture

Status: Active » Closed (duplicate)

I checked out the master branch to do a patch for this and found it was fixed in this issue:

#1782444: dev project update in Windows filesystem fails with md5 sum failure

Marking as duplicate.

jayjaydluffy’s picture

Version: » 7.x-5.8
Assigned: dmitry_bezer » Unassigned
Status: Closed (duplicate) » Closed (fixed)

i can confirm #2 works for me! thanks mmcdougall..

liquidcms’s picture

Version: 7.x-5.8 » 7.x-5.9
Status: Closed (fixed) » Reviewed & tested by the community

i have an odd environment.. i run drush in Ubuntu VM but site files are in a Windows shared filesystem - anyway, tried fix in #2 and it fixes this issue (which remains in 5.9) - any chance we can get this committed?

ahh.. i see marked as fixed.. but sadly it isn't in 5.9 which is much newer than when this was closed as a duplicate which was stated as fixed.. so guessing not fixed in -dev either.

moshe weitzman’s picture

Status: Reviewed & tested by the community » Postponed (maintainer needs more info)

can someone figure out if something is needed?

greg.1.anderson’s picture

Version: 7.x-5.9 » 8.x-6.x-dev
Status: Postponed (maintainer needs more info) » Closed (won't fix)
Issue tags: +Needs migration

This issue was marked closed (won't fix) because Drush has moved to Github.

If desired, you may copy this bug to our Github project and then post a link here to the new issue. Please also change the status of this issue to closed (duplicate).

Please ask support questions on Drupal Answers.

greg.1.anderson’s picture

Issue summary: View changes

More details.

jneubert’s picture

Issue summary: View changes
Status: Closed (won't fix) » Closed (duplicate)