I recently installed the filefield 3.7, CCK 2.8 and imagefield 3.7 (core is 6.19), and they seem to be working fine except for this presumably permissions-related problem. Everytime cron runs i receive the following errors in my dblog:

error screenshot

The errors state the following:

Location: http://www.warmdebate.com/?/home/bottlewe/public_html/warmdebate.com/cro...

Message: unlink(sites/default/files/jason/global-temperature-solar-activity-improved.gif) [function.unlink]: Permission denied in /home/bottlewe/public_html/warmdebate.com/includes/file.inc on line 471.

Location: http://www.warmdebate.com/?/home/bottlewe/public_html/warmdebate.com/cro...

Message: Could not delete temporary file "/tmp/global_warming_debate_logo.png" during garbage collection

Location: http://www.warmdebate.com/?/home/bottlewe/public_html/warmdebate.com/cro...

Message: unlink(/tmp/global_warming_debate_logo.png) [function.unlink]: Operation not permitted in /home/bottlewe/public_html/warmdebate.com/includes/file.inc on line 471.

Location: http://www.warmdebate.com/?/home/bottlewe/public_html/warmdebate.com/cro...

Message: Could not delete temporary file "sites/default/files/jason/global-temperature-solar-activity-improved.gif" during garbage collection

My permissions for "sites/default" is 755, for "sites/default/files" it's 777, and for "sites/default/files/user" (where user is a username) it's 755. I suspect the problem might be that I need to change that to 777 but I wanted to ask before doing something like that.

I'm sorry if this has nothing to do with filefield, I don't know much about this CCK stuff. Thanks for the help :)

CommentFileSizeAuthor
Untitled.png14.86 KBarmanschwarz
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch’s picture

Sounds like file permissions problems all right. Drupal shouldn't have any problem deleting files its created because it should use the same Linux/Unix user when it uploads and deletes the file (so it should be the file owner already). If you're only experiencing these problems on a few files, I'd suggest just deleting them manually through SSH or FTP.

armanschwarz’s picture

Ok, well I can delete the file in sites/all/default/files/jason, but as for the other one: I don't know of any subdirectory called "tmp", certainly not in root. Where is this file supposed to be?

quicksketch’s picture

/tmp is in the root of your server's hard disk. Try FTPing directly to "/tmp" or using SSH to connect to your server if possible.

armanschwarz’s picture

Ok, funniest thing: I deleted the default/files/jason/global-temperature-solar-activity-improved.gif file, and it has since reappeared, along with the error!

I found the tmp directory in my root folder, and there is no file called "global_warming_debate_logo.png"

Any ideas?

quicksketch’s picture

Do you have some source control software installed on your server, such as SVN, Bazaar, or Git? Perhaps the file is maintained in your source control system. At this point you're probably best off contacting your host for help. The "/tmp" directory is not the same as the "~/tmp" directory in your home folder, which explains why you can't see the file in there.

armanschwarz’s picture

My host is non-responsive, has been for about a year now. I've been meaning to change but the servers are vey reliable and I've been burned so many times that I'm kind of reluctant... But thanks anyway. What about the file-reappearing issue?

armanschwarz’s picture

Ok the errors are occuring for all new files that were not properly submitted with nodes. My question now is; how should the permissions be set for the folders? Currently everything in /default/files is set to 755, and I'm getting no errors from drupal.

Next to "file system" in the drupal report it says "Writable (public download method)". I doubt this is a problem with my host, it seems like I mucked up the permissions somewhere but I just don't know where... So far filefield is the only module giving me any problems; does cck/filefield have any special permissions requirements?

quicksketch’s picture

No, FileField has no special requirements that differ from any other module that needs to upload files. You'd probably experience similar issues when uploading user pictures or using the "Upload" module that comes with core.

If you're looking for a good host, I recommend A2 Hosting. Great support, custom memory and upload limits. Plus you can SSH into the servers and fix problems like this more easily from the command line. They advertise on drupal.org too, so if you *do* switch, go click on the banner at http://drupal.org/hosting.

armanschwarz’s picture

My problem has now escalated to .js files as well so I've taken it here: http://drupal.org/node/960702

Thanks for your input, this obviously isn't a problem just with my filefield install anymore...

quicksketch’s picture

Status: Active » Closed (fixed)
xjm’s picture