Closed (fixed)
Project:
Drush
Component:
Base system (internal API)
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Nov 2011 at 12:17 UTC
Updated:
5 Feb 2012 at 04:10 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
kotnik commentedAdding just lib directory wouldn't make much change, you'd be unable to write to it anyway.
Better solution is to inform user about the permissions problem, not to leave her in terminal with this generic error. Patch attached.
Comment #2
greg.1.anderson commentedThis is an improvement, but it would be even better to preflight the command with a call to is_writable, so that the error message only refers to permissions when that is in fact the source of the error.
Comment #3
kotnik commentedIt can not be any other issue, but permissions - hence that message. If you still insist, maybe to change error message to 'Unable to create directory !dir', without the permissions notice?
Comment #4
greg.1.anderson commentedmkdir can also fail if one of the parent folders is missing. #2 is best, and not much harder than #3.
Comment #5
kotnik commentedYes, but this function recursively creates parent directories if needed. It acts like 'mkdir -p'. Only reason it might fail is that it does not have write permissions.
Comment #6
greg.1.anderson commentedIs mkdir guaranteed by specification to only fail per #5? Out of disk space / inodes may be rare, but that does not change the fact that #1 is wrong, #3 is nominally okay, and #2 is best.
Comment #7
kotnik commentedOk, in unlikely event we run out of inodes, user will be informed that something other than permissions has happened.
Also, I expanded drush_mkdir(), since one-liner was very unreadable.
Comment #8
kotnik commentedRe-roll with coding standard fix and squashing multiple commits into one.
Comment #9
PvO commentedAs my upgrade stopped on line 249 of filesystem.inc (and with a memory_limit error) I tried this patch. There is no memory limit error anymore but still the upgrade does not continue. After I answer the firs question below with 'y' I get:
The second question is answered by the upgrade process, not by me.
Now I am really stuck. Do not know what to try else.
Thanks for helping me out!
Edit: Now could it be the directory can not be created because the whole path contains spaces? That was my problem with navigating with cygwin to apply the patch.
If anyone could tell me what directory to make I will make it by hand and then will try again.
Edit2: well, I think I see there is a function in filesystem.inc which should handle the space problem. Sorry.
Comment #10
PvO commentedWell....
I changed the root directory int "aliases.drushrc.php" to "D:\xampp\htdocs\waspik" and now the upgrade continued.
So recap: it was all a wrong root directory.
But ...
the upgrade was still not succesfull. I will start a new support request for new questions,
Comment #11
greg.1.anderson commentedCommitted. Thanks.
Comment #12
skwashd commentedThis patch solves 1 half of the problem. The original problem is that the path doesn't exist out of the box. I always install drush in /opt/drush as root and symlink the drush command to /usr/local/bin this is all done as root. All invocations of drush are by an unprivileged user who can't create the lib directory. I install Console_Table via PEAR so there is no need for drush to write to lib/ but drush insists on creating the directory at run time.
Creating the directory in the git repo solves the issue of the path not existing.
Comment #13
kotnik commentedThis is related to #1069364: Bypass default PEAR Console_Table.
Comment #14
greg.1.anderson commentedAgree with #12.
Comment #15
greg.1.anderson commentedAdded lib and lib/README.txt to git, and fixed up .gitignore. Maybe my change to .gitignore was spurrious, as I needed to use -f to add the README anyway.
Re-open if there are any issues with this; if it's okay, the same thing could be done to the drush-4.x branch.
Comment #16
ice5nake commentedI just installed drush to a new server using the pear channel. I get this error. How do I modify the permissions to make this work?
Comment #17
kotnik commentedice5nake, this is fixed in the latest HEAD.
Just start drush once as root, and you'll be good afterwards.
Comment #18
msonnabaum commentedBackported the error reporting fix, but we dont use lib in drush4 so i left that one.