Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Can't call method "fetchrow_hashref"

Quote Reply
Can't call method "fetchrow_hashref"
HELP! My forums have suddenly stopped working properly. Everything seems OK except when I try to do a forum view like:
http://www.seaturtle.org/...m/gforum.cgi?forum=3

I get this:
Quote:
A fatal error has occurred:

Can't call method "fetchrow_hashref" on an undefined value at /home/seaturtle/cgi-bin/gforum/admin/GForum/Forum.pm line 88.

Please enable debugging in setup for more details.

I have tried to turn on debugging, but then when I try to load the page it just hangs.

Any ideas?

Not sure if these are related, but I just upgraded my server which included moving all of the data files off, installing RH8, and moving all of the datafiles back. Everything seems to be working except for forum view. Is there a module or something that I could have forgotten to install that would cause this?

thanks,
Michael Coyne
seaturtle.org
Quote Reply
Re: [mcoyne] Can't call method "fetchrow_hashref" In reply to
In your admin panel, try running this query (in "Tools->SQL Monitor"):
Code:
ALTER TABLE gforum_Post ADD INDEX p_rfl (post_root_id, forum_id_fk, post_latest_reply)

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [mcoyne] Can't call method "fetchrow_hashref" In reply to
Also try turning on debugging, and look for: "$GT::SQL::error = ......."

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [yogi] Can't call method "fetchrow_hashref" In reply to
ALTER TABLE did the trick. What exactly did I do? And why? Sounds like rebuilding the index for gforum_Post?

Sorry, just like to know as much about what went wrong and why so perhaps I can prevent it in the future.

THANKS!
Michael Coyne
seaturtle.org
Quote Reply
Re: [mcoyne] Can't call method "fetchrow_hashref" In reply to
It's not something that should happen again - basically, there's an index that has, for some reason that elludes me, failed to exist on several systems.

p_rfl is an index on the Post table ("p") on the columns post_root_id, forum_id_fk, post_latest_reply - it's used to sort the threads on the forum view page - they all have root id 0, since they are the root (non root posts have a root id that contains the post_id of the root post), forum_id_fk contains the forum_id, obviously, and post_latest_reply contains the latest reply of a post decendent (for a root post, the latest reply in the thread - but this information is known for every post in the post tree). As an optimization, we force MySQL to use that index, instead of what its optimizer thinks is right (because in this case, the optimizer usually gets it wrong). The problem is that explicitely specifying an index requires it to be there - and some installations for some reason don't have the index Pirate.

That query adds the index.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Jagerman] Can't call method "fetchrow_hashref" In reply to
Thanks for the explanation Jason. I see how the index is used now, but the one thing that doesn't make sense is that my forum was working, then stopped. Which means that the index must have existed previously, no? If it "went away" then maybe it could happen again?

Thoughts, or am I on the wrong track?
Michael Coyne
seaturtle.org