Image Uploads suddenly broken - no errors

CGreenTX

Joined: 2004-12-20
Posts: 51
Posted: Fri, 2005-01-14 02:10

I installed Alpha 4 on my FreeBSD box and all appeared to be working. I uploaded an album and it worked fine. I tried to create more albums later and it hung about halfway through uploading images. I cancelled and found the placeholders in the album with no images. I had difficulty deleting the album (it kept just going to an empty browser saying done at the bottom) but eventually got it to go away by deleting the parent album.

After this, if I attempt to upload an image through any method it goes immediately to an empty browser. I upgraded to the latest CVS version for grins and have the exact same behavior. Before I blow away the database and start over does anyone have any ideas?

Thanks!
Chris Green

----

Gallery URL (optional): http://ftp.greenfam.org/gallery2
Gallery version: CVS 2005-01-13
Webserver (with version): Apache 2.0.52
Datatabase (with version): mySQL 4.1
PHP version (eg 4.2.1): 5.0.3
phpinfo URL (optional): http://ftp.greenfam.org/test.php
Graphics Toolkit(s): gd, netpbm, imagemagick
Operating system: FreeBSD 5.3
Web browser/version: Firefox 1.0

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Fri, 2005-01-14 05:44

Apache 2, MySQL 4.1, PHP 5.0.3, FreeBSD 5.3. That's quite a lineup. I'm a little disappointed that you're not running a dev build of MySQL 5, though -- that would have been more impressive. :-)

It's a little hard to tell what is going wrong here. If you're getting the blank page it means that Apache is crashing, most likely because PHP is seg faulting. For a start, check your Apache error logs and see if there are seg fault messages in there. Try turning on buffered debug mode in config.php and if that doesn't give you anything try immediate or logged debug mode. Let us know what you turn up.

 
CGreenTX

Joined: 2004-12-20
Posts: 51
Posted: Sun, 2005-01-16 00:12

[client 10.227.1.1] PHP Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 4800 bytes) in /usr/local/www/greenfam/gallery2/modules/gd/classes/GdFunctionality.class on line 268, referer: http://ftp.greenfam.org/gallery2/main.php?g2_view=core:ItemAdmin&g2_subView=core:ItemAdd&g2_itemId=353&g2_return=http%3A%2F%2Fftp.greenfam.org%2Fgallery2%2Fmain.php%2Fv%2FClubGP_Car%2F2003-09-26-Fall_Family_Event_2003%2F%3Fg2_itemId%3D353%26amp%3Bg2_view%3Dcore%3AShowItem&g2_returnName=album&g2_navId=
[Sat Jan 15 18:02:31 2005] [error] [client 10.227.1.1] File does not exist: /usr/local/www/greenfam/favicon.ico

Thoughts?

Chris Green

PS - I know it seems bleeding edge, but everything there is considered stable. The only one I personally debated on was the PHP5. I may downgrade that if I have to. :P

 
CGreenTX

Joined: 2004-12-20
Posts: 51
Posted: Sun, 2005-01-16 03:08

Here is debug log output on a failed image. It seems randome or maybe file-size related. I successfully uploaded an image, then tried another and it failed. I'm baffled.

Chris Green

http://ftp.greenfam.org/debug1.log

 
CGreenTX

Joined: 2004-12-20
Posts: 51
Posted: Sun, 2005-01-16 03:13

Interesting... I noted in the log it was using the Gd graphics toolkit. I changed the priority to bump ImageMagick up to the top and it worked fine. Any reason one would work over the other? Which is the best to use? I know NetPBM requires JHead to keep my EXIF information so I'm guessing it is slower?

Chris Green

 
CGreenTX

Joined: 2004-12-20
Posts: 51
Posted: Sun, 2005-01-16 05:45

Alright... More monologue for me tonight. Every time I think I've got this licked it rears its head again. When i do a bulk upload of pictures through either applet it just hangs after a chunk of photos. If I cancel, the photos that have uploaded to that point show up, which is an improvement over what was happening with Gd. It appears I'm not getting any apache or PHP crashes at this point. Any ideas?

Chris Green

 
CGreenTX

Joined: 2004-12-20
Posts: 51
Posted: Sun, 2005-01-16 06:17

When it aborts, I get this in the apache log:

[client 10.227.1.1] script '/usr/local/www/greenfam/gallery2/gallery_remote2.php' not found or unable to stat

Chris Green

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Mon, 2005-01-17 21:39
CGreenTX wrote:
[client 10.227.1.1] PHP Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 4800 bytes) in /usr/local/www/greenfam/gallery2/modules/gd/classes/GdFunctionality.class on line 268, referer: http://ftp.greenfam.org/gallery2/main.php?g2_view=core:ItemAdmin&g2_subView=core:ItemAdd&g2_itemId=353&g2_return=http%3A%2F%2Fftp.greenfam.org%2Fgallery2%2Fmain.php%2Fv%2FClubGP_Car%2F2003-09-26-Fall_Family_Event_2003%2F%3Fg2_itemId%3D353%26amp%3Bg2_view%3Dcore%3AShowItem&g2_returnName=album&g2_navId=
[Sat Jan 15 18:02:31 2005] [error] [client 10.227.1.1] File does not exist: /usr/local/www/greenfam/favicon.ico

This is FAQ Gallery:c.16. GD does image manipulation in memory inside PHP so it's bound by PHP's limits. If you can't raise your memory limit, you may want to downprioritize GD or disable it and use the other toolkits.

 
CGreenTX

Joined: 2004-12-20
Posts: 51
Posted: Tue, 2005-01-18 13:56

What about ImageMagick? It appears that I can upload a batch of images in the vicinity of 40-50 at once. If I do more than that it seems to just hang. At that point I can just hit upload again to continue, but since some of my galleries have 500+ images that is a lot. :)

Chris Green

btw - thanks for the help and improving a great product. :)

 
wesmoc
wesmoc's picture

Joined: 2005-01-18
Posts: 6
Posted: Tue, 2005-01-18 19:34
CGreenTX wrote:
[client 10.227.1.1] PHP Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 4800 bytes) in /usr/local/www/greenfam/gallery2/modules/gd/classes/GdFunctionality.class on line 268, referer: http://ftp.greenfam.org/gallery2/main.php?g2_view=core:ItemAdmin&g2_subView=core:ItemAdd&g2_itemId=353&g2_return=http%3A%2F%2Fftp.greenfam.org%2Fgallery2%2Fmain.php%2Fv%2FClubGP_Car%2F2003-09-26-Fall_Family_Event_2003%2F%3Fg2_itemId%3D353%26amp%3Bg2_view%3Dcore%3AShowItem&g2_returnName=album&g2_navId=
[Sat Jan 15 18:02:31 2005] [error] [client 10.227.1.1] File does not exist: /usr/local/www/greenfam/favicon.ico

I had the same problem, and I am running PHP 4.3.10. I updated the .htaccess file to up the memory limit from 16MB to 32MB, and everything worked fine after that.

 
fryfrog

Joined: 2002-10-30
Posts: 3236
Posted: Wed, 2005-01-19 04:02

I have my memory limit set somewhere in the neighborhood of 128M - 256M, give something like that a try unless you are very memory constrained. I've got 1024M on a low traffic server though.

 
CGreenTX

Joined: 2004-12-20
Posts: 51
Posted: Wed, 2005-01-19 13:26

As a test I bumped up the memory limit to 256M in php.ini. That seemed to fix it as I imported over 400 pictures in a single shot. What is necessary to set that in .htaccess? I would like to keep the rest of the sites on my server limited to 8/16M and just bump up my gallery web. I'll also see about bumping it up from 512MB to 1GB.

Chris Green

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Wed, 2005-01-19 18:04

I don't think you can set that in .htaccess because it affects the whole PHP VM. But I could be mistaken. Try doing:

php_value memory_limit 256M

in your .htaccess then look at your phpinfo to see if it takes effect.

You should not have to do this if you're not using the GD graphics module!

 
CGreenTX

Joined: 2004-12-20
Posts: 51
Posted: Wed, 2005-01-19 22:02
bharat wrote:
I don't think you can set that in .htaccess because it affects the whole PHP VM. But I could be mistaken. Try doing:

php_value memory_limit 256M

in your .htaccess then look at your phpinfo to see if it takes effect.

You should not have to do this if you're not using the GD graphics module!

Upping the memory limit seemed to fix my hangups while uploading large numbers of images with ImageMagick. Is that a coincidence? Is this a different problem?

Chris

 
CGreenTX

Joined: 2004-12-20
Posts: 51
Posted: Wed, 2005-01-19 22:21

Ok.. I take it back. It was a fluke. I am back to hanging up in the 40-50 pictures range in an upload batch. Apparently that did not fix it.

Chris Green

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Wed, 2005-01-19 22:52

When you say "hang" you mean "I get an error". Right? Cause I don't know what would make it hang.

If you've completely disabled the GD module and you're still running out of memory, then that's a little surprising. I can (and often do) easily import many hundreds of photos with a 32M limit on PHP 4.3.10 using ImageMagick without difficulties. This might be a bug in PHP 5.x...

 
CGreenTX

Joined: 2004-12-20
Posts: 51
Posted: Thu, 2005-02-10 02:19

I wanted to bump this back up to the top to ask a question about it. I am using this locally on the same LAN as the gallery. It seems that if I do this across a slow link I do not experience this issue. Is it possible that the gallery/php/etc is just getting overwhelmed by so much data at once? Perhaps it is running into a limit on the number of processes it can spawn?

Chris Green

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Thu, 2005-02-10 18:16

Unless you're doing many simultaneous uploads (ie, in separate browser windows) then the speed of your link should not be an issue. However, if you enable buffered debug mode in config.php then you should see whatever error GD/NetPBM/ImageMagick is having when it tries to render the image...

 
CGreenTX

Joined: 2004-12-20
Posts: 51
Posted: Thu, 2005-02-10 19:07

I'm using Gallery Remote. (I'm uploading over 6000 images so its a bit much to do with web forms). Basically it seems to just stall somewhere aroung 45-60 images. I have to cancel and then start again. I don't find any errors in the logs to work from though.

Chris Green