xkcd-Bucket icon indicating copy to clipboard operation
xkcd-Bucket copied to clipboard

Crash when "Finding union"

Open Ante0 opened this issue 13 years ago • 14 comments

Sat Apr 9 14:38:32 2011 - Creating band name database/query handles Sat Apr 9 14:38:32 2011 - Executing band name word count (since its items) Sat Apr 9 14:38:32 2011 - Finding union Use of uninitialized value in numeric eq (==) at ./bucket.pl line 3514. Use of uninitialized value in numeric eq (==) at ./bucket.pl line 3514. Use of uninitialized value in numeric lt (<) at ./bucket.pl line 3518. Use of uninitialized value in numeric lt (<) at ./bucket.pl line 3518. Can't call method "fetchrow_hashref" on an undefined value at ./bucket.pl line 3522.

what could be causing this? I'm not very good with perl...

I wrote in irc "since it's items". That seemed to have triggered this, and made it crash. I did not write "Bucket: since it's items".

Ante0 avatar Apr 09 '11 12:04 Ante0

Its the bandname system. The database handles time out if they are not used. I've had to disable (set band_name 0) on my system as we don't have enough traffic to keep it from crashing.

According to http://search.cpan.org/~capttofu/DBD-mysql-4.018/lib/DBD/mysql.pm there is a reconnect functionality, but I haven't enabled it to see if it works.

As a temporary solution (if you don't want to disable it), http://dev.mysql.com/doc/refman/5.0/en/gone-away.html leads you to http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_wait_timeout to show you how to increase your wait timeout to something crazy (but that can have downsides)

halkeye avatar Apr 09 '11 20:04 halkeye

ah thanks, I will disable it for now. Though, band name suggestions are awesome, it's annoying to keep having to restart bucket.pl :/

Ante0 avatar Apr 10 '11 18:04 Ante0

The issue still exists, I was just providing a work around.

There's an easy way to keep it restarting:

while ( true ) { ./bucket.pl; }

halkeye avatar Apr 10 '11 19:04 halkeye

Indeed it does. However, the workaround seemed to work for a while. Yet it still wants to select a band_name for some reason, even after I set band_name 0 However, it doesn't crash like it did. Now it just drops, ping time out. So something is making it... I will look into this more. :)

Ante0 avatar Apr 15 '11 14:04 Ante0

My theory on the issue is the fact that loadlog.pl fails to properly work to fill the database which the band name feature uses. It fails with the empty database.

archangelic avatar Jun 25 '11 06:06 archangelic

Sorry, now that I looked into it again, both problems can occur. Error happens when none of the words looked up are in words2id/words2line

I have a patch

halkeye avatar Jun 25 '11 07:06 halkeye

Great, the patch did wonders :D My bot has been up for a day now, not a single error or crash :D

Ante0 avatar Jul 14 '11 07:07 Ante0

One of the users on my channel wanted me to look into band names again after months of having them disabled because of this crash. I see that loadlog.pl is supposed to be stuffing data into these word2id and word2line tables, which it gets from the mainlog table... But what puts stuff into the mainlog table?

I've spent the last few hours poking at this, and I honestly have no idea how this band name thing is supposed to work anymore. Is there something silly I'm missing here, or is some other 'bot supposed to fill in mainlog, or what?

Also, if this is the wrong place to be asking any of this, sorry, but there's no other forum-like-thing that I can find.

izzy84075 avatar Sep 09 '11 02:09 izzy84075

loadlog inserts into mainlog as well

my $add = $db->prepare("insert into mainlog (stamp, msg) values (?, ?)") or die "Can't prepare add: $!"; .... $add->execute("$date $time", $_);

halkeye avatar Sep 09 '11 03:09 halkeye

So where is it getting stuff to put into mainlog? It doesn't appear to take the logfile from Bucket as an argument, and I don't see any filesystem or IRC things happening... Is Bucket itself supposed to be running this script somewhere/somehow?

izzy84075 avatar Sep 09 '11 03:09 izzy84075

I thought for sure there was a commit message or something somewhere.

Essentially you need a log file in the format mentioned at the end of the file.

then its simply: ./loadlog.pl < logfile

halkeye avatar Sep 09 '11 03:09 halkeye

izzy@Veda2:/home/www/irc.meldaire.net/genuflect$ /home/izzy/xkcd-Bucket/loadlog.pl < genuflect.20110908.txt Use of uninitialized value $max in concatenation (.) or string at /home/izzy/xkcd-Bucket/loadlog.pl line 27. max timestamp: Use of uninitialized value $stats{"added"} in concatenation (.) or string at /home/izzy/xkcd-Bucket/loadlog.pl line 111, <> >line 1623. Use of uninitialized value in concatenation (.) or string at /home/izzy/xkcd-Bucket/loadlog.pl line 111, <> line 1623. Use of uninitialized value in concatenation (.) or string at /home/izzy/xkcd-Bucket/loadlog.pl line 111, <> line 1623.

lines added, new words, pointers.

loadlog.pl seems to have problems of it's own... And I don't think it's from the slight discrepancies between the format of my logs and the example. Mine have square brackets around the timestamp and lack the space before nicknames that lack any special status.

izzy84075 avatar Sep 09 '11 04:09 izzy84075

You don't think?

s/^(\d\d:\d\d) // or next;

I think the lack of space between the < and the nick is fine.

This should probably be a new bug though.

Try using the data in the file and see if it imports properly.

halkeye avatar Sep 09 '11 04:09 halkeye

This issue still appears to be present, especially with the band name reply

calzoneman avatar Dec 21 '11 02:12 calzoneman