Gallery hosted on dreamhost having image / album linking weirdness

wumgod

Joined: 2014-02-01
Posts: 5
Posted: Mon, 2014-02-03 18:42

Host details / error message below the description.

Hi all. I have Gallery 2.3.2 running on a dreamhost server. I hadn't touched the install (or the site really) in over 6 months, however I had a friend report to me that the photo (Gallery) section of my website isn't working right, so i went and checked.

The basic description of the problem I am seeing is that links to albums / images will sometimes work and other times redirect to other seemingly random places on the site. Often the URL will look right but the data being displayed on the page will not match what the URL shows. I'm guessing the issue might be related to recently updated component on the host that Gallery relies on... I attempted to use dreamhost's automated gallery upgrade tool, which worked fine but didn't make the problem go away like i was hoping it might. I have disabled themes and forced a new one through the entire site to see if that could be the issue. I have also, for better or worse, attempted to run some of the maintenance links in the site admin page (like dB optimize etc.).

Some details on my host and error:

Gallery / Host information:

Gallery URL = http://www.stuffz.net/photos/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 = mysql 5.1.56-log, lock.system=flock
Toolkits = ArchiveUpload, Exif, NetPBM, ImageMagick
Acceleration = full/21600, partial/3600
Operating system = Linux mimir 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_1) AppleWebKit/537.73.11 (KHTML, like Gecko) Version/7.0.1 Safari/537.73.11
Rows in GalleryAccessMap table = 2838
Rows in GalleryAccessSubscriberMap table = 18876
Rows in GalleryUser table = 15
Rows in GalleryItem table = 18868
Rows in GalleryAlbumItem table = 403
Rows in GalleryCacheMap table = 10

Sample Error Message (from the event log section of the site admin page)


Event Details
Date Sat 01 Feb 2014 03:03:14 PM PST
Type Gallery Error
Location http://www.stuffz.net/photos/main.php?g2_path=pix-de-Seth/weddings/patelwedding/v/friends/
User Id 29
Client 69.255.22.79
Summary Parent 48154 path v
Referer
Details
Error (ERROR_MISSING_OBJECT) : Parent 48154 path v in modules/core/classes/helpers/GalleryFileSystemEntityHelper_simple.class at line 98 (GalleryCoreApi::error)
in modules/core/classes/GalleryCoreApi.class at line 1952 (GalleryFileSystemEntityHelper_simple::fetchChildIdByPathComponent)
in modules/core/classes/helpers/GalleryFileSystemEntityHelper_simple.class at line 53 (GalleryCoreApi::fetchChildIdByPathComponent)
in modules/core/classes/GalleryCoreApi.class at line 1901 (GalleryFileSystemEntityHelper_simple::fetchItemIdByPath)
in modules/rewrite/classes/RewriteSimpleHelper.class at line 45 (GalleryCoreApi::fetchItemIdByPath)
in ??? at line 0 (RewriteSimpleHelper::loadItemIdFromPath)
in modules/rewrite/classes/RewriteUrlGenerator.class at line 103
in modules/rewrite/classes/parsers/modrewrite/ModRewriteUrlGenerator.class at line 56 (RewriteUrlGenerator::_onLoad)
in init.inc at line 186 (ModRewriteUrlGenerator::initNavigation)
in main.php at line 197
in main.php at line 104
in main.php at line 88

Request variables: Array
(
[path] => pix-de-Seth/weddings/patelwedding/v/friends/
)

i have also recently enabled the debug to login function in the config.php in case that might give some helpful output. There's a lot of data there and a recent grep of "error" didn't return anything, except the following:
grep -i error gallery_error.log
[Errors] => 0
[Errors] => 0
[Errors] => 0

Please let me know if anything else would be helpful in the diagnosis. I have tried the search function on the forums but nothing seemed to really match what I am seeing...

-Seth

 
wumgod

Joined: 2014-02-01
Posts: 5
Posted: Wed, 2014-02-05 19:06

Just to add, I think i might try to upgrade to G3. Has anyone had this issue or think this will fix the problem? I am not looking to make it worse (of course!).

-Seth

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Wed, 2014-02-05 21:21

The issue looks to be rewrite failing from time to time.
dreamhost on the basic package barely has enough memory to sustain any php application.

I would:

  • Clear caches
  • setup acceleration under admin -> performance
  • try to squeeze some more memory from dreamhost by adding @ini_set('memory_limit', '64M'); to config.php

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
wumgod

Joined: 2014-02-01
Posts: 5
Posted: Fri, 2014-02-07 03:29

Thanks for the suggestions suprsidr. I attempted to clear the caches, optimize the database, up the performance to full acceleration 1 hours registered user and 1 day guests. I also upped the memory to 64MB. The problem continued to occur so I disabled rewrite, which was apparently stupid because now I can't get to the admin / site admin tool because the URLs are throwing 404s and all sorts of odd things.

The most frustrating part is that Dreamhost says they "can't help me" and I have no idea what they upgraded / changed that would have started this issue.

I'm out of ideas and scared to break it more. i have tried in a couple different browsers, but it's obviously not the clients since the problem persists.

I tried to go back to the main page and now i get the following error (popup):

Smarty Debug Console
included templates & config files (load time in seconds)
themes/classic/templates/error.tpl (0.00393) (total)
modules/core/templates/ErrorPage.tpl (0.00211)

assigned template variables
{$ErrorPage} Array (12)
isAdmin => true
stackTrace => "Error (ERROR_STORAGE_FAILURE)<ul><li..."
code => Array (1)
storageFailure => true
phpversion => "5.3.27"
php_uname => "Linux mimir 2.6.32.45-grsec-2.2.2-r3 ..."
php_sapi_name => "cgi-fcgi"
webserver => "Apache"
browser => "Mozilla/5.0 (Macintosh; Intel Mac OS ..."
dbType => "mysql"
dbVersion => "5.1.56-log"
toolkits => "ImageMagick, NetPBM"
version => "2.3.2"
{$SCRIPT_NAME} "/photos/main.php"
{$head} Array (5)
tpl => Array (0)
style => Array (0)
javascript => Array (1)
lib/javascript/BlockToggle.js => true
meta => Array (0)
link => Array (0)
{$l10Domain} "themes_classic"
{$theme} Array (2)
pageType => "error"
errorTemplate => "modules/core/templates/ErrorPage.tpl"
assigned config file variables (outer template scope)
{#files#} Array (0)
{#vars#}

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Fri, 2014-02-07 03:39

Make sure you rename yoursite.com/.htaccess to something like .htaccess_old
your admin url should be yoursite.com/main.php?g2_view=core.SiteAdmin

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
wumgod

Joined: 2014-02-01
Posts: 5
Posted: Sat, 2014-02-08 00:07

The only .htaccess file i had was empty. The problem is still persisting.

If youd like to see for yourself;

stuffz dot net is the domain and forwardslash photos is the gallery dir.

I do have a lot of photos (17k), wonder if that could be causing this...

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sat, 2014-02-08 01:20

so your /photos/.htaccess is empty?
this would be your issue. Gallery thinks that rewrite is still active but the rewrite rules are not present in .htaccess

execute this query on your G2 database: UPDATE g2_PluginMap SET g_active=0 WHERE g_pluginId='rewrite';

Then you will want to go back to gallery admin -> rewite and re-setup your rewrite rules.
And make sure you do not include the admin rewrite rules this time.

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
wumgod

Joined: 2014-02-01
Posts: 5
Posted: Mon, 2014-02-10 20:54

I ran the query and re-setup the rewrite plugin. Things seem to be significantly working better, but still not 100% right. At some points things don't redirect proper, where the URL will show something but the page being displayed is something different. Sometimes the link to the site admin area just reloads the current page.

Does Gallery only use .htaccess under the /photos directory? I've noticed I have .htaccess in a few places under that tree, too. Should I remove them and run that query again or something?

Also, I just got the linked image "smarty debug console" error while randomly browsing the site:

http://www.stuffz.net/photos/v/pix-de-Seth/smarty_debug.tiff.html

hopefully it displays right! :)

-Seth

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Tue, 2014-02-11 17:09

Gallery only creates 2 htaccess. one in gallery root, and one in your g2data

-s
________________________________
All New jQuery Minislideshow for G2/G3