CTools fails to create the 'ctools/css' folder where the css cache is stored on some occasions. (i.e. wrong folder permissions in default/files, different Drupal file system settings, etc.)
When you use a module that depends on CTools (most notably Panels) this translates in this cryptic error:
'Selected file could not be uploaded, because destination is not properly configured' when you are trying to view a panel page.
You can solve the issue by manually creating the directory as described in issue #425446: The selected file ... could not be uploaded, because the destination is not properly configured" error occured
The big issue here is that when CTools fails to create the directory, there's no clear error message that provides a hint what causes the problem. Moreover, users are not pointed to possible solutions (create the folder manually, check your permissions, check file system settings, etc.)
Comment | File | Size | Author |
---|---|---|---|
#11 | filesystem_error.png | 21.85 KB | nickl |
#11 | old_error.png | 22.74 KB | nickl |
#11 | new_error.png | 26.16 KB | nickl |
#11 | happiness.png | 7.74 KB | nickl |
#11 | path-requirements-HEAD.patch | 1.1 KB | nickl |
Comments
Comment #1
merlinofchaos CreditAttribution: merlinofchaos commentedI added some code to make this more robust (Drupal's file API is really difficult to work with) and added a hook_requirements check as well. Hopefully this will take care of these issues.
Comment #2
JayKayAu CreditAttribution: JayKayAu commentedHi,
I have CTools (6.x-1.0-beta2) in my installation, and I've just updated my site to the Drupal 6.12 release. When I went and had a look at the status report, it gave the following:
"CTools CSS Cache Unable to create
The CTools CSS cache directory could not be created due to a misconfigured files directory. Please ensure that the files directory is corretly configured and that the webserver has permission to create directories."
To fix it, I did a chmod 777 on these directories:
drupalroot/sites/mysite/files/ctools
drupalroot/sites/mysite/files/ctools/css
I had to dig around on the internet first, then make an educated guess as to the problem. But the error message could have been a teensy bit more helpful, particularly for users with even less experience than me.
EDIT: I just realised that these files were created by the "_www" user, and when I copied the files across, I became the owner, and _www couldn't write the files/directories again. Incidentally, I am using OS X and copied through the Finder (I don't know if doing it that way behaves differently to a "cp" command wrt permissions).
Thanks for an otherwise great package :D
- J
Comment #3
nanatulip CreditAttribution: nanatulip commentedI have the same error message & I also have CTools (6.x-1.0-beta2) in my installation, and I've also just updated my site to the Drupal 6.12 release. When I went and had a look at the status report, it gave the following:
"CTools CSS Cache Unable to create
The CTools CSS cache directory could not be created due to a misconfigured files directory. Please ensure that the files directory is correctly configured and that the webserver has permission to create directories."
The problem is, I am one of those "less experienced" ones that you mentioned & I can't follow the example on your fix.
Tami
Comment #4
chrism2671 CreditAttribution: chrism2671 commentedI'm also experiencing this issue. I'm a little more experienced, so I have done the files/ctools/css 777 already (and a few variations) with little avail.
Is it possible to get the dev trunk modified so that it outputs a more useful error message?
Running D6.11
Comment #5
merlinofchaos CreditAttribution: merlinofchaos commentedI'm not sure what to put for a message When it fails, I can't necessarily tell why it failed, only that it couldn't create the directory it needs. There's something odd going on here, honestly, because Drupal doesn't let you install without configuring the files directory more or less properly anymore, so I'm surprised so many people run into this issue.
Comment #6
rgraves CreditAttribution: rgraves commentedI received the error in the status report and did chmod 777 of my files directory. The error went away and there is now a ctools directory within my /files/ directory.
However, I usually have the files directory not writable by the web server (644) and have subdirectories within it which are writable. This is to force our publishers to organize their files properly rather than putting them all in the root files directory.
Will this setup cause a problem with ctools?
Comment #7
merlinofchaos CreditAttribution: merlinofchaos commentedOnce the ctools/css directory is created, as long as *that* directory is writable by the webserver everything will be great.
Comment #8
rgraves CreditAttribution: rgraves commentedThat's what I thought. Thanks.
Comment #9
rgraves CreditAttribution: rgraves commentedI just tried changing the permissions on /files/ now that the ctools subdirectory was created and writable. Unfortunately, I get the following error unless my /files/ directory is chmod 777:
I'd prefer not to have /files/ writable since staff won't put their files in the proper subdirectories otherwise.
Comment #10
chrism2671 CreditAttribution: chrism2671 commentedCuriously this didn't work on my local laptop xampp LAMP/ubuntu setup, but on the live debian set up it worked just fine.
Mysterious.
Comment #11
nickl CreditAttribution: nickl commentedAttached are comparisons to the errors reported by filesystem.
Ctools is already way more verbose than the filesystem example.
The only improvement I would consider is to add the path to the message as per other modules with the same grievances. The before and after images are added as well as the success message displayed in status when all is well.
Patch rolled against HEAD.
Comment #12
nickl CreditAttribution: nickl commentedComment #13
andypostAnother opinion, regulary I get this kind of errors (subfolders) if umask setup incorectly
please, dont forget about #452704: Prevent blocking by firewalls compressed js and css files
Comment #14
nickl CreditAttribution: nickl commentedThis is purely a file_check_directory failed issue, afaik.
Comment #15
merlinofchaos CreditAttribution: merlinofchaos commentedCommitted nickl's patch with a small typo correction as well. Thanks!
Comment #17
SWeddig CreditAttribution: SWeddig commentedHi!
I get the following error if I try to apply you patch:
patching file ctools.install
Hunk #1 FAILED at 28.
1 out of 1 hunk FAILED -- saving rejects to file ctools.install.rej
What's wrong?
Thanks, Sandra
Comment #18
merlinofchaos CreditAttribution: merlinofchaos commentedI committed this patch all the way back in June; unless you have a version of ctools that dates back to then, this patch won't apply and is probably already applied to what yo uhave.
Comment #19
nomis CreditAttribution: nomis commentedHi, I had the same problem and i solved it like that :
Go on : Site Configuration / Files System
the path is (in my case) only :
"files"
so click the default button and the path is now :
"sites/default/files"
and dont forget to save the configuration.
I hope it will help someone else ;)
Comment #20
John_Buehrer CreditAttribution: John_Buehrer commentedI had the same problem, after upgrading Drupal to 6.17 and restoring my sites/... directory. Fiddling with permissions didn't help. Then I deleted the ctools/css directory hierarchy under default/files, and refreshed the status report screen. Problem fixed!
Apparently the creation really has to occur. Is there no check to see if the directory hierarchy already exists? And deleting only the css directory didn't work, it had to be ctools/css.
(Or maybe I did something wrong in the upgrade step?)
Comment #21
phunster CreditAttribution: phunster commented6.17 same problem, following comment #20 (Thanks John) worked for me.
Comment #22
fkildoo CreditAttribution: fkildoo commentedcomment #20 fixed my problem as well!
Comment #23
kuan CreditAttribution: kuan commented#19 works.
Comment #24
itserich CreditAttribution: itserich commentedRelatively new to Drupal.
Moving from shared host to vps.
Got the error message message:
* Unable to create CTools CSS cache directory. Check the permissions on your files directory.
* Unable to create CTools CSS cache directory. Check the permissions on your files directory.
Checked File System #19 which appeared to be as directed "sites/default/files"
Made a backup then deleted "sites/default/files/ctools"
Flushed cache and got this:
# The directory sites/default/files/ctools has been created.
# The directory sites/default/files/ctools/css has been created.
Point is #20 above worked for me. Thanks!
Comment #25
itserich CreditAttribution: itserich commentedI got this error a second time.
I had switched to vps and had permission errors, most of which were fixed.
The host suggested switching to suPHP and this problem came back.
However, this time #20 did not work. I could not delete files/ctools - the system would not let me.
Solution
I renamed the original ctools file ctools1. Created a new ctools and ctools/css and ctools/style and gave them all permissions 777.
It works now. Still can not delete the original ctools1. Don't like using 777 but it seems correct and common.
Comment #27
acbramley CreditAttribution: acbramley commentedComment #20 worked for me too. Cheers!
Comment #28
pkcho CreditAttribution: pkcho commentedI am having a similar problem... I receive this error:
"Unable to create CTools CSS cache directory. Check the permissions on your files directory."
But in my case, nothing is created in my default/files directory, so I can't apply the solution mentioned in #20. The permissions are fine on both the default and files directory, so I don't know what's going on.
I just moved my site from a shared host to a VPS. Just recently, I migrated it to a shared host and the ctools cache folders were created fine.
Any clues?
Thank you.
Joe
Comment #29
itserich CreditAttribution: itserich commented@ signal
Are you sure the permissions are fine? When I changed to a VPS it had a different PHP method which required different permissions.
Comment #30
elgarrai CreditAttribution: elgarrai commentedI have the same problem when i upload to my server i have this err massage
The CTools CSS cache directory, sites/default/files/ctools/css could not be created due to a misconfigured files directory. Please ensure that the files directory is correctly configured and that the webserver has permission to create directories.
I'm using drupal 6.20 with ctools version = "6.x-1.8" info file information ; $Id: ctools.info,v 1.3 2009/07/12 18:11:58 merlinofchaos Exp $
Comment #31
matthew.moses CreditAttribution: matthew.moses commented#20 worked for me. Make sure you delete the ctools/css/ folder which is in the sites/default/files and not within the modules folder.
Comment #32
brycesenz CreditAttribution: brycesenz commentedsubscribing.
Comment #33
marquito CreditAttribution: marquito commented#20 worked for me too. remember to clear the entire "ctools" directory from sites/default/files
Comment #34
ahmedhanyfawzy CreditAttribution: ahmedhanyfawzy commentedWorked for me too i put the detailed steps to solve this issue in this blog post
Thanks
Comment #35
ytsurk#20's fine .. ;)
Comment #36
merlinofchaos CreditAttribution: merlinofchaos commentedIt *is* checking.
It's entirely possible that something like SELinux might be making the directory invisible to CTools or something goofy like that, which would explain why deleting it or renaming it and letting CTools create a new one works.
Comment #37
whaigle CreditAttribution: whaigle commentedThe following change was made and the result was "CTools CSS Cache Exists."
In the file ctools.install, I have changed the following code on line 15 as follows:
function ctools_requirements($phase) {
$requirements = array();
if ($phase == 'runtime') {
$path = file_create_path('ctools/css');
This last line has been changed to $path = file_createpath('css');
Realize that the 'ctools' has been removed. In my opinion to have the 'ctools/css' is the wrong path since the css directory
is outside of the ctools directory, and the ctools.install needs to create the css folder which is inside the ctools directory. I have no error even after cron is reactivated. Do you think that I should have problems in the future by removing the "ctools/"?
Comment #38
merlinofchaos CreditAttribution: merlinofchaos commentedYes, the path of the directory is [yourfilepath]/ctools/css
Removing the 'ctools' tries to create the wrong directory. There is another 'css' directory in files, but that is not the one ctools uses, that's for core.
Comment #39
jessicakoh CreditAttribution: jessicakoh commented#20 works.
Thank you @John_Buehrer
Comment #40
ret5 CreditAttribution: ret5 commented#20 - FTW!
Comment #41
arcki CreditAttribution: arcki commented1) Went to drupal_install_folder/sites/default/files
2) moved the folder drupal_install_folder/sites/default/files/ctools/css to drupal_install_folder/sites/default/files/ctools/cssold
3) Created a new drupal_install_folder/sites/default/files/ctools/css
4) made sure it is writable : chmod 777 ctools/css
Comment #42
ergophobe CreditAttribution: ergophobe commentedAs one other possibility - I got this because I had exceeded my disk allocation.
I use Web Enabled for staging new projects and by default a new project only gets a fairly small amount of disk space. So of course it couldn't create add files to the cache -- it couldn't add files to anything!
Comment #43
msociety CreditAttribution: msociety commentedI upgraded to drupal core 7.10 and now I can't get rid of this problem... have tried *all* suggestions.
Even removed and re-installed ctools completely. Running drupal on standard LAMP stack.
Any other suggestions?
Comment #44
thisDrupal CreditAttribution: thisDrupal commentedFor what it may help my fellow OSX users around. I hit this snag when trying to copy a working install to a test site location (core Drupal v7.8, on Lion here).
In my case, the problem seemed to be with the _www owner of the ../sites/default/files/ directory and its contents. When copying via the Finder or using Terminal to do a regular cp -pR from source/ to test_site OSX refuses to assign _www as the owner. So I had to force it by doing sudo cp -pR source/ test_site/
Hope it helps.
Comment #45
lcgrs CreditAttribution: lcgrs commentedSolution #20 has indeed solved this problem.
Comment #46
ytsurkagain - after server movement - #20 helped.
deleting the ctools dir creats the whole structre again ;)
Comment #47
josejayesh CreditAttribution: josejayesh commentedi got this error and given a recursive write permission to /sites/default/files folder and fixed the issue
videofog@jayesh-VPCEA43EG /var/www/sites/default $ chmod -R o+w files/
videofog@jayesh-VPCEA43EG /var/www/sites/default $ pwd
/var/www/sites/default
videofog@jayesh-VPCEA43EG /var/www/sites/default $
Comment #48
progone CreditAttribution: progone commentedmake sure the owner of that directory is NOT 'root'
Comment #49
beakalteshome CreditAttribution: beakalteshome commentedI encountered the same problem that ctool was not able to create ctools/css because of the mis-configured file permission. In my drupal 7 site settings.
1. config-->file share-->was configured independently such that I have public, private separate files
2. I looked at my ctools.install file and it says public://ctools
3. changed the file permission for ctool folder under my public directory (files/public/ctools) which I had already custom created to chmod 775 for both the css and the ctools folder
4. problem gone
The difficulty in my case was that there was another ctools folder inside files/ and I was wasting my time trying to change the permission for that.
Make sure you work with the actual ctools folder
Comment #50
merlinofchaos CreditAttribution: merlinofchaos commentedRemoving tags that shouldn't have been added.
Comment #51
talas CreditAttribution: talas commentedFirst, create directory sites/default/files/ctools/css
Second, chmod the directory "css" to 777
All done.
Comment #52
dianacastillo CreditAttribution: dianacastillo commented# 20 worked for me and then I had to change the file permisions in files and everything was okay again
Comment #53
dddave CreditAttribution: dddave commentedOld issue with lots of helpful info. Setting to fixed.
Comment #55
Anonymous (not verified) CreditAttribution: Anonymous commentedCTools CSS Cache Unable to create
The CTools CSS cache directory, ctools/css could not be created due to a misconfigured files directory. Please ensure that the files directory is correctly configured and that the webserver has permission to create directories.
followed this and warning has gone and ctools recreated itself
Comment #56
chlee CreditAttribution: chlee commented#20 worked for me too. Me happy :-)
Comment #57
Anonymous (not verified) CreditAttribution: Anonymous commented#20 worked for me. Thanks John!
Comment #58
jim.applebee CreditAttribution: jim.applebee commented#20 Worked for me as well.
Thank you.
Comment #59
cfox612 CreditAttribution: cfox612 commentedRemoving the folder all together did not work for me. Once I changed the permissions on BOTH the ctools and css folders the error has stopped (for at least the past 16 hours).
The reappears. I'm not sure what is happening to make it reappear, but it does. As long as I clear the cache it goes away, but seeing as I need to do that at least once a day there has to be a better solution.
Comment #60
couturier CreditAttribution: couturier commentedGo to the next folder higher up and change permissions there.
Comment #61
cfox612 CreditAttribution: cfox612 commentedThat folder is set just fine as well.
The error just popped up again for me. Something changed the css folders permissions from 777 to 775. That seems to throw the error. I have no idea what is altering folder permissions since it happened over the weekend it would be difficult to pin point. I do know that no additional posts were added.
Comment #62
couturier CreditAttribution: couturier commentedDrupal automatically corrects folder permissions, I believe. As long as the css folder has been created and permissions remain at 775, that is fine. What is your error? Please copy the wording for us.
Comment #63
cfox612 CreditAttribution: cfox612 commentedError: The CTools CSS cache directory, ctools/css could not be created due to a misconfigured files directory. Please ensure that the files directory is correctly configured and that the webserver has permission to create directories.
The public file system path is: sites/default/files/images
Files and Images are set to 777. There are then individual folders within images for the various content types to keep things more organized, so changing the folder structure is not an option.
If I clear the cache the error goes away, but obviously this isn't the best solution.
Comment #64
couturier CreditAttribution: couturier commented@cfox612 You are using Drupal 7? Earlier comments in this thread apply to Drupal 6. Try these things for Drupal 7, CTools 7.x-1.3:
1. Check to make sure the most recent version of CTools is installed.
2. Go to sites/default/files/ctools -- If you do not see a "ctools" folder here, something is wrong. Manually create a "ctools" folder.
3. Now, you can manually create a css folder under ctools, like this: sites/default/files/ctools/css -- Make sure the files, ctools and css folder permissions are 775.
4. Your error should disappear. Drupal will automatically correct folder permissions back to 775 if you have them set to anything else, such as 777.
Let us know how it goes.
Comment #65
cfox612 CreditAttribution: cfox612 commentedI removed the ctools folder from /sites/default/files/images, placed new one in /sites/default/files and error has gone away. Hopefully for good!
Thanks!
Comment #66
criscom#49 solved it for me. I had custom configured my file system default/files/public and didn't adjust permissions for ctools/css in this directory. Instead I fiddled around default/files/ctools/css, of course, to no avail. After changing the permissions in system default/files/public/ctools/css the error was resolved.
Comment #67
cfox612 CreditAttribution: cfox612 commentedWell that worked about as long as the others. The ctools and css folders I created in /sites/default/files still exists with proper permissions, but the one I deleted within the /sites/default/files/images folder has re-created itself.
Error:
The CTools CSS cache directory, ctools/css could not be created due to a misconfigured files directory. Please ensure that the files directory is correctly configured and that the webserver has permission to create directories.
My public file system path is "non-standard" (/sites/default/files/images) so I'm wondering if that might have something to do with it?
Comment #68
viswanathsai CreditAttribution: viswanathsai commented#20 worked for me ...... i deleted sites/files/ctools and problem got resolved.
Comment #69
leistiko_texvet CreditAttribution: leistiko_texvet commentedFWIW: #51 worked for me.
Comment #70
brodhagen CreditAttribution: brodhagen commentedsudo chown -R www-data:www-data /sites/default/files
Had the same error after my site migration, perms were correct but the file owners were wrong. I had to assign the directory (files) and everything inside (-R) to my new 'user:user-group' that had apache web write permissions (a+w); in my case, www-data.
NOTE: can also solve write perm issues with Drupal File System.
Comment #71
surendra77c CreditAttribution: surendra77c commentedPlease configure your file setting :
admin/config/media/file-system follow this link
under : Public file system path
give the path : sites/default/files
remaining keep default as it is . it will work
Comment #72
BassPlaya CreditAttribution: BassPlaya commentedboth #20 and #49 worked.
Cheers!
Comment #73
jary CreditAttribution: jary commentedjust make the files writable
chmod o+w sites/default/files
and then it will create ctools directory inside the files folder, make sure to make the ctools and ctools/css folder writable as well
Comment #74
hosttor CreditAttribution: hosttor commentedSOLVED change the permission on example.com/web/sites/default/files/ctools to 755
Comment #75
saimonn007 CreditAttribution: saimonn007 as a volunteer commentedin my case the problems was in server - I used all space I had, so drupal couldn't make any action.
Comment #76
AlexAndrei04 CreditAttribution: AlexAndrei04 commentedEl comentario #51 funciono para mi problema. Saludos.
Comment #77
cabita CreditAttribution: cabita commented#24 worked for me. Thanks.
Comment #78
Powergird CreditAttribution: Powergird commentedI just solved this issue and I did like these:
chage these folder from 755 to 777
sites/default/files
sites/default/files/ctools/css
sites/default/files/tmp
sites/default/files/js
I hope it is helpful.
Comment #79
drupalfan2 CreditAttribution: drupalfan2 as a volunteer commentedI have the same problem.
Till now none of the solutions above worked for me, still unsolved.