So I've tried asking for help with this issue already (#943296: Please review these log entries, #960702: Getting a flood of errors relating to permissions with every cron run, #960720: Getting a flood of errors relating to permissions with every cron run and others) but no one has been able to give me a straightforward answer. So I'll try to describe my problem as concisely as possible hopefully someone here can help me out:

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)". I'm using core 6.19

Whenever I get errors in my cron log I also noticed that my javascript starts getting mixed around, so I have facebook "like" buttons where my google ads should be, and vice versa. Basically my site is a total mess. Manually deleting the default/files/js directory temporarily solves the problem for a couple of hours.

Please let me know how I can fix/approach this without using chmod, and please don't tell me I have to change my permissions, I already know that, I just don't know what to change them to. Also please don't direct me to the plethora of existing drupal tutorials on this topic because they only tell me the folder permissions, they don't address the problem that all my files are 644.

I should add that when I hit "Clear all Caches" the js folder is cleared out, so obviously drupal can delete these files...

Comments

shady_gun’s picture

well try disabling modules one by one ... Are you using any dev version modules?? if so disable them first ....

try cron run after disabling each module .. and keep checking Recent log entries after each cron run ...

Most probably some module is conflicting with other modules...

WillHall’s picture

Did you check the file owner?

armanschwarz’s picture

How do I do that? I'm using Cpanel

shady_gun’s picture

cpanel either provides you ftp or ssh access .. connect via ssh and see if you can see the file ownership

armanschwarz’s picture

I don't have ssh, just ftp. I'm using filezilla and can't see any way to find the file owner...