Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hubot completely quiet #4

Closed
brunobord opened this issue Dec 1, 2011 · 26 comments
Closed

hubot completely quiet #4

brunobord opened this issue Dec 1, 2011 · 26 comments

Comments

@brunobord
Copy link

hi,

I've tried this hubot-irc adapter, and the result is not very encouraging.
the bot connects to my localhost IRCd, joins the correct channel, etc.
unfortunately, it's completely quiet, silent, dumb.
I've tried to talk to it via /query or on the designated channel, and I've got no answer.
it correctly reads lines on the channel, but it doesn't react at all

I've tried to load several scripts using the hubot-scripts.json file, without a result. What am I doing wrong?

@nandub
Copy link
Owner

nandub commented Dec 1, 2011

type hubot help or use whatever name you gave to your bot. It should give you a list of commands you can use.

@brunobord
Copy link
Author

even "help" is silent...

@sylvanaar
Copy link

It is easy to install it incorrectly and achieve this result. How did you install it? and how are you running it..

did you use hubot -c to make a deployable version?

@xcolour
Copy link
Contributor

xcolour commented Dec 2, 2011

I'm having the same issue running hubot locally.

My Procfile looks like:

web: bin/hubot -a irc -n hubot

(I'm not sure if that's superfluous since I'm just running it locally.)

I'm running hubot like:

$ bin/hubot -a irc -n hubot

And I have exported these environment variables:

HUBOT_IRC_NICK=mechadog
HUBOT_IRC_ROOMS=#some_test_room
HUBOT_IRC_SERVER=irc.freenode.net
HUBOT_IRC_DEBUG=True

Hubot connects and joins the room, and I see every message echoed in the console, but it never responds. I've tried:

hubot help
mechadog help
hubot mechadog help
mechadog hubot help

@sylvanaar
Copy link

Well. my take on it is that it has something to do with hubot executing from a location where the path it constructs to the scripts folders are not valid. I am just guessing - it seems like the most obvious suspect

@brunobord
Copy link
Author

I might have done something wrong with the install... Maybe that's a good occasion to amend the README file and help poor users like me to set everything up the right way.

I'm using Ubuntu 10.04 (and yes, I need an upgrade)
I've managed to install npm and nodejs using a Launchpad PPA.

nodejs : v.0.6.2
npm : v1.0.106

As a plus, I've set up an IRCd on my box, thus I can log on my localhost IRC
server. It works, my irssi client can reach it.

When I want to install hubot-irc:

cd Projets/Hubot
npm install hubot

It creates a node_modules directory. Then:

cd node_modules/hubot/
bin/hubot
[Fri, 02 Dec 2011 20:39:17 GMT] INFO Loading adapter shell
[Fri, 02 Dec 2011 20:39:17 GMT] INFO Loading scripts from /home/bruno/Projets/Hubot/node_modules/hubot/scripts
[Fri, 02 Dec 2011 20:39:17 GMT] INFO Loading scripts from /home/bruno/Projets/Hubot/node_modules/hubot/src/scripts
Hubot> 

So it leads me to a shell. Unfortunately, this shell is very silent.

Hubot> help
... nothing
Hubot> ping
... nothing, again.

etc, etc, etc.

now if I want to add the IRC adapter, I'm adding the follwing line to the
package.json file, in the "dependencies" section:

"hubot-irc": "0.0.4",

after that:

npm install

it installs the hubot-irc adapter. Then:

export HUBOT_IRC_NICK="brunobordbot"
export HUBOT_IRC_PORT="6667"
export HUBOT_IRC_ROOMS="#cdc"
export HUBOT_IRC_SERVER="localhost"
export HUBOT_IRC_PASSWORD="meuh"
export HUBOT_IRC_DEBUG=On
bin/hubot -a irc

Here is the traceback:

[Fri, 02 Dec 2011 20:52:28 GMT] INFO Loading adapter irc
[Fri, 02 Dec 2011 20:52:28 GMT] INFO Loading scripts from /home/bruno/Projets/Hubot/node_modules/hubot/scripts
[Fri, 02 Dec 2011 20:52:28 GMT] INFO Loading scripts from /home/bruno/Projets/Hubot/node_modules/hubot/src/scripts
2 Dec 21:52:28 - SEND: PASS :meuh
2 Dec 21:52:28 - SEND: NICK :brunobordbot
2 Dec 21:52:28 - SEND: USER nodebot 8 * :nodeJS IRC client
2 Dec 21:52:28 - Unhandled message: { prefix: 'irc.localhost',
  server: 'irc.localhost',
  command: '020',
  rawCommand: '020',
  commandType: 'normal',
  args: [ '*', 'Please wait while we process your connection.' ] }
2 Dec 21:52:57 - Unhandled message: { prefix: 'irc.localhost',
  server: 'irc.localhost',
  command: '042',
  rawCommand: '042',
  commandType: 'normal',
  args: [ 'brunobordbot', '000AAAAAC', 'your unique ID' ] }
2 Dec 21:52:57 - SEND: JOIN :#cdc
2 Dec 21:52:57 - MODE:brunobordbot sets mode: +i
brunobordbot has joined #cdc
2 Dec 21:52:57 - SEND: MODE :#cdc

Then I'm joining the #cdc chan, where this bot is sitting. And I'm trying
to make it say something, via the channel or a /query, and the result is still
the same: nada, nothing, zero, no response, RIEN.

Sample

From No` to #cdc: brunobordbot help
#cdc <No`> brunobordbot help
From No` to #cdc: brunobordbot: help
#cdc <No`> brunobordbot: help
From No` to brunobordbot: help
msg <No`> help
Got private message from No`: help
2 Dec 22:03:22 - GOT MESSAGE from No`: help

It looks like this bot is trying to load scripts in the two follwing directories:

  • /home/bruno/Projets/Hubot/node_modules/hubot/scripts
  • /home/bruno/Projets/Hubot/node_modules/hubot/src/scripts

the first one doesn't exist.
the latter has 11 coffee files, including the famous-marvelous "help.coffee". Yes, the one that doesn't work.

I've tried to create the 1st directory and copy-paste the coffee scripts. Still the same "sound of silence"

@xcolour
Copy link
Contributor

xcolour commented Dec 2, 2011

I get the exact same behavior when deployed on Heroku.

EDIT:

My logs:

2011-12-02T21:24:56+00:00 heroku[api]: Scale to app=1 by matthew.j.singleton@gmail.com
2011-12-02T21:25:08+00:00 heroku[app.1]: Starting process with command `bin/hubot -a irc -n preston`
2011-12-02T21:25:09+00:00 app[app.1]: bin/hubot: 3: npm: not found
2011-12-02T21:25:09+00:00 app[app.1]: [Fri, 02 Dec 2011 21:25:09 GMT] INFO Loading scripts from /app/scripts
2011-12-02T21:25:09+00:00 app[app.1]: [Fri, 02 Dec 2011 21:25:09 GMT] INFO Loading scripts from /app/src/scripts
2011-12-02T21:25:10+00:00 app[app.1]: [Fri, 02 Dec 2011 21:25:10 GMT] INFO Loading hubot-scripts from /app/node_modules/hubot-scripts/src/scripts
2011-12-02T21:25:10+00:00 app[app.1]: Successfully connected to Redis
2011-12-02T21:25:10+00:00 app[app.1]: 2 Dec 21:25:10 - SEND: PASS :--------
2011-12-02T21:25:10+00:00 app[app.1]: 2 Dec 21:25:10 - Sending irc NICK/USER
2011-12-02T21:25:10+00:00 app[app.1]: 2 Dec 21:25:10 - SEND: NICK :preston
2011-12-02T21:25:10+00:00 app[app.1]: 2 Dec 21:25:10 - SEND: USER nodebot 8 * :nodeJS IRC client
2011-12-02T21:25:10+00:00 app[app.1]: 2 Dec 21:25:10 - SEND: JOIN :#Datadog
2011-12-02T21:25:10+00:00 app[app.1]: 2 Dec 21:25:10 - SEND: JOIN :#offtopic
2011-12-02T21:25:10+00:00 app[app.1]: 2 Dec 21:25:10 - GOT NOTICE from "NickServ": "You are now identified for preston."
2011-12-02T21:25:10+00:00 app[app.1]: preston has joined #Datadog
2011-12-02T21:25:10+00:00 app[app.1]: 2 Dec 21:25:10 - SEND: MODE :#Datadog
2011-12-02T21:25:10+00:00 app[app.1]: preston has joined #offtopic
2011-12-02T21:25:10+00:00 app[app.1]: 2 Dec 21:25:10 - SEND: MODE :#offtopic
2011-12-02T21:25:15+00:00 heroku[app.1]: State changed from starting to up
2011-12-02T21:25:27+00:00 app[app.1]: From xcolour to #offtopic: preston help
2011-12-02T21:25:27+00:00 app[app.1]: #offtopic <xcolour> preston help
2011-12-02T21:25:32+00:00 app[app.1]: From xcolour to #offtopic: hubot help
2011-12-02T21:25:32+00:00 app[app.1]: #offtopic <xcolour> hubot help

@xcolour
Copy link
Contributor

xcolour commented Dec 2, 2011

@brunobord Try prefacing your commands with "hubot", so:

Hubot> hubot help

That got things working perfectly for me in the shell, and also in Campfire. Shy dog syndrome seems to be limited to IRC for me.

@brunobord
Copy link
Author

@xcolour. right, it works like that, just like you. Now how can I make it work in IRC?

@nandub
Copy link
Owner

nandub commented Dec 3, 2011

Did you first created a deployable hubot like so?

NOTE: The below instructions assume you have set the environments already..

git clone git://github.com/github/hubot.git
cd hubot
bin/hubot -c /tmp/hubot

then

cd /tmp/hubot

add hubot-irc version 0.0.3 to dependencies to
vi package.json

add any other scripts or custom scripts you want to.
vi hubot-scripts.json

execute on shell first to test then with adapter.

shell bot
bin/hubot -n shbot

irc bot
bin/hubot -a irc -n ircbot

Let me know if this works for you.

@xcolour
Copy link
Contributor

xcolour commented Dec 3, 2011

Okay, here's what I've got:

In robot.coffee, line 300, the isinstanceof check is failing, which is causing processing of the message to halt.

I think the reason it's failing is that Robot is being required from differently located modules depending on whether it's required in the core of hubot or in the 3p adapter. So, there are actually two different Robot types, and that isinstanceof check is failing because it's asking if version A (constructed in the 3p adapter) is and instance of version B (required in the core of Hubot). My npm_modules directory seems to bear this out, because hubot-irc has its own node_modules which has its own hubot. That is:

node_modules/hubot
node_modules/hubot-irc
node_modules/hubot-irc/node_modules/hubot

I'm going to keep digging, but I don't really know node or coffescript, so I'm at a bit of a loss for how to proceed.

@xcolour
Copy link
Contributor

xcolour commented Dec 3, 2011

@nandub That's exactly what I've done.

@brunobord
Copy link
Author

@nandub: using your instructions, the shell bot is working. but the IRC bot still doesn't say anything. :/

@xcolour
Copy link
Contributor

xcolour commented Dec 3, 2011

I just upgraded to the latest versions of node and npm to rule that out, but with the same result:

$ node --version
v0.6.2
$ npm --version
1.0.106

@nandub
Copy link
Owner

nandub commented Dec 3, 2011

I am experiencing the same problem. This is probably the same issue #2.

@xcolour
Copy link
Contributor

xcolour commented Dec 3, 2011

Oh, nice. That seems to be exactly what I've observed. Shall we close this issue and mark it as a dupe?

@tombell
Copy link
Contributor

tombell commented Dec 3, 2011

I have a solution to this, it's pretty simple. I'll update the documentation to implementing an adapter.

@tombell tombell closed this as completed in 4a5f0bd Dec 3, 2011
@tombell
Copy link
Contributor

tombell commented Dec 3, 2011

If @nandub can push an updated version to npm, and everyone update their hubots to use that version, everything will be sweet and working. :)

@xcolour
Copy link
Contributor

xcolour commented Dec 3, 2011

I can confirm that this works for me. I suggests bumping the version before pushing to npm.

@nandub
Copy link
Owner

nandub commented Dec 4, 2011

Will bump and push to npm.

@nandub
Copy link
Owner

nandub commented Dec 4, 2011

pushed v0.0.5 to npm registry.

@xcolour
Copy link
Contributor

xcolour commented Dec 4, 2011

0.0.5 is confirmed as working for me. thanks all!

@brunobord
Copy link
Author

finally works for me too... big thank you to everyone involved.

@tombell
Copy link
Contributor

tombell commented Dec 4, 2011

🤘

@xcolour
Copy link
Contributor

xcolour commented Dec 7, 2011

EDIT: this is in response to a since-deleted comment. I'm leaving it for posterity.

try invoking hubot with:

$ bin/hubot -a irc -n <chat_user_your_bot_uses>

hubot seems to need the name it identifies as internally to match the name of its user in the chat app. i'm don't think that particular requirement is documented, though. i only discovered it by chance.

@anildigital
Copy link

Yeah thanks it worked. :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants