Gossamer Forum
Home : Products : Gossamer Links : Discussions :

SQL error that bugss..

Quote Reply
SQL error that bugss..
Hi

I am getting the following error

A fatal error has occured:
Can't call method "fetchrow_hashref" on an undefined value at Links::Build::build_home line 13.

Please enable debugging in setup for more details.Stack Trace ====================================== Links (13269): Links::environment called at /home/virtual/site1/fst/var/www/cgi-bin/links/admin/Links.pm line 431 with no arguments. Links (13269): Links::fatal called at Links::Build::build_home line 13 with arguments (Can't call method "fetchrow_hashref" on an undefined value at Links::Build::build_home line 13. ). Links (13269): Links::Build::build_home called at /home/virtual/site1/fst/var/www/cgi-bin/links/admin/GT/Plugins.pm line 108 with arguments (HASH(0x836d810)). Links (13269): GT::Plugins::dispatch called at /home/virtual/site1/fst/var/www/cgi-bin/links/admin/Links/Build.pm line 30 with arguments (GT::Plugins, /home/virtual/site1/fst/var/www/cgi-bin/links/admin/Plugins, build_home, *Links::Build::build_home, HASH(0x836d810)). Links (13269): Links::Build::build called at /home/virtual/site1/fst/var/www/cgi-bin/links/admin/Links/User/Page.pm line 77 with arguments (home, HASH(0x836d810)). Links (13269): Links::User::Page::generate_home_page called at /home/virtual/site1/fst/var/www/cgi-bin/links/admin/Links/User/Page.pm line 53 with no arguments. Links (13269): Links::User::Page::handle called at /home/virtual/site1/fst/var/www/cgi-bin/links/admin/GT/Plugins.pm line 103 with no arguments. Links (13269): GT::Plugins::dispatch called at page.cgi line 25 with arguments (GT::Plugins, /home/virtual/site1/fst/var/www/cgi-bin/links/admin/Plugins, handle_page, CODE(0x823530c)). What is odd is if I run an SQL restart command everything will go back to normal.. BUt in about 12 hours it will appear again..Crazy
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] SQL error that bugss.. In reply to
Can you set 'debug' to 2, and then try to recreate this error? There should be a section that specifically deals with the MySQL Command, i.e "SELECT * FROM" ... could you paste that section, so we can see what is actually causing the problem?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] SQL error that bugss.. In reply to
Just had that bugger again

Here is the error with Debug = 2:

A fatal error has occured:
Can't call method "fetchrow_hashref" on an undefined value at Links::Build::build_home line 13.

Please enable debugging in setup for more details.Stack Trace ====================================== Links (5449): Links::environment called at /home/virtual/site1/fst/var/www/cgi-bin/links/admin/Links.pm line 431 with no arguments. Links (5449): Links::fatal called at Links::Build::build_home line 13 with arguments (Can't call method "fetchrow_hashref" on an undefined value at Links::Build::build_home line 13. ). Links (5449): Links::Build::build_home called at /home/virtual/site1/fst/var/www/cgi-bin/links/admin/GT/Plugins.pm line 108 with arguments (HASH(0x836d810)). Links (5449): GT::Plugins::dispatch called at /home/virtual/site1/fst/var/www/cgi-bin/links/admin/Links/Build.pm line 30 with arguments (GT::Plugins, /home/virtual/site1/fst/var/www/cgi-bin/links/admin/Plugins, build_home, *Links::Build::build_home, HASH(0x836d810)). Links (5449): Links::Build::build called at /home/virtual/site1/fst/var/www/cgi-bin/links/admin/Links/User/Page.pm line 77 with arguments (home, HASH(0x836d810)). Links (5449): Links::User::Page::generate_home_page called at /home/virtual/site1/fst/var/www/cgi-bin/links/admin/Links/User/Page.pm line 53 with no arguments. Links (5449): Links::User::Page::handle called at /home/virtual/site1/fst/var/www/cgi-bin/links/admin/GT/Plugins.pm line 103 with no arguments. Links (5449): GT::Plugins::dispatch called at page.cgi line 25 with arguments (GT::Plugins, /home/virtual/site1/fst/var/www/cgi-bin/links/admin/Plugins, handle_page, CODE(0x823530c)). System Information ====================================== Perl Version: 5.006001 Links SQL Version: 2.1.2 DBI.pm Version: 1.21 Persistant Env: mod_perl (0) SpeedyCGI (0) GT::SQL::error = Could not connect to database. Reason: DBI::errstr = Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) @INC = /home/virtual/site1/fst/var/www/cgi-bin/links/admin /usr/lib/perl5/5.6.1/i386-linux /usr/lib/perl5/5.6.1 /usr/lib/perl5/site_perl/5.6.1/i386-linux /usr/lib/perl5/site_perl/5.6.1 /usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.6.1/i386-linux /usr/lib/perl5/vendor_perl/5.6.1 /usr/lib/perl5/vendor_perl . CGI INPUT ====================================== d => 1 ENVIRONMENT
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] SQL error that bugss.. In reply to
I am not sure BUT could it be the following global?
It is the only one with the code $hash in it..

sub {
my ($output,$sth,$hash,$cond);
my $catid = $_[0];
my $limit = $_[1] || 4;
my $search_db = $DB->table(\'Links\',\'CatLinks\');
$search_db->select_options ("ORDER BY rand()", "LIMIT $limit");
my $all_ids = $DB->table(\'Category\')->children($catid);
push @$all_ids, $catid;
$cond = GT::SQL::Condition->new(\'isValidated\',\'=\',\'Yes\', \'CategoryID\', \'IN\', $all_ids);
$sth = $search_db->select ($cond);
while ($hash = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display (\'link_short\', $hash);
}
return $output;
}
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] SQL error that bugss.. In reply to
>>>(\'Links\',\'CatLinks\'); <<<

Are those quotes escaped on the actual global itself? Or did you just grab that from globals.txt?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] SQL error that bugss.. In reply to
That was a Global.txt copy

The real global code is:
sub {
my ($output,$sth,$hash,$cond);
my $catid = $_[0];
my $limit = $_[1] || 4;
my $search_db = $DB->table('Links','CatLinks');
$search_db->select_options ("ORDER BY rand()", "LIMIT $limit");
my $all_ids = $DB->table('Category')->children($catid);
push @$all_ids, $catid;
$cond = GT::SQL::Condition->new('isValidated','=','Yes', 'CategoryID', 'IN', $all_ids);
$sth = $search_db->select ($cond);
while ($hash = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('link_short', $hash);
}
return $output;
}
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] SQL error that bugss.. In reply to
Try adding an

if ($search_db->hits) { }

around that and see if it makes a difference, or change that line to a print statement like

$output .= "Was this the problem area after all??";

And see if the errors go away.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [katabd] SQL error that bugss.. In reply to
In Reply To:
Can't connect to local MySQL server[/quote]

This means you lost your connection to the database for some reason - this is why it can't do the select statement.
Quote Reply
Re: [afinlr] SQL error that bugss.. In reply to
Missed that.

the 'sock' error means you'll have to restart Mysql, see if that works, if not, you'll probably need root access to fix it up.

Search here on "mysql' and 'sock' for some old discussions on what is going on, and how to deal with it -- old stuff, over 2 years, maybe 3 years or more.

There were a variety of answers for different platforms. I know when I got it, on my Solaris server, I had to reinstall mysql, update a few utilities, and reboot the server then restart MySQL. Of course, your milage will vary, and _hopefully_ a MySQL restart is all that is needed.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] SQL error that bugss.. In reply to
Thanks for the input

I have been restaring SQL everytime this happens..
BUT it is happenning again and again..

The admin saying that the MySQL is not the problem but rather something I am running that is causing it to fail..
NO CLUE!
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] SQL error that bugss.. In reply to
Hi

We just figured it out.. I think

A cron job that was set up using the Cron manager plug in was corrupted..
There was a mistype on the url of the job:

editor_update_de
verses editor_update_def

So every night the cron job starting and is unable to find the sub and is overloading the SQL database and crashing it..

I tried to modify the cron using the manager BUT it will not let me modify or delete the job:

A fatal error has occured:
Invalid Request: 'editor_update_de' '' at admin.cgi line 65.

I tried editing the cron.txt file but it is being overwritten everytime back to the old way..
Anyone has any idea on how to manually edit or delete that cron job?
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] SQL error that bugss.. In reply to
Hi. If you are still having this problem tomorrow, please send over LSQL admin panel details, and I'll take a look. I'm just going for the night now, otherwise I would have taken a look :(

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!