Upload error, only last image is uploaded

DFox

Joined: 2007-07-08
Posts: 7
Posted: Sun, 2009-07-05 08:59

Hey,

I'm having a strange uploading issue. If I upload let's say three images, the first two will throw the error: Upload error: 500. Then, the last one, will upload successfully.

The error logs show: error: Uncaught Exception: @todo MISSING_IMAGE_FILE in file modules/gallery/helpers/photo.php on line 43

and: todo MISSING_MODEL item:3 in file modules/gallery/helpers/model_cache.php on line 27

Any insight into this issue would be greatly appreciated.

Thanks.

Regards,
~David

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Mon, 2009-07-13 03:22

Can you try with the latest code? I think this issue has been fixed.
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git | help! vote!

 
DFox

Joined: 2007-07-08
Posts: 7
Posted: Mon, 2009-07-13 05:18

Hmmm, it still seems to be happening on the first item being uploaded. It throws the ActionScript error "Error #2044: Unhandled IOErrorEvent:. text=Error #2038: File I/O Error.", and gives the Upload error: 500 in the interface.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Mon, 2009-07-13 14:14

Can you provide me with an account on your Gallery so that I can see the problem happening? thanks.
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git | help! vote!

 
DFox

Joined: 2007-07-08
Posts: 7
Posted: Mon, 2009-07-13 16:08

PM sent :)

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Tue, 2009-07-14 23:29

I tried uploading a 4MB photo to your site while watching the TCP stream and got a 500 error, so I can reproduce this. I'm guessing that something is going wrong on your site that's resulting in the file getting dropped. Can you verify that your upload_max_filesize setting is set to something reasonable on your server?
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git | help! vote!

 
DFox

Joined: 2007-07-08
Posts: 7
Posted: Tue, 2009-07-14 23:37

I've PMed you a link to a phpinfo outputting file on my server, but all of the upload settings should provide a maximum of 25mb file uploads, but you can look at them yourself to make sure I'm not missing anything, because it's very possible I am.

But also, on this same server, I use the WordPress file uploader which is Flash based also and I do multiple large files and no problems.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Thu, 2009-07-16 02:46

As far as I can tell, this is some kind of configuration issue on your server. I don't know what it is. There's probably an error in your Apache error logs that'll track it down. If I could get direct ssh access to your server, I could probably figure it out by changing the code to dump out enough diagnostic information to sort it out. But unless a lot of people report this, or I can get an efficient way to track it down, I'm going to move on.. sorry. Good luck, and let us know if you figure out a fix.

---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git | help! vote!

 
DFox

Joined: 2007-07-08
Posts: 7
Posted: Fri, 2009-07-17 12:49

OK, I solved the problem. You were right in one respect, it was a configuration issue (if you can call it an issue) on my server, but I don't think the issue should exist. It appears Gallery was surpassing the 64mb memory_limit, somehow, as when I bumped it up to 150mb, it started working perfectly. You can go back to the Gallery link I provided and test it out if you want.

But, with that said, that seems crazy to me. Can it be a problem that it's using so much memory for a 6-11mb file? I'm using the GD option for the image library. But anyway, maybe you can shed some light on whether needing more than 64mb of memory for this size file is normal or if it might be a memory usage problem in the uploader. I know resizing images is intensive, but I never thought that intensive.

Thanks, and let me know if there's anything else I can do to try to help.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Sat, 2009-07-18 03:16

This is a very common problem with the GD graphics library since it uses PHP's memory space. Remember that a 6-11 MB image is *compressed*. In order to rotate it, GD unpacks it into memory, then performs a rotation on it. This consumes huge amounts of memory. It should also have generated an error in your Apache log files somewhere (look for it, that way you know where to look in the future).

From: http://www.boutell.com/gd/faq.html

Why does gd cause my PHP script to run out of memory?

Most often, the problem is that the memory_limit parameter in php.ini is set to something very conservative, like 8M (eight megabytes). Increase that setting and restart the web server.
Of course, opening truly huge images can cause real memory problems, if several are open at once. 8,000 pixels times 8,000 pixels times four bytes for truecolor equals a walloping 256 megabytes.

If you want to avoid this problem, don't use GD. Use ImageMagick or GraphicsMagick.
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git | help! vote!

 
DFox

Joined: 2007-07-08
Posts: 7
Posted: Sat, 2009-07-18 03:57
bharat wrote:
This is a very common problem with the GD graphics library since it uses PHP's memory space. Remember that a 6-11 MB image is *compressed*. In order to rotate it, GD unpacks it into memory, then performs a rotation on it. This consumes huge amounts of memory. It should also have generated an error in your Apache log files somewhere (look for it, that way you know where to look in the future).

If you want to avoid this problem, don't use GD. Use ImageMagick or GraphicsMagick.

Ah, I see, thanks a ton for the information. I didn't realize GD was so memory intensive. I resorted to GD because when I had ImageMagick selected, I don't get any thumbnails. Although it does say on the graphics settings page "ImageMagick is available in /usr/bin", and I get no errors. Not sure what's going on with that, but at least I always have GD to go with if I can't get ImageMagick working despite the large memory consumption.