In a Drupal 7.4 install with ctools 7.x-1.0-beta1 I get this error in the status report:

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 files folder is set to 0777 and ctools creates the folders ctools and ctools/css when I delete them. Why do I still get that message?

Comments

merlinofchaos’s picture

That's a good question. If the directory is 0777 and the folder is created, then CTools shouldn't be giving that message. I can't think of a reason that would be happening, either. The code creates the directory, then checks to make sure it can write to the directory.

Is it somehow creating an unwritable directory?

thesurger’s picture

Had this problem too, and after running these two commands, everything seems to be okay now.

This is a temp fix, after cron, problem comes back
-----------------------------------------------------------------
semanage fcontext -a -t httpd_cache_t '/var/lib/drupal7/files/default/ctools/css'

restorecon -v '/var/lib/drupal7/files/default/ctools/css'

NOTE: if you copy and paste my code, be aware that your directory path may be different than mine. Noticed that this directory is not the same as the /usr/share/drupal7/modules/ctools/css core files!!!!

So don't go and delete the folder in your modules cause the error relates to a different folder, specifically for caching. I did that first, and had to put the files back after realizing this.

Tool
-----
You can get your exact error message by going to the /var/log directory and typing this command
"tail --lines=20 messages"

Additional note: FIXES FOR GOOD
--------------------------------------------
I have had to manually set the owner and the permissions this way
chown apache:apache /var/lib/drupal7
chcon -R -h -t httpd_cache_t /var/lib/drupal7

yan’s picture

Both ctools/ and ctools/css are 0755 when they get created by Drupal.

Daedalon’s picture

whaigle’s picture

I have been combing google in search of a solution to the same error that others have had before me. That is, "The CTools CSS cache directory could not be created due to a misconfigured files directory...." I have applied as many suggestions mentioned in the forum as possible with no success. What can be done to rectify the ctools css directory error?

sonicthoughts’s picture

Spent several hours trying to figure this out after migration. Very hard to nail down.

japerry’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Drupal 7 is no longer supported, closing.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.