Needs review
Project:
ImageCache
Version:
6.x-2.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Mar 2009 at 16:48 UTC
Updated:
4 Dec 2012 at 23:10 UTC
Jump to comment: Most recent file
Comments
Comment #1
pspdrupal commentedI'm having the same issue. Previous uploaded images work fine but none of the new ones I upload appear and I get the same error message.
Comment #2
pspdrupal commentedI found the problem. The permissions were not set correctly in the folder: sites/default/files/imagecache. I changed them and the error is gone.
Comment #3
lizbethalml commentedyeah so did I!!!!!! My partner had copied the folders with the name of the imagecaches directly in ftp so... we flushed the presets and everything worked! thank God!!!
Comment #4
lizbethalml commentedComment #5
rosquilla commentedHi,
could you please tell me which are the correct permissions to set? Thanks a lot! Best regards!
Comment #6
vertazzar commentedthey must be 777
Comment #7
rainbreaw commentedIf resetting the permissions does not work for you -- I found that editing the imagecache.module file on line 555 to say this:
if (!file_exists ( $dir )) { mkdir($dir); }
else if (!file_check_directory($dir, FILE_CREATE_DIRECTORY) && !mkdir($dir, 0775, TRUE))
instead of just
if (!file_check_directory($dir, FILE_CREATE_DIRECTORY) && !mkdir($dir, 0775, TRUE))
solves the problem. It just re-enforces the check to see if the directory imagecache is trying to make already exists.
I hate the idea of editing a module, and am not sure if this is the best solution, but changing permissions didn't solve the issue for me and this edit did.
Comment #8
soapmode commentedI'm having the same problem with imagecache, getting the error message 'warning: mkdir() [function.mkdir]: File exists in...' and images not displaying. I'm using it with Ubercart, of which it's a core component. I have no idea what's wrong, but it seems clear to me that Imagecache is a source of constant problems. I also tried editing line 555 of the module, as described above, but no dice. Please help!
Additional: I've set the files folder, plus all related Imagecache folders to 777. I've also flushed preset images through Drupal. I have clean URLs enabled. Still nothing.
Edit: Setting files/ to 777 with owner and group recursion ticked seems to have fixed this.
Comment #9
cpapaya commentedI am having similiar problem. Old files are showing. But imagecache is creating a second folder. files/files
I changed the code of imagecache_module line 555 & it did not work
New folder is still created & new pictures are not seen
how do I fix this
Comment #10
kip stanning commentedafter migrating a site pictures of imagecache directories were shown but new pictures were not saved in imagecache directories and - consequently - didn t show up.
error messages were something like "unllink" pointing to a line in file.inc and a message containing mkdir.function (or something like that) pointing to line 555 in imagecache module (file exists ...).
i discovered by chance that new presets worked perfectly and didn t bother about this malfunction any more but just added new presets and enabled them in views and user profile pages.
thx for your discussion folks. hope somebody can make use of my solution in similar situations.
greetings from vienna forest
kip / karl staudinger
Comment #11
tomchapin commentedI had this same problem and at first I couldn't figure it out (I had the permissions for sites/default/files/ all set to 0777 and everything seemed correct), until I remembered that I had changed the default location for uploaded files when I had initially set up drupal.
So yeah. Go to /admin/settings/file-system and check to see what your actual file path is for uploads and make sure that it exists and has the proper permissions. You will also need to set permissions to 0777 for any sub-folders (such as "imagecache" and "imagefield_thumbs").
I hope this helps.
Comment #12
wwwoliondorcom commentedUbercart shop products pictures disapeared after imagecache update
Hi,
Any idea why Ubercart products pictures have disapeared after Image cache update ?
Thanks for your help.
Comment #13
bstoppel commentedI applied the same patch that rain indicated in comment #7. It worked for me.
Comment #14
JAScarb commentedThis occurred to me today, out of the blue. I notice the owner of the problem files isn't the same as the owner of all the successful files. I've raised a support issue with my host and will keep you posted. Directories 777 didn't fix, but I haven't done the module change yet, it seems like a good plan to work out what's changed since yesterday.
Comment #15
JAScarb commentedOh, I'm also getting http error 0 occurred /filefield/aha/product/field_image_cache/1 . There is no aha subdirectory of filefield, which is 755. Perhaps it wants that to be 775 at least.
Response does seem very slow from the site, so perhaps this is a different (performance, attack) issue.
Comment #16
christefano commentedThe solution for this is explained at Troubleshooting imagecache migration handbook page.
Comment #17
marcus7777 commentedThanks (@rainbreaw) that was a big help :0)
I needed to add ("imagecache/a/b/c") directories to the files folder so:
Thanks again.
Marcus
Comment #18
gultig commentedThank you. Changing permissions on all sub-folders for the actual upload file path.
Worked for me.
Comment #19
junkbox commentedThis error will also popup if the path to the public/files folder can not be found. In my case I use an external drive for my public files and cache folders. It had become unplugged and was obviously not available to the system. Likewise if you're using an external for these and it becomes unmounted you'd get that error. Just a heads up.
Comment #20
ufku commentedThis is not a file/directory permission issue.
It happens on multiple concurrent requests that create imagecache images in the same folder. It only happens once when a new folder is created. That's why people think it is fixed after it's first occurrence.
While request-1 is creating the folder, request-2 checks its existence and also tries to create it because it is missing. However, request-2's attempt (mkdir) fails because the folder is already created by request-1 in the meantime.
Comment #21
Makku01 commentedand how can one deal with this issue?
Comment #22
mikeytown2 commentedline 604 of sites/all/modules/imagecache/imagecache.module
Comment #23
tic2000 commentedI confirm the issue in 20.
I'm uploading images using swfupload in a form. The directory where the images are uploaded is created when displaying the form. On submition for each image uploaded a node i created and when done I redirect to a view with a list of thumbnails. No matter if I upload 2 images or 100 only one thumbnail will not be displayed and I have 3 watchdog errors. A php from mkdir() and 2 from imagecache for not being able to create the directory and not being able to create the image.
If I use the solution in 22 the image is created, but the php error still appears in watchdog. I moved !is_dir($dir) between file_check_directory() and mkdir() and the issue is fixed.
Comment #24
christefano commented@tic2000: Thanks for the tip! Can you reroll the patch at #22 with your change?