A few days ago I started getting a couple of errors every time cron ran when I would upload an image (I use imagefield, filefield and CCK) and then leave the node without uploading it. The cronjob would then be tasked with removing the file and would fail (more on that here: http://drupal.org/node/958784). However, today I checked my logs and discovered a horrendous flood of errors during the last cron run, all saying variations of this:

unlink(sites/default/files/js/js_49b30f9031391231ea218f5aa2790a7e.js) [function.unlink]: Permission denied in /home/bottlewe/public_html/warmdebate.com/includes/file.inc on line 471.

So this is obviously not just a CCK issue but there must be something wrong with my permissions, I just don't know what. Here are my current permissions according to my ftp client:

sites 755
sites/default xxx
sites/default/files 777
sites/default/files/filename.xxx 644
sites/default/files/js 755
sites/default/files/js/filename.xxx 644

by filename.xxx I mean all the individual files. Maybe these files should be 755 instead of 644? But how do I change the default? In "Status report" under filesystem there is no error (green tick) and it says " Writable (public download method)". For the record my site runs fine, I would never have guessed there was a problem if I didn't check the logs, here are the versions of relevant modules I'm using (all latest updates):

Core 6.19
CCK 6.x-2.8
FileField 6.x-3.7
ImageField 6.x-3.7

Thanks for any advice in advance.

Comments

armanschwarz’s picture

Still getting about 50 of these every day, would really appreciate some advice on where to look! Thanks.

ayesh’s picture

Try deleting all files in js and css folders.
I figured out this myself by disabling boost module.

armanschwarz’s picture

I did that, but then the files just reappear in the js folder and the permissions of those files (inside files/default/js) are 644 again, and the error reappears...

ayesh’s picture

Did you add the perms to the folder, recursively?

armanschwarz’s picture

As I said, they just reappear as 644 (changing the permissions of the files doesn't change anything because they're cache files and get replaced)

ayesh’s picture

I managed to set perms to,

write:true
read:true
execute:false

and it solved.

armanschwarz’s picture

I'm happy for you. Sadly it doesn't fix my problem.

just_fixed_it’s picture

Without knowing anything specific about the problem/solution, if it was me I'd use general error finding techniques, e.g.

start to turn everything off until the problem goes away then start adding stuff back in
build a simple version from scratch and see if that works
check all logs (many times over) & read the detail (I normally miss the key bit first time around)
find out what has changed in the environment (server upgrades, etc.)
transfer the build to a different environment

Have you tried all these?

Good luck