xkcd-Bucket
xkcd-Bucket copied to clipboard
Crash when "Finding union"
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".
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)
ah thanks, I will disable it for now. Though, band name suggestions are awesome, it's annoying to keep having to restart bucket.pl :/
The issue still exists, I was just providing a work around.
There's an easy way to keep it restarting:
while ( true ) { ./bucket.pl; }
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. :)
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.
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
Great, the patch did wonders :D My bot has been up for a day now, not a single error or crash :D
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.
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", $_);
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?
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
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.
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.
This issue still appears to be present, especially with the band name reply