Seemingly random G2 images missing in WP

trbailey
trbailey's picture

Joined: 2007-04-16
Posts: 172
Posted: Thu, 2008-03-06 16:31

I have two WPG2 sites operating on my home server. One is a secure family picture gallery.

First issue is that none of the secure albums show up in the G2 Image insertion tool, mentioned here in case there is a correlation.

Context:

Gallery version = 2.2.4 core 1.2.0.6
PHP version = 5.2.0-8+etch10 apache2handler
Webserver = Apache/2.2.3 (Debian) PHP/5.2.0-8+etch10 mod_ssl/2.2.3 OpenSSL/0.9.8c
Database = mysqli 5.0.32-Debian_7etch5-log, lock.system=flock
Toolkits = ArchiveUpload, Dcraw, Exif, Ffmpeg, Getid3, LinkItemToolkit, NetPBM, Thumbnail, Gd, ImageMagick
Acceleration = none/21600, none/21600
Operating system = Linux trbailey.net 2.6.18-5-amd64 #1 SMP Sat Dec 22 20:43:59 UTC 2007 x86_64
Default theme = siriux
gettext = enabled
Locale = en_US
Browser = Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12
Rows in GalleryAccessMap table = 84
Rows in GalleryAccessSubscriberMap table = 1277
Rows in GalleryUser table = 19
Rows in GalleryItem table = 1254
Rows in GalleryAlbumItem table = 54
Rows in GalleryCacheMap table = 0

I keep the Admin logged in with a cookie most of the time. Recently, I think it was after updating to 2.2.4, I began to notice all gallery images failing to appear. I'm not explicitly sure how to reproduce this error but I've ruled out my customized limau-orange theme as the culprit. It acts the same no matter what theme I use.

Both embedded and regular Gallery pages are unaffected. Gallery permissions have been checked and double checked and seem to be correct. Resetting Gallery cache has no effect. Neither does resetting WPG2 and/or the theme so it must be a gallery permissions issue of some kind, possibly related to the recent WPG2 3.0.2 update and/or the G2Image issue.

I have not tried moving back to an earlier WPG2 plugin.

Sometimes I can logout and log back in and they show up correctly. Other times it makes no difference. I suspect the issue may be somehow related to cookie time because it seems to randomly start to work again after logging in and out a few times. The error seems to effect all users.

I've checked apache and system logs and see nothing out of place.
I've checked and double checked file permissions.

I'm not sure how to go about debugging this issue.

Since there are no state secrets here I've added a test user with family picture access for diagnostic purposes. If you can't see it break, you probably can't do any more than I can.
Link: http://home.trbailey.net/home/
User: testing
Pass: testing

Thank you for any help or testing directions.

Author:Blog|Site
[NOTE]Any undesirable things that show up on my family site will immediately incur a firewall block for the offending IP(s). This is not an invitation to spam my site. This site is in my home and I check it often.

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Thu, 2008-03-06 21:23

I know you are going to hate this post but I do not see any broken pictures.. The place to start is in your error_log, look at any errors you might be getting, it could be any combination of environmental issues causing the images to not load, I am not sure if it is a session issue but lets see what the error_log reveals first..

____________________________________
Wordpress / Gallery2 (WPG2) Plugin, , WPG2 Documentation, WPG2 Demo

 
trbailey
trbailey's picture

Joined: 2007-04-16
Posts: 172
Posted: Thu, 2008-03-06 23:39

Yea, figures.

Could it possibly be related to the g2Image not showing secure gallery branches?
An issue not presently working, but It's not too difficult to work around.

An errant permission somewhere?

I'll keep an eye out and see what I can see, Maybe turning on debug for a while and thrashing it might shake something loose.
Thanks

Author:Blog|Site

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Fri, 2008-03-07 00:49

I am not sure about the permissions behind the g2image insertion, Kirk will be better off helping you with that, it is the random nature of the broken pictures being displayed in the WPG2 page that I want to work on with you..

____________________________________
Wordpress / Gallery2 (WPG2) Plugin, , WPG2 Documentation, WPG2 Demo

 
trbailey
trbailey's picture

Joined: 2007-04-16
Posts: 172
Posted: Fri, 2008-03-07 03:06

It did it again just a sec ago.
I went to the /lib/support console and reset all cache except thumbs and upgrade logs and it seems to have fixed it, at least for now. Hey, that cache reset fixed the G2Image insert too.

Next step is probably to put it in debug mode if it occurs again.

What does the lib/support cache maintenance do that the regular maintenance does not?

-Tom
Author:Blog|Site

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Fri, 2008-03-07 03:39

I think the lib/cache clears all cache's (both template and session cache's). What does your apache error log say??

____________________________________
Wordpress / Gallery2 (WPG2) Plugin, , WPG2 Documentation, WPG2 Demo

 
trbailey
trbailey's picture

Joined: 2007-04-16
Posts: 172
Posted: Fri, 2008-03-07 05:02

Nothing... It's finding everything OK, no 404, 401 etc.

Author:Blog|Site

 
trbailey
trbailey's picture

Joined: 2007-04-16
Posts: 172
Posted: Tue, 2008-03-11 17:38

It happened again after I logged in and out of my second WPG2 installation.

Could this be a php session issue?

Author:Blog|Site

 
trbailey
trbailey's picture

Joined: 2007-04-16
Posts: 172
Posted: Tue, 2008-03-11 18:48

I think I figured it out. I recently began installing a Debian desktop and when I log in to my site fresh there, it works fine for a while. But after a day or two it messed up too.

Given what's been happening I suspect this is a cookie issue. I have gallery cookies set to "forever" in the general config screen.
Is there any known issue with cookies and WPG2?
Didn't you tell me WPG2 uses a cookie separate from Wordpress?
Could there be a cookie validation or mismatch issue here?

:)

Author:Blog|Site

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Tue, 2008-03-11 21:45

G2 uses a session based system, WPG2 3.05 will have some code forcing the setting of sessions and stopping the TMP_PMT ID being set which I seen appended to some G2 installations which may help, not sure if it may help you. To answer your question I never seen this issue before.. I have seen plenty of cookie issues but not this..

I have added some code to g2_init function in wpg2embed.inc to handle this..

Look for..
// Otherwise Guest
$ret = GalleryEmbed::checkActiveUser('');
if ($ret) {
return $ret;
}
}

Add After

// Gallery2 Session Handling - Stop Temp ID's Fix Bug #43
global $gallery;
$g2_session =&$gallery->getSession();
$g2_session->start();
$g2_session->doNotUseTempId();

____________________________________
Wordpress / Gallery2 (WPG2) Plugin, , WPG2 Documentation, WPG2 Demo

 
trbailey
trbailey's picture

Joined: 2007-04-16
Posts: 172
Posted: Wed, 2008-03-12 14:26

So it now looks like this:

Quote:
// Otherwise Guest
$ret = GalleryEmbed::checkActiveUser('');
if ($ret) {
return $ret;
}
}
// Gallery2 Session Handling - Stop Temp ID's Fix Bug #43
global $gallery;
$g2_session =&$gallery->getSession();
$g2_session->start();
$g2_session->doNotUseTempId();

} else {

I re-registered the plugin and it still works so I didn't paste it in the wrong place. And, the image chooser works again so it's got to be a cookie thing. I changed session lifetime to 1 Week and Session Timeout to 1 hour. Probably makes no difference but my family has a difficult time with logging in so if they only have to do it once ever, it's a bonus.

Bonus info:
I was also thinking of another possible cause. I've had issues with eAccelerator cache growing forever so
I have a daily cron that cleans my eAccelerator cache directory. It removes cache entries older than three days.

Quote:
find /var/cache/eaccelerator/ -ctime +3 -daystart -exec rm "{}" \;;/etc/init.d/apache2 force-reload

Any possibility this might be the culprit?
Just for hoots -n- giggles, I had a similar issue (secure images disappearing) when I first moved the site to WPG2. It disappeared for a while then reappeared. It seemed related to the Performance cache setting but returned to normal when I cleared saved pages or turned off the cache. I have plenty of CPU to saturate the tidbit of bandwidth I have so I'll leave it off for now. At least until I can be sure this is resolved.
Thank you again, Tom
Author:Blog|Site

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Wed, 2008-03-12 21:52

Looks about right, hopefully I will get 3.05 out the door after Easter just in time for Wordpress 2.5 release which is the milestone we are pushing towards..

____________________________________
Wordpress / Gallery2 (WPG2) Plugin, , WPG2 Documentation, WPG2 Demo

 
trbailey
trbailey's picture

Joined: 2007-04-16
Posts: 172
Posted: Tue, 2008-03-18 06:58

One more tool in your box...

I think I found another issue you might want to be aware of. I recently installed an eaccelerator object cache for wordpress. I got it here: http://neosmart.net/blog/2007/xcache-and-eaccelerator-wp-plugins-updated/
It seemed to be working ok but lately I installed some new software and I lost file permission on something critical. It corrupted them so bad I ended up reloading the OS on a new drive, reinstalling relevant software and copying the whole site over. Then I noticed I couldn't change my theme in wordpress and in the debugging process I renamed object-cache.php to object-cache.phx and everything started working againg, and it's back to it's instant page load speed.

I don't recall offhand if I have the latest version but Debian etch recently released a new php5 5.2.0-8+etch10 which broke eAccelerator. I found a debian repository (deb http://debian.mcmillan.net.nz/debian etch awm) with a pre-compiled verson (apt-get install php5-eaccelerator) that works fine so I didn't have to recompile it but this may well be the culprit in my -our ongoing mysterious missing pictures issue.

Author:Blog|Site