warning: touch() [function.touch]: Unable to create file ... on line 417.

marcvangend - April 16, 2009 - 12:28
Project:ImageCache
Version:6.x-2.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:needs work
Description

After adding a new image ('testimage.jpg', using imagefield) to a node, I get a warning on a view which is supposed to contain the 'thumb' preset of this image:

warning: touch() [function.touch]: Unable to create file tmp/thumbtestimage.jpg because No such file or directory in /htdocs/drupal/sites/all/modules/imagecache/imagecache.module on line 417.

The first thing I noticed, is that there seems to be a slash missing in tmp/thumb_imagetestimage.jpg. I changed line 410 to $lockfile = file_directory_temp() .'/'. $preset['presetname'] .'/'. basename($src); and it seems to solve the problem. I will do some more testing but I guess that slash should be fixed anyway.

AttachmentSize
imagecache_lockfilepath.patch678 bytes

#1

marcvangend - April 16, 2009 - 13:13

Sorry, forget about the patch. It didn't solve the problem after all :-\
This means that I'm stuck with an error I don't understand... The derived images are generated correctly, but the generation of a scaled images causes the error. The error is only shown on the next page, probably because the messages have already been rendered by the time the error is caused. I'm on a windows machine (so folder permissions cannot be the problem) but my colleague with an OSX system gets the same behavior.

#2

drewish - April 17, 2009 - 00:52
Category:bug report» support request
Status:active» fixed

not sure exactly but i'd check that you've got a valid temporary directory set for drupal's files settings.

#3

marcvangend - April 17, 2009 - 08:05

The temporary directory is set correctly, I already checked that.
As far as I'm concerned this isn't fixed yet, but I will leave it fixed for now. If the problem persists after moving the site to a remote server, I will reopen this issue.
Andrew, thanks so far.

#4

System Message - May 1, 2009 - 08:10
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

#5

MrPhilbert - July 11, 2009 - 18:10

This is caused by Drupal looking for a file directory that does not exist.
You have to create a file directory other than the default temp.
Under file system, override the default settings and type something like /temp.
The default settings has mamp included in the directory. This is O.K. if that's what you're using but not otherwise.
Besides, it's best to choose where you want these files.

#6

drupaloo - July 14, 2009 - 22:25

I am having this problem as well, on a local, Windows based, XAMPP installation.

@ MrPhilbert - could you please explain
1) What file directory do I have to create, i.e. where should it be located
2) Since the error message refers to the directory called /tmp, should it not be called /tmp, instead of /temp like you suggest?
3) How would one choose where you want these files?

Thanks!

#7

danyalejandro - September 10, 2009 - 17:52
Status:closed» needs work

Confirmed on Drupal 6 and imagecache's latest version, on WAMP server (PHP 5.2.0, Apache 2.2.11, MySQL 5.1.36). Creating drupal/tmp directory seems to fix the problem for me... something's really wrong here....

#8

katovit777 - October 28, 2009 - 17:30

Thank you! that worked for me also.. im running WAMP server 2.0.. creating a directory called "tmp" in the installation of drupal seemed to fix the problem..

 
 

Drupal is a registered trademark of Dries Buytaert.