I cannot get the drush dl command to work on windows when there are additional paramers like "--drupal-project-rename=drupal7"

It is probaby a permission problem? Anyway, on the PC I'm working as the administrator.

Thanks for any help!

Members fund testing for the Drupal project. Drupal Association Learn more


mjross’s picture

I am seeing the same behavior. In these tests, I'm running the latest versions of Drupal and Drush, on my D: partition, in a temp directory. In the first test, no options are specified, and the download completes successfully, despite the error message that the drush_tmp_1349890664_5075b268be991/drupal-7.15 file already exists (when in fact it does not).

D:\tmp :: drush dl drupal

Destination directory                                                    [error]
already exists.
Project drupal (7.15) downloaded to D:/tmp/drupal-7.15.                [success]
Project drupal contains:                                               [success]
 - 3 profiles: testing, standard, minimal
 - 4 themes: stark, seven, garland, bartik
 - 47 modules: drupal_system_listing_incompatible_test,
drupal_system_listing_compatible_test, user, update, trigger,
translation, tracker, toolbar, taxonomy, system, syslog, statistics,
simpletest, shortcut, search, rdf, profile, poll, php, path, overlay,
openid, node, menu, locale, image, help, forum, filter, file,
field_ui, text, options, number, list, field_sql_storage, field,
dblog, dashboard, contextual, contact, comment, color, book, blog,
block, aggregator

In the second test, below, the pm-download (a.k.a. dl) command fails if the drupal-project-rename option is provided:

D:\tmp :: drush dl drupal --drupal-project-rename=new

Source directory                                                         [error]
drupal-7.15 is not readable or does not exist.
failed to open stream: No such file or directory filesystem.inc:229
Project drupal (7.15) could not be downloaded to D:/tmp/new.             [error]

It uses a temporary file, "drush_tmp_1349890538_5075b1ea68957/x drupal-7.15", which does not exist prior to executing this test. (I'm not sure if there is a space in "x drupal-7.15" in the command's output, because it wraps at the right edge of the Windows terminal.) The default project name, "drupal-7.15", is part of the temporary file's name. Perhaps the pm-download command always uses the default project name when downloading the file, but then tries to use the replacement project name -- in this case, "new" -- when later trying to use that file, thereby causing this problem. That is suggested by the warning that Drush is trying to copy drush_tmp_1349890538_5075b1ea68957/new, but it could not be opened.

greg.1.anderson’s picture

Title: drush dl error when used with parameters (e.g. --drupal-project-rename) » drush dl error on Windows when used with --drupal-project-rename
Status: Active » Postponed (maintainer needs more info)
Issue tags: +Windows

Please show output with --debug, as requested in the issue submission guidelines. (Trim output from tar, though; that's quite a few lines for Drupal core.)

drupov’s picture


here's my --debug info.

$ drush dl drupal --drupal-project-rename=something --debug
Bootstrap to phase 0. [0.02 sec, 2.49 MB]                            [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drush() [0.02 sec, 2.64 MB] [bootstrap]
Cache HIT cid: 5.7-commandfiles-0-fcd3410a32e1858e2a34508738d3fa0e [0.09 sec, 2.65 MB]                           [debug]

Bootstrap to phase 0. [0.11 sec, 5.55 MB]                                                                    [bootstrap]

Found command: pm-download (commandfile=pm) [0.12 sec, 5.55 MB]                                              [bootstrap]

Loading version_control engine. [0.13 sec, 5.57 MB]                                                             [notice]

Loading package_handler engine. [0.14 sec, 5.59 MB]                                                             [notice]

Executing: wget --version
Loading release_info engine. [0.16 sec, 5.61 MB]                                                                [notice]

Including C:\ProgramData\Drush\commands/pm/download.pm.inc [0.17 sec, 5.73 MB]                               [bootstrap]

Downloading release history from http://updates.drupal.org/release-history/drupal/7.x [0.17 sec, 5.84 MB]       [notice]

Executing: which wget
Executing: curl --fail -s -L --connect-timeout 30 -o "C:\\Users\\aaaaaaa.bbbbb\\AppData\\Local\\Temp\\dow3F42.tmp" http:
Calling drush_delete_dir(C:\Users\aaaaaaa.bbbbb\AppData\Local\Temp\dru3F31.tmp, 1) [1.35 sec, 5.84 MB]           [debug]

Calling is_readable(C:\Users\aaaaaaa.bbbbb\AppData\Local\Temp\dow3F42.tmp) [1.35 sec, 5.84 MB]                   [debug]

Calling is_writable(C:\Users\aaaaaaa.bbbbb\AppData\Local\Temp) [1.35 sec, 5.84 MB]                               [debug]

Calling rename(C:\Users\aaaaaaa.bbbbb\AppData\Local\Temp\dow3F42.tmp,                                            [debug]

C:\Users\aaaaaaa.bbbbb\AppData\Local\Temp\dru3F31.tmp) [1.35 sec, 5.85 MB]
Downloading project drupal to C:/Users/AAAAAA~1.BBB/AppData/Local/Temp/drush_tmp_1349939757_5076722d61b68 ...   [notice]

[1.35 sec, 5.85 MB]
Executing: curl --fail -s -L --connect-timeout 30 -o "C:\\Users\\aaaaaaa.bbbbb\\AppData\\Local\\Temp\\dow43D5.tmp" http:
Calling is_readable(C:\Users\aaaaaaa.bbbbb\AppData\Local\Temp\dow43D5.tmp) [5.6 sec, 5.85 MB]                    [debug]

Calling is_writable(C:/Users/AAAAAA~1.BBB/AppData/Local/Temp/drush_tmp_1349939757_5076722d61b68) [5.6 sec,       [debug]

5.85 MB]
Calling rename(C:\Users\aaaaaaa.bbbbb\AppData\Local\Temp\dow43D5.tmp,                                            [debug]

C:/Users/AAAAAA~1.BBB/AppData/Local/Temp/drush_tmp_1349939757_5076722d61b68\drupal-7.15.tar.gz) [5.6 sec,
5.85 MB]
Downloading drupal-7.15.tar.gz was successful. [5.61 sec, 5.85 MB]                                              [notice]

Calling                                                                                                          [debug]

[5.61 sec, 5.85 MB]
Md5 checksum of drupal-7.15.tar.gz verified. [5.63 sec, 5.85 MB]                                                [notice]

No fileinfo or mime_magic support available. [5.63 sec, 5.85 MB]                                                 [debug]

Examining C:/Users/AAAAAA~1.BBB/AppData/Local/Temp/drush_tmp_1349939757_5076722d61b68\drupal-7.15.tar.gz         [debug]

headers. [5.63 sec, 5.85 MB]
Mime type for C:/Users/AAAAAA~1.BBB/AppData/Local/Temp/drush_tmp_1349939757_5076722d61b68\drupal-7.15.tar.gz    [notice]

is application/x-gzip [5.63 sec, 5.86 MB]
Calling                                                                                                          [debug]

drush_delete_dir(C:\Users\aaaaaaa.bbbbb\AppData\Local\Temp\drush_tmp_1349939757_5076722d61b68\dru5488.tmp, 1)
[5.64 sec, 5.86 MB]
Calling                                                                                                          [debug]

C:\Users\aaaaaaa.bbbbb\AppData\Local\Temp\drush_tmp_1349939757_5076722d61b68\dru5488.tmp) [5.64 sec, 5.86 MB]
Calling rename(C:\Users\aaaaaaa.bbbbb\AppData\Local\Temp\drush_tmp_1349939757_5076722d61b68\dru5488.tmp,         [debug]

C:\Users\aaaaaaa.bbbbb\AppData\Local\Temp\drush_tmp_1349939757_5076722d61b68\dru5488.tmp.gz) [5.65 sec, 5.86
Calling chdir(C:\Users\aaaaaaa.bbbbb\AppData\Local\Temp\drush_tmp_1349939757_5076722d61b68) [5.65 sec, 5.86      [debug]

Executing: gzip --decompress "C:\\Users\\aaaaaaa.bbbbb\\AppData\\Local\\Temp\\drush_tmp_1349939757_5076722d61b68\\dru548
Calling chdir(c:\xampp\htdocs\sandbox) [5.78 sec, 5.86 MB]                                                       [debug]

Calling chdir(C:\Users\aaaaaaa.bbbbb\AppData\Local\Temp\drush_tmp_1349939757_5076722d61b68) [5.78 sec, 5.86      [debug]

Executing: bsdtar.exe -xvf dru5488.tmp
Calling chdir(c:\xampp\htdocs\sandbox) [7.7 sec, 6.03 MB]                                                        [debug]

Calling is_readable(C:/Users/AAAAAA~1.BBB/AppData/Local/Temp/drush_tmp_1349939757_5076722d61b68/x                [debug]

drupal-7.15) [7.7 sec, 6.09 MB]
Source directory C:/Users/AAAAAA~1.BBB/AppData/Local/Temp/drush_tmp_1349939757_5076722d61b68/x drupal-7.15 is    [error]

not readable or does not exist. [7.71 sec, 6.09 MB]
Verifying signature for svn version control engine. [7.71 sec, 6.04 MB]                                          [debug]

Executing: svn info c:/xampp/htdocs/sandbox
Verifying signature for bzr version control engine. [7.72 sec, 5.87 MB]                                          [debug]

Executing: bzr root c:/xampp/htdocs/sandbox
Calling                                                                                                          [debug]

c:/xampp/htdocs/sandbox/something) [7.74 sec, 5.87 MB]
copy(C:/Users/AAAAAA~1.BBB/AppData/Local/Temp/drush_tmp_1349939757_5076722d61b68/something): failed to open    [warning]

stream: No such file or directory filesystem.inc:229 [7.74 sec, 5.87 MB]
Project drupal (7.15) could not be downloaded to c:/xampp/htdocs/sandbox/something. [7.74 sec, 5.87 MB]          [error]

Command dispatch complete [7.74 sec, 5.84 MB]                                                                   [notice]

Peak memory usage was 6.32 MB [7.74 sec, 5.84 MB]                                                               [memory]

Thanks for your time on this.

greg.1.anderson’s picture

Component: Windows Installer » PM (dl, en, up ...)
Status: Postponed (maintainer needs more info) » Active

I see. Drush is using the output from tar to find out the name of the drupal folder. It is expecting to get something like "drupal-7.15", but instead it gets:



This is converted into /path/to/destination/x drupal-7.15, which fails due to the space. The fix is to figure out why the output from tar is wrong for you, and either adjust the way that Drush calls it, so that it outputs the correct text, or filter the text so that Drush gets the expected result.

jonhattan’s picture

Output lines from tar are of the form "x file" in some versions / platforms. I remember this from an old macos issue.

This code is now at drush_tarball_extract():

    if ($listing) {
      // We use a separate tar -tf instead of -xvf above because
      // the output is not the same in Mac.
      drush_shell_cd_and_exec(dirname($path), "$tar -t%sf %s", $tar_compression_flag, basename($path));
      $return = drush_shell_exec_output();

but this snippet is only run for non-windows.

Bernsch’s picture

Component: PM (dl, en, up ...) » Windows Installer

Hy! I have the same Error:

I use Drush-5.7-2012-08-20-Installer-v1.0.19.msi from http://drush.ws/drush_windows_installer and Drupal 7.15

When i use this comand: drush dl drupal-7 --drupal-project-rename=new i becom this error message:

Source directory [error]
C:/Users/Username/AppData/Local/Temp/drush_tmp_1350574573_508021ecf3d85/x drupal-7.16 is not readable or does not exist.
copy(C:/Users/Username/AppData/Local/Temp/drush_tmp_1350574573_508021ecf3d85/new): faild [warning]
to open stream: No such file or directory filesystem.inc:229
Project drupal (7.16) could not be downloaded to c:/wamp/www/new [error]
emarchak’s picture

Confirmed the same error occurs on an upgraded dev version of drush.

greg.1.anderson’s picture

Regarding #5, there is a link in the code to the related issue #1775520: Windows Drush: core update issue with destination directory already existing. It seems that the problem here is that drush_is_windows() is reporting that the MinGW-based Windows system is NOT Windows, so the Linux branch is being used. If the code path followed the Windows branch, then the stripping of the spurious "x" is already handled. I don't know if we need to adjust drush_is_windows() for MinGW (affecting behavior throughout Drush), or if we need to use a different test just in this code to select the right branch for Windows.

Ahigh4life’s picture

Title: drush dl error on Windows when used with --drupal-project-rename » drush dl error on Windows when downloading a module
Version: » 7.x-5.8

I get this error then trying to download. Help!!!!

$ drush dl nivo_slider
chdir(): Permission denied (errno 13) drush.inc:792 [warning]

chdir(): Permission denied (errno 13) drush.inc:792 [warning]

Unable to untar C:\Users\Gbenga [error]

o_slider): [warning]
failed to open stream: No such file or directory filesystem.inc:229
Project nivo_slider (7.x-1.10) could not be downloaded to [error]


sinasalek’s picture

I also have this issue

Frank Ralf’s picture

You might also have a look at #1957616: Issue when downloading with drush.

greg.1.anderson’s picture

Version: 7.x-5.8 » 8.x-6.x-dev
Status: Active » 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.