Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Some Technical Details
- Drupal Version: 5.3
- MySQL database Version: 5.0.24a
- PHP Version: 5.2.3
- Unicode library: PHP Mbstring Extension
- Web server: Apache/2.0.61 (Unix) PHP/4.4.7 mod_ssl/2.0.61 OpenSSL/0.9.7e mod_fastcgi/2.4.2 DAV/2 SVN/1.4.2
- Image Module Version: 1.209.2.48 2007/09/29 05:19:40
- ImageMagick Version: 6.2.4 09/16/06 Q16
Drupal Configuration Details
- File system set to "/home/user/files/example.com"
- Temporary directory set to "/home/user/files/example.com/tmp"
- Download method set to "Private"
- Default image path set to "images", which should result in "/home/user/files/example.com/images"
- These other directories also exist:
- /home/user/files/example.com/images/import
- /home/user/files/example.com/images/temp
- /home/user/files/example.com/tmp
Noticed Behavior
- When I first installed the site fresh, the following directories magically appeared:
- /home/user/example.com/files/tmp
- /home/user/example.com/files/images
- /home/user/example.com/files/images/import
- /home/user/example.com/files/images/temp
I think that's all of them (plus or minus one or two).... I'm not sure, I'm trying to remember, because I have since deleted the directories in an effort for troubleshooting.
- When I go to import an image, the following happens:
- Image gets moved from "/home/user/files/example.com/images/import" to "/home/user/files/example.com/images/temp"
- Image node is created and Image Import page (admin/content/image_import) says "The selected file /home/.watson/user/example.com could not be copied."
- The original image, which was moved to "/home/user/files/example.com/images/temp" has not moved, it is still in this directory.
- No image thumbnails have been created ANYWHERE.
Troubleshooting Steps
- Disabled the Image Attach feature per the suggestion of http://drupal.org/node/84405... Didn't help.
- Tried tinkering around with different file names (spaces, no spaces, length, etc), extensions (jpg vs JPG), and sizes (200KB vs 2MB - thought ...maybe... this could have had something to do with it originally because PHP is set to 4MB limit) and this didn't make any difference.
- Reinstalled entire Drupal installation to see if it was something wonky from when I switched from public to private. This reinstallation was an entirely clean install. I had completely deleted the database, reinstalled Drupal, reconfigured the Drupal install step-by-step, reconfigured the modules, and tried to again import images. Didn't help.
- Haven't upgraded to a newer version of Drupal yet because I have a module I'm using for something completely unrelated that doesn't yet support an upgrade.
Any help would be greatly appreciated.
Comment | File | Size | Author |
---|---|---|---|
#24 | image_file-exists_243895.patch | 2.01 KB | Hetta |
Comments
Comment #1
RobertNelsonVance CreditAttribution: RobertNelsonVance commentedOpps.... I don't think this should be marked "critical". Changing.
Comment #2
RobertNelsonVance CreditAttribution: RobertNelsonVance commentedFurther note...
My webhost has your domain setup in your home directory under a directory labeled the domain name.... let's say "/home/user/example.com", which is where your Drupal site would typically reside (or at least mine does).
Now.... this error message says "The selected file ... could not be copied"
I am wondering.... could it be possible that Drupal is looking for a file instead of a folder.... since the folder name is something like "/home/user/example.com/..."?
Could this be botching things up?
Comment #3
dman CreditAttribution: dman commentedpermissions on /files and /files/images are as they need to be? (Writable by the webserver)
Visiting your admin site status, filesystems settings and admin image settings didn't throw up any warnings?
Comment #4
Hetta CreditAttribution: Hetta commentedIf you're using imagemagick, have you moved imagemagick.inc to /includes/ ?
Comment #5
RobertNelsonVance CreditAttribution: RobertNelsonVance commented@Hetta - I do NOT believe I have moved anything as such. But in checking.... "image.imagemagick.inc" IS in "example.com/includes/". Is this bad? If so, where should it be?
@dman - ALL permissions for anything relating to this issue have been set to 777.... the images I was importing and ALL the directories that are used (the ones mentioned above in my initial topic post). The ONLY Status Report warning I have is about Cron cause I haven't run it yet.
Any thoughts on my #2 comment (http://drupal.org/node/243895#comment-798725)?
Comment #6
Hetta CreditAttribution: Hetta commentedOk, get the latest version of image (5.x-1.7 is current, I believe), and tell us if the problem still exists. Image 1.3 is WAY old.
And a google search for drupal + your error message gave this:
http://drupal.org/node/160671
Comment #7
RobertNelsonVance CreditAttribution: RobertNelsonVance commented@Hetta - Ok.... downloaded the http://drupal.org/node/222736 copy of the Image module. Moved the old copy to "{Image 20080308}" in my module directory. Unzipped and uploaded the newer version of Image. Didn't solve the problem.
Comment #8
RobertNelsonVance CreditAttribution: RobertNelsonVance commentedUpgraded module to latest Version didn't solve this issue.
Comment #9
RobertNelsonVance CreditAttribution: RobertNelsonVance commentedGoing to attempt Drupal update, will post back with results.
Comment #10
RobertNelsonVance CreditAttribution: RobertNelsonVance commentedOk.... so, I upgraded to Drupal 5.7 today and made sure ALL the active modules were up-to-date. I also uninstalled and removed from the modules directory ALL of the inactive modules.
The directories mentioned above have not changed. Neither have any other configurations. Just upgraded Drupal and active modules.
ALL previous errors mentioned in this thread no longer exist. However, I am now receiving the following error: "Unable to create scaled Thumbnail image".
I am observing that the original image is moved from "/home/user/files/example.com/images/import" to "/home/user/files/example.com/images". As far as the temp directory, "/home/user/files/example.com/images/temp" remains empty. NO thumbnails have been saved ANYWHERE.
Thoughts?
Comment #11
RobertNelsonVance CreditAttribution: RobertNelsonVance commentedLet me put it this way..... Is there anyone out there who has successfully setup the image module using the private file setup? If so, what configuration did you use? Drupal version, Image module version, directory structure, etc. Thanks.
Comment #12
dman CreditAttribution: dman commentedWell, I'll say this, you deserve an award for being the most polite, useful, troubleshooter with a problem I've seen here for a while!
Kudos!
However, it's still tricky to guess from here what's up at your end.
Me, I go into the core file.inc and start dumping diagnostics.
Eg, go into /includes/file.inc, find
and add something like:
to see if that func is really receiving an empty filename.
If so, backtrack... could be the file_move right back at image.module:
Try a diagnostic dump there
...
etc. etc.
Comment #13
Hetta CreditAttribution: Hetta commented"Is there anyone out there who has successfully setup the image module using the private file setup? If so, what configuration did you use? Drupal version, Image module version, directory structure, etc. Thanks."
I've been using private files on drupal 5 since I switched my site to drupal, in February last year (it went live in September).
That's:
Private files
Drupal 5.1 through 5.7
Image module 5.x-1.(whatever) through 5.x-2-dev (which I currently use)
admin/settings/file-system
File system path:
/home/server/user/drupal/files (this is OUTSIDE of web root, cos I use private files)
Temporary directory:
/tmp
(x) private files
admin/settings/image
Default image path:
images/xx
admin/settings/image_import
Image import path:
/home/server/user/drupal/files/import/
MySQL 5.0.26 (and 5.whatnot on the live server)
PHP 5.2.5 (and 5.whatnot on the live server)
Apache/2.2.3 (and 2.whatnot on the live server)
Adding debugging messages to file.inc sounds like a really good idea.
Comment #14
Hetta CreditAttribution: Hetta commentedOh, and did you remember to move image modules' imagemagick.inc to /includes/?
If you don't have GD installed, and don't move imagemagick's include file, you can't create thumbnails ...
Comment #15
thomas23@drupal.org CreditAttribution: thomas23@drupal.org commentedOn my site the same error occures after attempt to create "new content image", i.e. create an image node. The error only pops up if I choose imagemagic toolkit; everything is fine with gd2 selected. See below that convert is in the right place.
Messages are:
This is version 6-dev. Some more tech infos from drupal's status page:
$ ls -l /usr/bin/convert
-rwxr-xr-x 1 root root 25881 Jul 3 15:21 /usr/bin/convert
Comment #16
jp.stacey CreditAttribution: jp.stacey commentedWe're having the same problems on the site we're currently building (6.x-1.0-alpha3).
I've been sticking
var_dump()
s into_image_build_derivatives()
(the source of the error) and below, and have come up with a couple of pointers.$size['operation']
, which should have been "scale" by default, was set to NULL. This breaks the switch/case statement based on this variable. Going to admin/settings/image and just saving the form with the dropdowns all on their default ("Scale image") fixed this.image_gd_resize()
can be found, butimagecreatefromjpeg
cannot. This is because the default Apache/PHP/GD stack does not necessarily include JPEG support.Diagnosis: firstly, can you convert GIFs? Secondly, run
phpinfo()
e.g. put a file in your Drupal root called e.g.test.php
containing:phpinfo();
(Remember to delete this file afterwards as it reveals your server config and is therefore a minor security risk.) Now visit e.g. http://example.com/test.php. You should see a table of the details of gd support (which means Drupal doesn't complain), but it won't contain anything about JPEG support.
The solution is to either recompile (or reconfigure) PHP-GD. I'm getting a sysadmin to look at this for us (the server is a slightly esoteric RHEL system running a multi-user developer environment, so it ain't obvious what I should be tweaking).
Any thoughts on where to put the "scale" bug? And should this bug move to core Drupal image.inc rather than this module? It's clear to me that just saying "GD is working on your server" isn't enough of a diagnostic, if JPEG support might not be present. I've had a quick Google and GD-minus-JPEG is fairly common out of the box.
Comment #17
jp.stacey CreditAttribution: jp.stacey commentedI should add that my original error was very similar to the first posters i.e:
As above, that suggests it's trying to copy the Drupal root. Maybe if this is primarily a GD/JPEG issue, then the issue for the image module is to improve the error reporting?
Comment #18
Sivaji_Ganesh_Jojodae CreditAttribution: Sivaji_Ganesh_Jojodae commentedThe following steps solved my problem
1.create a new folder /tmp/files
mkdir /tmp/files
2. change the file permission
chmod 777 /tmp/files
3.Goto url "?q=admin/settings/file-system" set the Temporary directory to "/tmp/files" and click the button save configuration
4.Now goto url ?q=admin/content/node_import you will be able to upload the file
Comment #19
Robrecht Jacques CreditAttribution: Robrecht Jacques commentedAre you sure this is about the node_import module? Moving it back to image_import.
Comment #20
bscoz CreditAttribution: bscoz commentedOn my end, this seems to have something to do with the image size. Even after changing the import options I cannot upload an image that has a preprocessing size of more than 1.5 mb without getting a "file doesn't exist" error.
I've worked around by just ftping to the import directory and using the batch import page, but just posting this in case it helps resolve the issue.
Comment #21
estim8d CreditAttribution: estim8d commentedI ALSO get this error...
Comment #22
barretr CreditAttribution: barretr commentedFixed the problem for me. Thanks, dman.
Comment #23
sunTo summarize:
- Image module should spit out an error message on admin/settings/image, if files, files/images, or files/images/temp is not writable by the webserver.
- The other issue, mentioned in #20, is probably caused by usage of is_file() instead of file_exists() - numerous comments on php.net mention that is_file() tries to loads the entire file into memory on certain platforms.
Comment #24
Hetta CreditAttribution: Hetta commentedOK, patch attached, fixing that in the three files where it's found in the image folder. Note, after applying the image.imagemagick.inc should be copied to /includes/ again ...
Comment #25
sunComment #26
Hetta CreditAttribution: Hetta commentedThe current HEAD already does throw an error to admin if files or files/import isn't writable ... dunno about temp, though.
Comment #27
sunawww... Please do not update previous comments (only to fix grammar or typos).
Setting proper status.
Comment #28
sunThanks, committed.
Comment #30
ohthehugemanatee CreditAttribution: ohthehugemanatee commentedNote for posterity:
I updated from 5.1 to 5.18, and updated all my modules. One of my sites had this exact problem... in the end, going to /admin/settings/image and hitting "reset to defaults" solved the problem.
Comment #31
FrancewhoaThe following worked for me http://drupal.org/node/541872
Comment #32
rajmataj CreditAttribution: rajmataj commentedSolution might be here if using FileField
Comment #33
stewest CreditAttribution: stewest commentedThis worked for me, uncheck "Active Updating" if using FileField
http://drupal.org/node/734680#comment-2807130