Ticket #6 (closed defect: wontfix)

Opened 2 years ago

Last modified 2 years ago

Can't get qdb v0.3 plugin to work with my rbot v0.9.10 in Debian.

Reported by: ant Owned by: unfo-
Priority: normal Milestone: 0.9.11
Component: plugins Version: 0.9.10
Severity: normal Keywords:
Cc:

Description

[12:41pm] <Ant> bender qdb 200 12:41PM <Bender> Fail

D, [2008/04/11 12:41:08#25610] DEBUG -- ircsocket.rb:343:in `dumb_gets': RECV: ":Ant!~ant@[deleted my IP address on purpose] PRIVMSG #linux :bender qdb 200" D, [2008/04/11 12:41:09#25610] DEBUG -- ircsocket.rb:368:in `spool': in spooler D, [2008/04/11 12:41:09#25610] DEBUG -- ircsocket.rb:376:in `spool': resetting @burst D, [2008/04/11 12:41:09#25610] DEBUG -- ircsocket.rb:384:in `spool': can send 4 lines, there are 1 to send D, [2008/04/11 12:41:09#25610] DEBUG -- ircsocket.rb:389:in `spool': flood protection: sending message of length 20 D, [2008/04/11 12:41:09#25610] DEBUG -- ircsocket.rb:390:in `spool': (byterate: 400/2, throttle bytes: 21) D, [2008/04/11 12:41:09#25610] DEBUG -- ircsocket.rb:444:in `dumb_puts_critical': SEND: "PRIVMSG #linux :Fail"

 http://bash.org/?200 is valid. I got the plugin from  http://rbot.noway.ratry.ru/plugins/show/7 ... What's wrong? :(

Thank you in advance. :)

Attachments

0001-A-better-rescue-for-failures.patch Download (0.5 KB) - added by unfo- 2 years ago.
A patch file to help with the debug of this problem.

Change History

  Changed 2 years ago by unfo-

it is a plugin to use with qdb.us not bash.org. The difference is in the HTML markup of the different irc quote sites and thus they are not cross-compatible.

  Changed 2 years ago by ant

I tried again with 28937 --  http://qdb.us/28937 (it's valid):

[12:06pm] <WorkerAnt?> bender qdb 28937 12:06PM <Bender> Fail

What's wrong? :(

  Changed 2 years ago by unfo-

  • owner changed from oblomov to unfo-
  • status changed from new to assigned

follow-up: ↓ 5   Changed 2 years ago by unfo-

I have to congratulate myself on writing maybe the least useful debug message ever: Fail.

Secondly: do you have rubygems and the hpricot gem installed?

in reply to: ↑ 4   Changed 2 years ago by ant

Replying to unfo-:

I have to congratulate myself on writing maybe the least useful debug message ever: Fail. Secondly: do you have rubygems and the hpricot gem installed?

Where else can I get the debug log. Here's another one:

D, [2008/04/28 13:05:06#22599] DEBUG -- ircsocket.rb:343:in `dumb_gets': RECV: ":WorkerAnt?!~ant@<my IP address> PRIVMSG Bender :qdb 28937" D, [2008/04/28 13:05:07#22599] DEBUG -- ircsocket.rb:368:in `spool': in spooler D, [2008/04/28 13:05:07#22599] DEBUG -- ircsocket.rb:376:in `spool': resetting @burst D, [2008/04/28 13:05:07#22599] DEBUG -- ircsocket.rb:384:in `spool': can send 4 lines, there are 1 to send D, [2008/04/28 13:05:07#22599] DEBUG -- ircsocket.rb:389:in `spool': flood protection: sending message of length 23 D, [2008/04/28 13:05:07#22599] DEBUG -- ircsocket.rb:390:in `spool': (byterate: 400/2, throttle bytes: 11) D, [2008/04/28 13:05:07#22599] DEBUG -- ircsocket.rb:444:in `dumb_puts_critical': SEND: "PRIVMSG WorkerAnt? :Fail" D, [2008/04/28 13:05:07#22599] DEBUG -- ircsocket.rb:343:in `dumb_gets': RECV: ":irc.zimage.com 301 Bender WorkerAnt? :is away: (woooooooooork) [\002BX\002-MsgLog? On]" D, [2008/04/28 13:05:09#22599] DEBUG -- ircsocket.rb:368:in `spool': in spooler D, [2008/04/28 13:05:09#22599] DEBUG -- ircsocket.rb:384:in `spool': can send 3 lines, there are 1 to send D, [2008/04/28 13:05:09#22599] DEBUG -- ircsocket.rb:389:in `spool': flood protection: sending message of length 10 D, [2008/04/28 13:05:09#22599] DEBUG -- ircsocket.rb:390:in `spool': (byterate: 400/2, throttle bytes: 24) D, [2008/04/28 13:05:09#22599] DEBUG -- ircsocket.rb:444:in `dumb_puts_critical': SEND: "PING :rbot" D, [2008/04/28 13:05:09#22599] DEBUG -- ircsocket.rb:343:in `dumb_gets': RECV: ":irc.zimage.com PONG irc.zimage.com :rbot"

To answer your questions, yes: # apt-get install rubygems Reading package lists... Done Building dependency tree Reading state information... Done rubygems is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

And I think I do have hpricot gem (I think I installed it via a ruby command?): # locate hpricot /usr/lib/ruby/1.8/hpricot /usr/lib/ruby/1.8/hpricot.rb /usr/lib/ruby/1.8/hpricot/blankslate.rb /usr/lib/ruby/1.8/hpricot/builder.rb /usr/lib/ruby/1.8/hpricot/elements.rb /usr/lib/ruby/1.8/hpricot/htmlinfo.rb /usr/lib/ruby/1.8/hpricot/inspect.rb /usr/lib/ruby/1.8/hpricot/modules.rb /usr/lib/ruby/1.8/hpricot/parse.rb /usr/lib/ruby/1.8/hpricot/tag.rb /usr/lib/ruby/1.8/hpricot/tags.rb /usr/lib/ruby/1.8/hpricot/traverse.rb /usr/lib/ruby/1.8/hpricot/xchar.rb /usr/lib/ruby/1.8/i486-linux/hpricot_scan.so /usr/lib/ruby/1.9/hpricot /usr/lib/ruby/1.9/hpricot.rb /usr/lib/ruby/1.9/hpricot/blankslate.rb /usr/lib/ruby/1.9/hpricot/builder.rb /usr/lib/ruby/1.9/hpricot/elements.rb /usr/lib/ruby/1.9/hpricot/htmlinfo.rb /usr/lib/ruby/1.9/hpricot/inspect.rb /usr/lib/ruby/1.9/hpricot/modules.rb /usr/lib/ruby/1.9/hpricot/parse.rb /usr/lib/ruby/1.9/hpricot/tag.rb /usr/lib/ruby/1.9/hpricot/tags.rb /usr/lib/ruby/1.9/hpricot/traverse.rb /usr/lib/ruby/1.9/hpricot/xchar.rb /usr/lib/ruby/1.9/i486-linux/hpricot_scan.so /usr/share/doc/libhpricot-ruby /usr/share/doc/libhpricot-ruby1.8 /usr/share/doc/libhpricot-ruby1.9 /usr/share/doc/libhpricot-ruby/README.gz /usr/share/doc/libhpricot-ruby/changelog.Debian.gz /usr/share/doc/libhpricot-ruby/copyright /usr/share/doc/libhpricot-ruby1.8/README.gz /usr/share/doc/libhpricot-ruby1.8/changelog.Debian.gz /usr/share/doc/libhpricot-ruby1.8/copyright /usr/share/doc/libhpricot-ruby1.9/README.gz /usr/share/doc/libhpricot-ruby1.9/changelog.Debian.gz /usr/share/doc/libhpricot-ruby1.9/copyright /var/lib/dpkg/info/libhpricot-ruby.list /var/lib/dpkg/info/libhpricot-ruby.md5sums /var/lib/dpkg/info/libhpricot-ruby1.8.list /var/lib/dpkg/info/libhpricot-ruby1.8.md5sums /var/lib/dpkg/info/libhpricot-ruby1.9.list /var/lib/dpkg/info/libhpricot-ruby1.9.md5sums

I basically used that Debian instructions to get all the packages.

  Changed 2 years ago by ant

Oh here's another clue if it helps:

# deborphan libhpricot-ruby libhpricot-ruby1.9

Changed 2 years ago by unfo-

A patch file to help with the debug of this problem.

  Changed 2 years ago by unfo-

A simple test to help:

$ irb -rubygems
irb(main):001:0> require 'hpricot'
=> true

If that is not "true" then you don't have the hpricot gem somewhere where Ruby, and thus rbo, can find. If it is true, then please see about the patch I just uploaded to get an idea of which exception we are dealing with and on which line it is raised.

Also, rbot's log might be better pasted via a .txt file upload or  http://pastie.org/ because this comment field does not preserve those line formattings properly and it can get difficult to read.

  Changed 2 years ago by ant

# irb bash: irb: command not found

# locate bin/irb /usr/bin/irb1.8

# /usr/bin/irb1.8 -rubygems irb(main):001:0> require 'hpricot' => true

OK on the paste idea. How do I use your http://ruby-rbot.org/rbot-trac/attachment/ticket/6/0001-A-better-rescue-for-failures.patch file? :)

  Changed 2 years ago by unfo-

I just realized that since you are using 0.9.10 on debian you probably don't have git installed to use with that git-formatted diff.

So here's what you do:

$ cd ~/.rbot/plugins/
$ wget http://ruby-rbot.org/rbot-trac/attachment/ticket/6/0001-A-better-rescue-for-failures.patch?format=raw -O rbot.patch
$ nano rbot.patch

(Or you can download it to that dir via Firefox etc) (Or you can use vim, emacs, GEdit etc)

Then you need to remove the first 11 lines, which are mostly git-specific lines. So you end up with this:

--- a/qdb.rb
+++ b/qdb.rb
@@ -30,7 +30,7 @@ class QdbPlugin < Plugin
       end

     rescue => e
-      m.reply "Fail"
+      m.reply "%s caught (%s)" % [e.class, e.backtrace[0]]
     end
   end

--
1.5.2.1

Then save the file and type in:

$ patch qdb.rb rbot.patch 

And then to make sure it succeeded:

$ fgrep -n backtrace qdb.rb 

which should output:

33:      m.reply "%s caught (%s)" % [e.class, e.backtrace[0]] 

If this did not work, you can manually change that line with your favourite text editor.

And then you just tell your bot to rescan and then try again with qdb 28937 to see what's the problem.

Also I would advise you to move from the 0.9.10 version to the stable and current version, which is hosted in git.

To quote from IRC:

Topic for #rbot: The Ruby IRC Bot | We moved! Our new home is at http://ruby-rbot.org/ | Please don't use 0.9.10, check out the git version at  git://ruby-rbot.org/rbot.git | current version tarball download: http://ruby-rbot.org/gitweb/?p=rbot.git;a=snapshot;h=HEAD

  Changed 2 years ago by ant

Results:  http://pastie.org/188317 OR  http://pastebin.ca/1000946 ... An error showed: [msg(bender)] qdb 28937 02:15PM [Bender(~rbot@[deleted my IP address] ArgumentError? caught

(/usr/share/rbot/plugins/qdb-0.3.rb:26:in `<=')

rbot.log showed similiar results. According to nano, /usr/share/rbot/plugins/qdb-0.3.rb line #26 is: if quote.size <= @bot.configsend.max_lines?

As for git version, how come Debian doesn't use it? I'd like to avoid using other packagers' if possible. Is there a Debian packages of the git version?

  Changed 2 years ago by unfo-

  • status changed from assigned to closed
  • resolution set to wontfix

It would seem that this is a version incompatibility issue: 0.9.10 doesn't have @bot.config["send_max_lines"] and thus it cannot compare against it.

You are free to insert any arbitrary number there to suit your and your irc server's needs. (for example five (5) is a good choice)

if quote.size <= 5

For your other question: no there is not a Debian package of the git version since. And version 0.9.10 is currently unsupported and I have indeed written the plugin for the git version thus I will close this ticket.

  Changed 2 years ago by ant

Thank you, unfo-. I wonder what's the average numbers of lines on qdb. I set the value to 10 and that seems to be fine.

It would be nice if someone can update Debian's package to include Git version. Unless there is an easy way to migrate over to git version and keep it updated easily like with apt-get upgrade command. :)

  Changed 2 years ago by ant

[12:58am] <Ant> bender qdb 4 12:58AM <Bender> ArgumentError? caught (/usr/lib/ruby/1.8/hpricot/parse.rb:29:in `make')

I guess this is another incompatiblity issue. This one was a 404 error on qdb.us.

  Changed 2 years ago by jsn

.deb packages will probably be available when 0.9.11 is released; before that, using git is the only option. it's very easy, though; check out  http://ruby-rbot.org for instructions.

Note: See TracTickets for help on using tickets.