Internal Server Error on Upload

Captenaj

Joined: 2006-03-27
Posts: 43
Posted: Wed, 2014-04-09 15:19

Hello all,
I just did a new install of Gallery 2 on a subdomain. When I try to upload photos from a local server I get the following error:

Quote:
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

But if I go and look at the new album most, but not all of the photos are there. Some of the photos that are there have a broken thumbnail but I can click through to the picture. I have tried searching the forum and the wiki but I can't find my specific problem. I have seen that the size of the image may be an issue but images of 4.9MB are loading OK while some of those only 4.1MB are not.

When I look in the error log I see that there are "Image Errors" that say "Unable to build image" and there are "Gallery Errors" that give a path to my database followed by "/locks/397" or another number.

Any help would be appreciated. Thanks.

Gallery URL = http://www.carefree.elliottsnest.net/main.php
Gallery version = 2.3.2 core 1.3.0.2
API = Core 7.54, Module 3.9, Theme 2.6, Embed 1.5
PHP version = 5.3.27 cgi-fcgi
Webserver = Apache
Database = mysqli 5.1.56-log, lock.system=flock
Toolkits = ArchiveUpload, Exif, Ffmpeg, ImageMagick, NetPBM
Acceleration = none, none
Operating system = Linux elli 2.6.32.45-grsec-2.2.2-r3 #8 SMP Mon Oct 10 13:33:17 PDT 2011 x86_64
Default theme = matrix
gettext = enabled
Locale = en_US
Browser = Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Firefox/24.0
Rows in GalleryAccessMap table = 12
Rows in GalleryAccessSubscriberMap table = 54
Rows in GalleryUser table = 2
Rows in GalleryItem table = 54
Rows in GalleryAlbumItem table = 4
Rows in GalleryCacheMap table = 0

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Wed, 2014-04-09 19:28

Try setting the lock type to database in gallery admin -> general -> locking system

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
Captenaj

Joined: 2006-03-27
Posts: 43
Posted: Thu, 2014-04-10 02:05

Thanks for the response. After I changed the lock type to database, I deleted the album where I was having the problems. I got the following error:

Quote:
Error Detail -
Error (ERROR_LOCK_TIMEOUT)

in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 716 (GalleryCoreApi::error)
in modules/core/classes/GalleryStorage.class at line 397 (GalleryStorageExtras::acquireWriteLock)
in modules/core/classes/DatabaseLockSystem.class at line 42 (GalleryStorage::acquireWriteLock)
in modules/core/classes/GalleryLockSystem.class at line 147 (DatabaseLockSystem::_acquireLock)
in modules/core/classes/helpers/GalleryLockHelper_simple.class at line 176 (GalleryLockSystem::acquireWriteLock)
in modules/core/classes/GalleryCoreApi.class at line 2291 (GalleryLockHelper_simple::acquireWriteLock)
in modules/core/classes/helpers/GalleryEntityHelper_medium.class at line 42 (GalleryCoreApi::acquireWriteLock)
in modules/core/classes/GalleryCoreApi.class at line 2377 (GalleryEntityHelper_medium::deleteEntityById)
in modules/core/ItemDeleteSingle.inc at line 69 (GalleryCoreApi::deleteEntityById)
in main.php at line 250 (ItemDeleteSingleController::handleRequest)
in main.php at line 104
in main.php at line 88

System Information
Gallery version 2.3.2
PHP version 5.3.27 cgi-fcgi
Webserver Apache
Database mysqli 5.1.56-log
Toolkits ImageMagick, NetPBM
Operating system Linux elli 2.6.32.45-grsec-2.2.2-r3 #8 SMP Mon Oct 10 13:33:17 PDT 2011 x86_64
Browser Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Firefox/24.0

But the album was gone. So I recreated the album and tried to add the photos back. I got the same error I got the first time I tried to upload pictures and again, only 50 of the pictures uploaded, some did not have thumbnails created. And now when I go into the event log I am getting some ERROR_LOCK_TIMEOUT errors.

Thanks for your help. This is the first album I am trying to upload to this Gallery.

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Thu, 2014-04-10 10:57

Lock timeout errors are linked to one or another of the server's mysql settings.

These cannot be changed or set by a php application such as G2.

If you have the required level of access, you can change the innodb_lock_wait_timeout setting.

See http://dev.mysql.com/doc/refman/5.5/en/innodb-parameters.html#sysvar_innodb_lock_wait_timeout

Otherwise, you will need to ask your host. I doubt the typical mass shared host will change such but I suppose you just have to try if you are with one of such.

--
dakanji.com

 
Captenaj

Joined: 2006-03-27
Posts: 43
Posted: Thu, 2014-04-10 12:34

Thanks Dayo. I don't know if I have the required level of access but I couldn't understand what was needed anyway. I was trying to add photos while I was on my VPN and when I turned that off, Gallery was able to grab the pictures from the local server. It uploaded all the photos but did not create the thumbs for some. When I rebuilt the thumbnails for the album I got the same Internal Server Error. And this is with the VPN off. I'm not sure what is going on but it is happening no matter where I am connecting to the internet (home vs work). My host is DreamHost which offers Gallery as one of their simple installs so I can't imagine it's a problem on their end. Or is it?

Thanks for the help.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Thu, 2014-04-10 12:40
Quote:
My host is DreamHost which offers Gallery as one of their simple installs so I can't imagine it's a problem on their end. Or is it?

Although I have been known to recommend DH - their basic account only supplies the bare minimum resources to run a site.
If you did not pay for extra memory, you will likely run into issues running any decent php application like gallery of wordpress.

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
Captenaj

Joined: 2006-03-27
Posts: 43
Posted: Fri, 2014-04-11 02:14

Thanks suprsidr. I have unlimited bandwidth and unlimited storage so I'm not sure what else I can purchase.

I am running PHP 5.3.27 but I have the option to upgrade to 5.4.x CGI or 5.4.x fastCGI. Would that help? Would it hurt? Should I pick the CGI or the fastCGI option? Thanks to all for taking the time to help with a very annoying problem.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Fri, 2014-04-11 02:21
Quote:
I'm not sure what else I can purchase

More RAM

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Sat, 2014-04-12 05:08

The best thing you can do is to stop uploading huge images.

There is no scenario where it makes sense for either you as site owner or for visitors to your site.

Forcing visitors to endure a 5mb download per page is terrible practice.

Resize your images on your local machine before uploading. They should generally be no more than 250kb each.

You probably have a thousand times more RAM available on a basic laptop to do the resizing than on a typical shared web hosting account.

--
dakanji.com

 
Captenaj

Joined: 2006-03-27
Posts: 43
Posted: Sat, 2014-04-12 12:39

Thanks Dayo. I'm using this as backup for my photos so I really don't want to down size them. So it's the RAM on the hosting end? Maybe I'll reach out to DreamHost and see if they have any suggestions.

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Sun, 2014-04-13 03:00

A shared hosting account and a php app like G2 are poor choices for a image backup setup.

Good luck though.
--
dakanji.com

 
Captenaj

Joined: 2006-03-27
Posts: 43
Posted: Wed, 2014-04-16 20:58

Thanks for the comment Dayo. Why is it a poor choice for a backup? I don't know much about it so I really like your opinion. It seems like a great option for me because: a) I have unlimited disk space and band width with DreamHost; b) I have already (mostly) figured out how to use Gallery; c) DreamHost's computers are a lot more reliable than mine or my back up hard drive.

What would people recommend for a really inexpensive, off site storage solution? I am also using Flickr but I can't back up movies there.

Thanks.

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Thu, 2014-04-17 06:28
Captenaj wrote:
What would people recommend for a really inexpensive, off site storage solution?

I'll go for a portable hard drive in your office desk drawer.

Hard to beat on cost and reliability.
--
dakanji.com