You get Project xxx could not be downloaded to C:\inetpub\wwwroot\... folder when running 'drush pm-download' command on windows box. Detailed error can be accessed by running with --debug option, however it may be not very clear for users to do that and output of debug command is pretty messy. The actual error is Access denies trying to create new folder and elevated command prompt is most likely required to run drush.
Attached patch provides more meaningful message to windows users to remind them they should run elevated command prompt most likely and to log drush error without running --debug mode so it is more easier for users to troubleshoot.
Additionally drush_pm_lookup_extension_in_cache() and _drush_pm_get_extension_cache() functions are fixed to use correct temp folder by calling drush_find_temp(). I found later that similar implementation is done in #1049660: remove hardcoded drush pm extension cache but it is a little obsolete.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 1124092-Access-denied-error-using-pm-download-on-win.patch | 3.63 KB | kulov |
Comments
Comment #1
kulov commentedComment #2
kulov commentedComment #3
kulov commentedComment #4
greg.1.anderson commentedThe extension cache has been removed, so most of this patch is no longer necessary. Do we still need to remind the user about elevated privileges in the mkdir function? Seems that we should just put this in the Windows howto / readme; if a message is needed, then perhaps a more central location would be better? (Other commands besides mkdir may need elevated privileges.)
I think we can just close this out; re-open with a new patch if you want to deal with the message.
Comment #5
kulov commentedI think we should remind them of this possible scenario. It is a common mistake on Windows that has User Access Control enabled. It is also a common practice for programs to remind about that. It should be also included in other commands besides mkdir where it writes outside of its own folder. Its need has to be reviewed per every single location though. It is also important that drush_set_error is used in order to generate error that is seen without running verbose mode.
It is ok to move it to a separate issue, however I am not sure I am able to identify where it more central location should be or what are the other places that need this message.
Looking at it now there is one more thing that this patch does. It has improved and more readable implementation of
_drush_recursive_copy. It has aclosedir($dir_handle)to close the handle fromopendirabove it. I do not recall 100% what was the problem, but it lead me to fix it there.Comment #6
ice5nake commentedI am running drush in an administrator command prompt but I am still getting Access is Denied messages.
So far I've tried to disable a module, run help, and run status
status and help just give mkdir warning though. While disable gave opendir error. Let me know if there is anything I can do to help.
Comment #7
kulov commentedCan you get the output of running the command with --debug option, please?
Comment #8
greg.1.anderson commentedThis issue was marked
closed (won't fix)because Drush has moved to Github.If this feature is still desired, you may copy it to our Github project. For best results, create a Pull Request that has been updated for the master branch. Post a link here to the PR, and please also change the status of this issue to
closed (duplicate).Please ask support questions on Drupal Answers.