flowdock / hubot-flowdock

Flowdock adapter for Hubot chat bot
94 stars 60 forks source link

hubot fails to launch with flowdock plugin #11

Closed ggoodale closed 12 years ago

ggoodale commented 12 years ago

node: 0.6.x, 0.8.x npm: 1.0.x, 1.1.x hubot: 2.2.0

Error:

2012-09-25T21:55:56+00:00 heroku[web.1]: Starting process with command `bin/hubot -a flowdock -n Hubot`
2012-09-25T21:55:56+00:00 app[web.1]: bin/hubot: 3: npm: not found
2012-09-25T21:55:57+00:00 app[web.1]: TypeError: Cannot call method 'on' of null
2012-09-25T21:55:57+00:00 app[web.1]: [Tue Sep 25 2012 21:55:57 GMT+0000 (UTC)] ERROR Cannot load adapter flowdock - TypeError: Cannot read property 'prototype' of undefined
2012-09-25T21:55:57+00:00 app[web.1]:     at Object.<anonymous> (/app/node_modules/hubot/bin/hubot:105:19)
2012-09-25T21:55:57+00:00 app[web.1]:     at Object.<anonymous> (/app/node_modules/hubot/bin/hubot:109:4)
2012-09-25T21:55:57+00:00 app[web.1]:     at Module._compile (module.js:449:26)
2012-09-25T21:55:57+00:00 app[web.1]:     at Object.exports.run (/app/node_modules/hubot/node_modules/coffee-script/lib/coffee-script/coffee-script.js:79:25)
2012-09-25T21:55:57+00:00 app[web.1]:     at compileScript (/app/node_modules/hubot/node_modules/coffee-script/lib/coffee-script/command.js:177:29)
2012-09-25T21:55:57+00:00 app[web.1]:     at fs.readFile (fs.js:176:14)
2012-09-25T21:55:57+00:00 app[web.1]:     at fs.stat.notSources.(anonymous function) (/app/node_modules/hubot/node_modules/coffee-script/lib/coffee-script/command.js:152:18)
2012-09-25T21:55:57+00:00 app[web.1]:     at Object.oncomplete (fs.js:297:15)
2012-09-25T21:55:58+00:00 heroku[web.1]: Process exited with status 1

No mods to the flowdock adapter or hubot. API change maybe?

ggoodale commented 12 years ago

Strange. the 0.2.5 version of the adapter works fine, so something about 0.3.0 is incompatible with hubot 2.2.0 maybe?

anttipitkanen commented 12 years ago

Yeah, it seems that most recent commit in master changes the style of requiring Hubot to be compatible with 2.3.x: SHA: 31174734e8168f5c0ec163f04c63a2b75575bd89

This means that the adapter version 0.3.0 is not anymore compatible with the older 2.2.x versions of Hubot. I'll document this to the adapter README to avoid confusion. :)

tubbo commented 12 years ago

This still doesn't work for me. Not only that, but hubot-flowdock doesn't seem to be listening to my environment variables...

♬  echo $HUBOT_FLOWDOCK_LOGIN_EMAIL
my@email.address.com
♬  ./bin/hubot -a flowdock
ERROR: No credentials in environment variables HUBOT_FLOWDOCK_LOGIN_EMAIL and HUBOT_FLOWDOCK_LOGIN_PASSWORD
Error: Uncaught, unspecified 'error' event.
    at Flowdock.emit (events.js:50:15)
    at Flowdock.run (/Users/tom/Code/fubot/node_modules/hubot-flowdock/src/flowdock.coffee:77:14)
    at Robot.run (/Users/tom/Code/fubot/node_modules/hubot/src/robot.coffee:338:27)
    at Object.<anonymous> (/Users/tom/Code/fubot/node_modules/hubot/bin/hubot:106:11)
    at Object.<anonymous> (/Users/tom/Code/fubot/node_modules/hubot/bin/hubot:109:4)
    at Module._compile (module.js:432:26)
    at Object.run (/Users/tom/Code/fubot/node_modules/hubot/node_modules/coffee-script/lib/coffee-script/coffee-script.js:79:25)
    at /Users/tom/Code/fubot/node_modules/hubot/node_modules/coffee-script/lib/coffee-script/command.js:175:29
    at /Users/tom/Code/fubot/node_modules/hubot/node_modules/coffee-script/lib/coffee-script/command.js:150:18
    at [object Object].<anonymous> (fs.js:115:5)

When I pass those values in through the command line, I get:

♬  HUBOT_FLOWDOCK_LOGIN_EMAIL=email@address.com HUBOT_FLOWDOCK_LOGIN_PASSWORD=something ./bin/hubot -a flowdock
The "sys" module is now called "util". It should have a similar interface.

events.js:50
        throw new Error("Uncaught, unspecified 'error' event.");
              ^
Error: Uncaught, unspecified 'error' event.
    at Session.emit (events.js:50:15)
    at Request._callback (/Users/tom/Code/fubot/node_modules/hubot-flowdock/node_modules/flowdock/lib/flowdock.js:48:17)
    at Request.callback (/Users/tom/Code/fubot/node_modules/hubot-flowdock/node_modules/flowdock/node_modules/request/main.js:118:22)
    at Request.<anonymous> (/Users/tom/Code/fubot/node_modules/hubot-flowdock/node_modules/flowdock/node_modules/request/main.js:459:16)
    at Request.emit (events.js:67:17)
    at IncomingMessage.<anonymous> (/Users/tom/Code/fubot/node_modules/hubot-flowdock/node_modules/flowdock/node_modules/request/main.js:418:14)
    at IncomingMessage.emit (events.js:88:20)
    at HTTPParser.onMessageComplete (http.js:137:23)
    at CleartextStream.ondata (http.js:1137:24)
    at CleartextStream._push (tls.js:367:27)
anttipitkanen commented 12 years ago

Sorry for the delay in answering to this. I can reproduce this error if I give wrong credentials for the environment variables. Are you sure you don't have a typo there or some special characters in password that could be mangled in the command line input?

There should probably be a better handling for invalid credentials anyway, this error message is pretty confusing.

tubbo commented 12 years ago

It works if I export the variables, but yeah it would be cool if it at least checked for these variables.

tubbo commented 12 years ago

I was using an ancient version of Node (I think v0.6?), and when I updated to 8 everything worked. So maybe just instruct people to update if they see this bug again. :)

anttipitkanen commented 12 years ago

Thanks for debugging this! I'll add a note to the README about using a recent Node version. :)