Closed (duplicate)
Project:
Printer, email and PDF versions
Version:
7.x-1.2
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
25 Sep 2012 at 14:53 UTC
Updated:
3 Dec 2014 at 19:14 UTC
Jump to comment: Most recent
Comments
Comment #1
jcnventuraIt also happens to me, and it's a slight annoyance, that I mean to fix one day.
I think it means simply that the user with which you're running drush doesn't have write permissions to create those directories in the Drupal public directories. Those dirs should be created by Drupal itself when it's running as the web server user. If they aren't (log messsages will indicate that), then you need to fix the permissions on the public directory.
João
Comment #2
DeNelo commentedYes, that seemed to work - set write perms on the tmp and ttfontdata folders, and drush no longer complains.
Thanks!
(I set a won't fix status on it, not sure if that's entirely true.)
Comment #3
drupsup commentedhi,
> Those dirs should be created by Drupal itself when it's running as the web server user. If they aren't (log messsages will indicate that), then you need to fix the permissions on the public directory.
what should those perms be?
here,
Comment #4
DeNelo commentedI've got:
Don't know if this is a secure setup - but it works for me.
Comment #5
drupsup commentedeven using "your" perms, I can't get this error to go away.
fwiw, my Drupal web user *IS* wwwrun:www, so this shouldn't be an issue even with what I had ...
Comment #6
DeNelo commentedI would like to help you out, but I'm afraid I'm out of options - other than that I know it has to do with permissions, as stated in #1. I guess it's fiddle-around-time... (again)
Comment #7
jcnventura@drusup: however, when you're running drush you are NOT your Drupal web user.. And your user is not allowed to create those dirs. Even if it was, they would be owned by the wrong user which could create problems later.. The fix for this is simply to try to check permissions before creating those. This is however completely harmless and not high on my priority list, as it only affects drush users.
Comment #8
drupsup commented> when you're running drush you are NOT your Drupal web user
That's correct. I'm root ... which makes this
> And your user is not allowed to create those dirs
questionable.
> The fix for this is simply to try to check permissions before creating those
as I said, didn't work for me.
> This is however completely harmless and not high on my priority list, as it only affects drush users.
understood.
for me, i'd rather know that my modules are handling files/folders/perms correctly, so, i'll rm it from production for now.
thanks!
Comment #9
jcnventuraJust for clarification: the module handles the files/folders permissions correctly, but it assumes the code is to be used by Drupal. Drush does other things, and one of those is the fact that it runs the PHP code as a different user than Drupal normally does.
The fact that your root user is not able to create that directory, but clearly your Drupal user is means that your setup has safeguards in place somehow preventing your root user from doing those operations. The fact that your listings have the ACL bit on, as indicated by the '+' sign at the end of your listing might help in finding out what the problem in your setup is.
However I do acknowledge that there's a problem if it is trying to create those dirs during the cache clean.. Currently the module creates those dirs in hook_init(), and it shouldn't.. Like Drupal core, it should only try to create them before running the 3rd party lib.
Comment #10
modctek commentedAny updates on this issue?
Comment #11
jcnventuraFixed in #2103095: Failed to create directory public://print_pdf/print_pdf_tcpdf/cache
Comment #12
SandPond commentedIf you attempt to run Drush as "root" you will receive this error (depending on the command used). So switch to the user account that owns the Drupal installation that you are working on by entering the following command (substitute your particular user for "drupal_website_user":
su - drupal_website_user
To switch back to "root" user enter:
exit
It's possible that there is more than one cause of this error?
Comment #13
Anonymous (not verified) commentedI believe this to be a file permissions issue. I fixed it by setting my local account as owner and the webserver user apache as the group;
sudo chown -R localuser:apache print_pdf/*replace 'localuser' with your local nix box user account. You might need to change 'apache' if your web server has a different system name.
also you should check and add write permissions for group recursively:
sudo chmod -R g+w print_pdf/**note you don't need to use the sudo prefix on the terminal if you login as root and change these permissions. For those of you who are not familiar with it.
Comment #14
SandPond commentedRecursively changing file "ownership" and "permissions" for apache and any local users could be risky or at least unorthodox. I would suggest simply logging in as (or switching to) the proper user (original Drush install user) as detailed in #12 above. Alternatively Drush could be reinstalled while logged in as the user which one wishes to run it under.