(RESOLVED) rewrite fatal error

iRob
iRob's picture

Joined: 2006-02-12
Posts: 48
Posted: Thu, 2007-10-18 04:44

I just upgraded my gallery from 2.1.2 to 2.2.3 and updated my WPG2 to the latest 3.0.2. Validation passes but the WPG2 rewrite section gives me this fatal error:

Fatal G2 error
Here's the error from G2: Error (ERROR_MISSING_OBJECT) : Missing object for 75

    * in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 2075 (gallerycoreapi::error)
    * in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 98 (gallerystorageextras::_identifyentities)
    * in modules/core/classes/GalleryStorage.class at line 298 (gallerystorageextras::loadentities)
    * in modules/core/classes/helpers/GalleryEntityHelper_simple.class at line 71 (mysqlstorage::loadentities)
    * in modules/core/classes/helpers/GalleryEntityHelper_simple.class at line 127 (galleryentityhelper_simple::loadentitiesbyid)
    * in modules/core/classes/GalleryCoreApi.class at line 2298 (galleryentityhelper_simple::loadentitybyexternalid)
    * in modules/core/classes/GalleryEmbed.class at line 215 (gallerycoreapi::loadentitybyexternalid)
    * in /home/electro/public_html/wp-content/plugins/wpg2/wpg2embed.inc at line 102 (galleryembed::checkactiveuser)
    * in /home/electro/public_html/wp-content/plugins/wpg2/wpg2template.inc at line 50
    * in ??? at line 0
    * in /home/electro/public_html/wp-includes/plugin.php at line 160
    * in /home/electro/public_html/wp-includes/template-loader.php at line 3
    * in /home/electro/public_html/wp-blog-header.php at line 21
    * in /home/electro/public_html/index.php at line 4

I found this link on the old embedded forum that is very similar to my current situation. But that was in the WPG2 2.x forum, so I hesitate to start changing embed.php files.

Then there's this thread. It's somewhat similar. I've tried this with rewrites in G2 turned on and off. Neither seem to matter.

My gallery page:

www.electrolund.com/gallery2

My blog:

www.electrolund.com/

Any ideas?

 
iRob
iRob's picture

Joined: 2006-02-12
Posts: 48
Posted: Thu, 2007-10-18 04:55

I downloaded the wpg2test.php file from the old embedded forum. Here's the output I got:

Gallery2 First Pass OK
WP User ->1<- Logged In
WP User ->1<- Is Not Externally Mapped
Error (ERROR_MISSING_OBJECT) : Missing object for 75

    * in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 2075 (gallerycoreapi::error)
    * in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 98 (gallerystorageextras::_identifyentities)
    * in modules/core/classes/GalleryStorage.class at line 298 (gallerystorageextras::loadentities)
    * in modules/core/classes/helpers/GalleryEntityHelper_simple.class at line 71 (mysqlstorage::loadentities)
    * in modules/core/classes/helpers/GalleryEntityHelper_simple.class at line 127 (galleryentityhelper_simple::loadentitiesbyid)
    * in modules/core/classes/GalleryCoreApi.class at line 2298 (galleryentityhelper_simple::loadentitybyexternalid)
    * in modules/core/classes/GalleryEmbed.class at line 215 (gallerycoreapi::loadentitybyexternalid)
    * in /home/electro/public_html/wpg2test.php at line 53 (galleryembed::checkactiveuser) 

Very similar output.

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Thu, 2007-10-18 10:50

iRob,

You're right, don't replace the 3.0.2 wpg2embed file with the file from that thread. It won't work. Let me look at the changes Ozgreg was making in that thread to try to figure out why you're seeing that error now. I was still in Africa when he was working on that problem, and he's on his honeymoon now. So, I'll have to come up to speed on what the issue was then.

In the meantime, could you try the following:

1. Deactivate and reactivate WPG2 under Plugins Management.

2. Revalidate WPG2 by hitting the WPG2 tab.

3. Go to Users -> Gallery2 Users, and try moving one of the users up and down the G2 permissions table, leaving them where they started in the end. (If you only have one user, would you create a test user and run it up and down.) Let me know if you get any errors during any of this.

4. Retry the Gallery2 Rewrites tab.

I'm hoping that this will reset your WP-G2 user mapping, but I'm kind of easter-egging right now until I have time to really look at the code.

What version of WPG2 are you upgrading from?

Kirk
____________________________________
G2Image Documentation, G2Image Demo Page, My Family Website

 
iRob
iRob's picture

Joined: 2006-02-12
Posts: 48
Posted: Thu, 2007-10-18 15:09

Thanks, Capt. Kirk! You're a great help. The service you do around here is just amazing.

It's good to be back. I've been... "inactive" with G2 and WPG2 for quite some time. Started looking elsewhere for photo integration, but came back when I found that there's just nothing out there that better fits my work flow. Thanks again for this amazing plugin!

Don't know if this is TMI or not, but my upgrade of G2 was not without problems. I installed G2 initially with Fantastico. That was 2.1.x. Fantastico couldn't upgrade it due to all manner of broken paths after a recent server change by my host. So I upgraded it myself. That almost worked, but I had to fix it.

So I'm almost not surprised that that might have caused other issues with WPG2. To answer your other questions, I upgraded from WPG2 2.x. Can't even remember which specific load it was.

I tried your recommendations: deactivated WPG2, reactivated, revalidated, go to G2 users, and I get the same error I got before. See screenshot. Mysterious!

 
iRob
iRob's picture

Joined: 2006-02-12
Posts: 48
Posted: Thu, 2007-10-18 18:26

I just did a search elsewhere in the forums and found these posts:

http://gallery.menalto.com/node/59988 (which lead me to...)
http://gallery.menalto.com/node/32741 (wow, hardcore! I understood the first 1/4 of this, then I started to lose them)

Is it time to rip into the database? Gulp!

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Thu, 2007-10-18 20:31

From the second thread, Valiant had a good point to see if your Gallery is working in standalone. It looks like yours is, although I couldn't log in to see if the site admin user management pages worked correctly. If they do, then I don't think it's a G2 database problem.

I've taken a quick look at the code, and think I understand what it's doing, but I don't understand why the error is occurring. It looks like it should work, because WPG2 is calling G2 to get map a user id that it just checked. If the user exists and is mapped, good; if not, create a new one with that ID. So, I'm stumped right now. I'll keep thinking about it as I have time. I'll probably end up having to put in a lot of debugging echos and have you test using that, if we can't figure out something after a few more rounds of question and answer.

In the meantime, try creating a new G2 user (in G2, not from WP) called wpg2test (or fred, if you like). Then create a new user in WP with the same name. Then try logging in to WP as that user to see if it gives you the same error. (Just trying to characterize when the error is occuring.)

Kirk
____________________________________
G2Image Documentation, G2Image Demo Page, My Family Website

 
iRob
iRob's picture

Joined: 2006-02-12
Posts: 48
Posted: Thu, 2007-10-18 21:56
capt_kirk wrote:
Valiant had a good point to see if your Gallery is working in standalone.

Yes, G2 is working fine standalone, including the user admin.

capt_kirk wrote:
try creating a new G2 user (in G2, not from WP) called wpg2test. Then create a new user in WP with the same name. Then try logging in to WP as that user to see if it gives you the same error.

Good idea, Kirk. I did that and logged in as wpg2test. None of those previous errors in the WPG2 admin pages. In fact, now I can see the mapping between my default WP user and G2, with the option to "revoke G2 admin".

The only thing that didn't pass this time is the rewrite section. The "Can Gallery2 Rewrite Plugin be Activated?" says no. I'm guessing that URL rewrites needs to be activated in G2. I did this and made sure that the admin and download item rewrites were deactivated. Clicked save and got this error:

Error Detail  -
Error (ERROR_MISSING_OBJECT) : Parent 7 path g2-admin

    * in modules/core/classes/helpers/GalleryFileSystemEntityHelper_simple.class at line 98 (gallerycoreapi::error)
    * in modules/core/classes/GalleryCoreApi.class at line 1853 (galleryfilesystementityhelper_simple::fetchchildidbypathcomponent)
    * in modules/core/classes/helpers/GalleryFileSystemEntityHelper_simple.class at line 53 (gallerycoreapi::fetchchildidbypathcomponent)
    * in modules/core/classes/GalleryCoreApi.class at line 1804 (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/pathinfo/PathInfoUrlGenerator.class at line 134 (pathinfourlgenerator::_onload)
    * in init.inc at line 147 (pathinfourlgenerator::initnavigation)
    * in main.php at line 180
    * in main.php at line 94
    * in main.php at line 83

System Information
Gallery version 	2.2.3
PHP version 	4.4.7 apache
Webserver 	Apache/1.3.37 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.4.7 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.28 OpenSSL/0.9.7a
Database 	mysqlt 4.1.22-standard
Toolkits 	Thumbnail, SquareThumb, Gd
Operating system 	Linux jimmy.jimmyshouse.com 2.6.9-55.0.2.EL #1 Tue Jun 12 17:47:10 EDT 2007 i686
Browser 	Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7

Very similar to my original errors. Getting close now, huh?

 
iRob
iRob's picture

Joined: 2006-02-12
Posts: 48
Posted: Thu, 2007-10-18 22:23

Cap'n Kirk, here's an interesting update. Beside rewrites being flaky (I wrote my host admin about that, since it seems to be with Apache), everything else about WPG2 is now working.

Even better, I just logged out of that test account, logged back in to WP as my default admin user. And now I don't get that error in the G2 users list or elsewhere. So I wonder if it's safe to delete that test account? Maybe no just yet?

Kudos on an amazing plugin, this thing has really gotten robust. Nice work. :D

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Thu, 2007-10-18 23:34

Thanks! Glad it's working.

It's probably safe to delete the wpg2test account.

So, that error occurred while logged into G2 in stand alone mode when you hit the "Save" button on the URL Rewrites page, right?

Kirk
____________________________________
G2Image Documentation, G2Image Demo Page, My Family Website

 
iRob
iRob's picture

Joined: 2006-02-12
Posts: 48
Posted: Fri, 2007-10-19 03:54

Kirk, you are correct. I got that above error after clicking save on the stand-alone G2 URL rewrites admin page. It was odd, I'd start all over again, and then everything passed, no error. Then I'd click back in there and the error popped up. It felt intermittent, not consistent.

I just got this word back from my host admin:

Quote:
I'm still not using Apache 2. The version of cPanel that I use isn't quite ready to upgrade to Apache 2 yet. You can always check with the G2 people and find out if there is a difference between the mod_rewrite in Apache 1 vs mod_rewrite in Apache 2.

Know anything about this? I'll hunt around too.

 
iRob
iRob's picture

Joined: 2006-02-12
Posts: 48
Posted: Tue, 2007-10-30 21:39

I found this snippet elsewhere on the forums:

Quote:
I added
<Directory /var/www/gallery2>
AllowOverride FileInfo Options
</Directory>

to apache2.conf and restarted the server. rewrite appears to be working now. Very odd.

I sent that to my host and they told me:

Quote:
The problem is that I’m not running Apache2. You need to find out if what you have installed is compatible with Apache1.

So I guess the question is, is Apache 1 capable of doing mod_rewrite?

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Tue, 2007-10-30 22:50

Short answer is "yes." My old host had Apache 1 and my family site ran fine with rewrites.

The more complicated answer is that Ozgreg and I have only tested the latest WPG2 version on Apache 2. We're both using XAMPP for our development boxes, and all of our personal sites are hosted by DreamHost under our personal accounts. So, there may be some difference that we haven't seen in testing. But there shouldn't be.

Kirk
____________________________________
G2Image Documentation, G2Image Demo Page, My Family Website

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Tue, 2007-10-30 22:58

FYI AllowOverride FileInfo Options is for any version of Apache rewrite.. Looking at your error message "Error (ERROR_MISSING_OBJECT) : Parent 7 path g2-admin" looks to me that you have the site Admin rule turned on, please turn it off..
____________________________________
Wordpress / Gallery2 (WPG2) Plugin, WPG2 Downloads, WPG2 Documentation

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Tue, 2007-10-30 23:02

Ozgreg,

I just re-read iRob's post and he said,

Quote:
The only thing that didn't pass this time is the rewrite section. The "Can Gallery2 Rewrite Plugin be Activated?" says no. I'm guessing that URL rewrites needs to be activated in G2. I did this and made sure that the admin and download item rewrites were deactivated.

It was buried in there, and hard to see when skimming, but he did make sure the admin rule is off.

I'm beginning to think database corruption, maybe? I'll send valiant a PM to ask him to look at this thread to see if we're missing something obvious.

Kirk
____________________________________
G2Image Documentation, G2Image Demo Page, My Family Website

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2007-10-30 23:29

capt_kirk asked me to look at this issue.

this thread is already pretty long and you've talked about several issues. the latest seems to be about rewrite not working.
i suggest you start a new thread about that issue. a thread about X different issues is very hard to follow and doesn't help future users who find the thread through search engines either.

the missing object with parent item X is probably from the ShowItem rule. the core.ShowItem rewrite rule is given a a path (e.g. topalbum/someitem) and it then starts in the root album (id = 7) looking for an album with name "topalbum" and then looks in the album "topalbum" for an item with name "someitem".
in this case, the URL probably was something like "wpg2/g2-admin" and the base URL is wpg2. thus it looks for an album of name "g2-admin" in the root album (id=7).
so there's something wrong with your baseURl or WPG2's rewrite stuff.

ok, i ended up replying here. but again, i'm not a fan of such long and convoluted threads. :)

--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage

 
iRob
iRob's picture

Joined: 2006-02-12
Posts: 48
Posted: Wed, 2007-10-31 18:21

Thanks for all the replies, guys. Valiant, sorry that it's all gotten convoluted. ;) That tends to be how my problems progress. :o

So I was looking at the URL rewrite setup in my G2. It's defaulting to these rules:

gallery/add/%itemId%.html
gallery/view/%itemId%.html
gallery/%path%/slideshow.html
gallery/%path%
srss/%itemId%
rss/%name%

All other rules are deactivated. So I don't have "wpg2" as a base URI. Any suggestions on what those URL rewrite paths should be?

 
iRob
iRob's picture

Joined: 2006-02-12
Posts: 48
Posted: Wed, 2007-10-31 18:23

Another consistent observation: when I activate the G2 rewrites, I can click the Test tab and it succeeds. But if I then click any other area of G2 (plugins, themes, whatever), the URL rewrites plugin mysteriously deactivates itself and removes from the sidebar. It's as if it's not "sticking". Very odd.

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Wed, 2007-10-31 18:30

iRob,

Make me an admin account on WP and PM me the username and password so that I can take a look for myself.

Thanks,
Kirk
____________________________________
G2Image Documentation, G2Image Demo Page, My Family Website

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Wed, 2007-10-31 19:25

You were using the PathInfo method of G2 URL Rewrites instead of mod_rewrite. The only way to change that is to completely uninstall and then re-install the URL Rewrite module. I did that and then revalidated WPG2.

It's all working now. http://www.electrolund.com/v/family/ takes you to your family album. The only problem is that the album select block on the family album has direct G2 links instead of embedded links. The album select on the main photos page has the correct embedded links. I tried clearing the template cache, but there was no change.

One thing: with the plugin you're using to make the dashboard tabs into pull down menus, you lose the automatic WPG2 revalidation before going to any sub-tab. What I mean is that you can click on the Gallery2 Rewrites tab without having to go through the WPG2 tab. Hitting the WPG2 tab every time forces revalidation every time, so that you're at a good baseline before going to the other tabs. I'd either drop that plugin, or make sure you hit the WPG2 tab every time before going to any of the other sub tabs...

Kirk
____________________________________
G2Image Documentation, G2Image Demo Page, My Family Website

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Wed, 2007-10-31 21:29

I thought we failed rewrite validation on path info???
____________________________________
Wordpress / Gallery2 (WPG2) Plugin, WPG2 Downloads, WPG2 Documentation

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Wed, 2007-10-31 22:13

Yeah, he was getting a failure on Gallery2 Rewrites tab. It said that he was using PathInfo, so that's how I knew to uninstall and reinstall. Since I was already logged in, it was faster just to do it than to write our directions and go through another round of question/answers...

Kirk
____________________________________
G2Image Documentation, G2Image Demo Page, My Family Website