Skip to content
This repository has been archived by the owner on Jun 8, 2023. It is now read-only.

eardropping + hubot-irc fails to respond #969

Closed
gms8994 opened this issue Jun 5, 2013 · 7 comments
Closed

eardropping + hubot-irc fails to respond #969

gms8994 opened this issue Jun 5, 2013 · 7 comments

Comments

@gms8994
Copy link
Contributor

gms8994 commented Jun 5, 2013

I've adjusted eardropping.coffee as follows:

txtMessage = new TextMessage(msg.message.user, "#{robot.name}: #{task.task}")
@robot.logger.info txtMessage
robot.receive txtMessage

and when I trigger an eardrop event, I get the following in my logs:

2013-06-05T13:41:31.012174+00:00 app[web.1]: TypeError: Object #<TextMessage> has no method 'replace'
2013-06-05T13:41:31.012174+00:00 app[web.1]:   at TextListener.Listener.call (/app/node_modules/hubot/src/listener.coffee:24:14)
2013-06-05T13:41:31.012379+00:00 app[web.1]:   at /app/node_modules/hubot-irc/node_modules/irc/lib/irc.js:634:22
2013-06-05T13:41:31.012174+00:00 app[web.1]:   at TextListener.callback (/app/scripts/eardropping.coffee:95:31)
2013-06-05T13:41:31.012379+00:00 app[web.1]:   at emitReadable_ (_stream_readable.js:408:10)
2013-06-05T13:41:31.012174+00:00 app[web.1]: [Wed Jun 05 2013 13:41:31 GMT+0000 (UTC)] ERROR Unable to call the listener: TypeError: Object #<TextMessage> has no method 'replace'
2013-06-05T13:41:31.012174+00:00 app[web.1]:   at Client.EventEmitter.emit (events.js:106:17)
2013-06-05T13:41:31.012567+00:00 app[web.1]: 
2013-06-05T13:41:31.012567+00:00 app[web.1]:   at Socket.Readable.push (_stream_readable.js:127:10)
2013-06-05T13:41:31.012174+00:00 app[web.1]:   at EventEmitter.Log.info (/app/node_modules/hubot/node_modules/log/lib/log.js:234:10)
2013-06-05T13:41:31.012174+00:00 app[web.1]:   at Robot.receive (/app/node_modules/hubot/src/robot.coffee:111:33)
2013-06-05T13:41:31.012174+00:00 app[web.1]:   at Client.<anonymous> (/app/node_modules/hubot-irc/src/irc.coffee:265:21)
2013-06-05T13:41:31.012174+00:00 app[web.1]:   at IrcBot.Adapter.receive (/app/node_modules/hubot/src/adapter.coffee:45:25)
2013-06-05T13:41:31.012379+00:00 app[web.1]:   at Client.<anonymous> (/app/node_modules/hubot-irc/node_modules/irc/lib/irc.js:472:22)
2013-06-05T13:41:31.012379+00:00 app[web.1]:   at Client.EventEmitter.emit (events.js:95:17)
2013-06-05T13:41:31.012174+00:00 app[web.1]:   at EventEmitter.Log.log (/app/node_modules/hubot/node_modules/log/lib/log.js:148:25)
2013-06-05T13:41:31.012379+00:00 app[web.1]:   at Array.forEach (native)
2013-06-05T13:41:31.012567+00:00 app[web.1]:   at TCP.onread (net.js:511:21)
2013-06-05T13:41:31.012379+00:00 app[web.1]:   at emitReadable (_stream_readable.js:404:5)
2013-06-05T13:41:31.012567+00:00 app[web.1]:   at readableAddChunk (_stream_readable.js:165:9)
2013-06-05T13:41:31.012379+00:00 app[web.1]:   at Socket.<anonymous> (/app/node_modules/hubot-irc/node_modules/irc/lib/irc.js:631:15)
2013-06-05T13:41:31.012379+00:00 app[web.1]:   at Socket.EventEmitter.emit (events.js:95:17)
2013-06-05T13:41:31.012379+00:00 app[web.1]:   at Socket.<anonymous> (_stream_readable.js:736:14)
2013-06-05T13:41:31.012379+00:00 app[web.1]:   at Socket.EventEmitter.emit (events.js:92:17)
@technicalpickles
Copy link
Contributor

Could you paste a diff, or maybe even a pull request? As far as I can tell, it looks like you're trying to add logging.

@gms8994
Copy link
Contributor Author

gms8994 commented Jun 17, 2013

@technicalpickles I was trying to add logging, to verify that the message being sent was correct. The problem that I'm having is more along the lines that all eardrop's seem to not respond:

2013-06-17T14:52:48.237321+00:00 app[web.1]: From dp to #test: hubot: when you hear hello do hi
2013-06-17T14:52:48.241920+00:00 app[web.1]: #test <dp> hubot: when you hear hello do hi
2013-06-17T14:52:52.244151+00:00 app[web.1]: [Mon Jun 17 2013 14:52:52 GMT+0000 (UTC)] ERROR Unable to call the listener: TypeError: Object #<TextMessage> has no method 'replace'
2013-06-17T14:52:52.241868+00:00 app[web.1]: From dp to #test: hello
2013-06-17T14:52:52.241868+00:00 app[web.1]: #test <dp> hello
2013-06-17T14:52:52.244151+00:00 app[web.1]: TypeError: Object #<TextMessage> has no method 'replace'
2013-06-17T14:52:52.244151+00:00 app[web.1]:   at Robot.receive (/app/node_modules/hubot/src/robot.coffee:111:33)
2013-06-17T14:52:52.244151+00:00 app[web.1]:   at IrcBot.Adapter.receive (/app/node_modules/hubot/src/adapter.coffee:45:25)
2013-06-17T14:52:52.244151+00:00 app[web.1]:   at TextListener.Listener.call (/app/node_modules/hubot/src/listener.coffee:24:14)
2013-06-17T14:52:52.244151+00:00 app[web.1]:   at EventEmitter.Log.info (/app/node_modules/hubot/node_modules/log/lib/log.js:234:10)
2013-06-17T14:52:52.244151+00:00 app[web.1]:   at TextListener.callback (/app/scripts/eardropping.coffee:95:31)
2013-06-17T14:52:52.244151+00:00 app[web.1]:   at EventEmitter.Log.log (/app/node_modules/hubot/node_modules/log/lib/log.js:148:25)
2013-06-17T14:52:52.244316+00:00 app[web.1]:   at Client.EventEmitter.emit (events.js:95:17)
2013-06-17T14:52:52.244316+00:00 app[web.1]:   at /app/node_modules/hubot-irc/node_modules/irc/lib/irc.js:634:22
2013-06-17T14:52:52.244316+00:00 app[web.1]:   at Array.forEach (native)
2013-06-17T14:52:52.244472+00:00 app[web.1]:   at TCP.onread (net.js:511:21)
2013-06-17T14:52:52.244316+00:00 app[web.1]:   at Socket.EventEmitter.emit (events.js:95:17)
2013-06-17T14:52:52.244316+00:00 app[web.1]:   at Socket.<anonymous> (_stream_readable.js:736:14)
2013-06-17T14:52:52.244316+00:00 app[web.1]:   at Socket.EventEmitter.emit (events.js:92:17)
2013-06-17T14:52:52.244472+00:00 app[web.1]:   at readableAddChunk (_stream_readable.js:165:9)
2013-06-17T14:52:52.244472+00:00 app[web.1]:   at Socket.Readable.push (_stream_readable.js:127:10)
2013-06-17T14:52:52.244151+00:00 app[web.1]:   at Client.EventEmitter.emit (events.js:106:17)
2013-06-17T14:52:52.244151+00:00 app[web.1]:   at Client.<anonymous> (/app/node_modules/hubot-irc/src/irc.coffee:265:21)
2013-06-17T14:52:52.244316+00:00 app[web.1]:   at Client.<anonymous> (/app/node_modules/hubot-irc/node_modules/irc/lib/irc.js:472:22)
2013-06-17T14:52:52.244472+00:00 app[web.1]: 
2013-06-17T14:52:52.244316+00:00 app[web.1]:   at Socket.<anonymous> (/app/node_modules/hubot-irc/node_modules/irc/lib/irc.js:631:15)
2013-06-17T14:52:52.244316+00:00 app[web.1]:   at emitReadable_ (_stream_readable.js:408:10)
2013-06-17T14:52:52.244316+00:00 app[web.1]:   at emitReadable (_stream_readable.js:404:5)

@technicalpickles
Copy link
Contributor

@gms8994 this kind of looks like a bug with hubot-irc. Could you make sure you are on the latest version, and also drop me a copy of the script you are working somewhere to confirm it's not something obvious there.

@tombell
Copy link
Contributor

tombell commented Jun 19, 2013

It appears that replace is trying to be called on an instance of TextMessage some where in the stack

2013-06-17T14:52:52.244151+00:00 app[web.1]: TypeError: Object #<TextMessage> has no method 'replace'

@tombell
Copy link
Contributor

tombell commented Jun 19, 2013

I'm also not entirely sure why the eardropping script fires its own robot.receive call: https://github.com/github/hubot-scripts/blob/master/src/scripts/eardropping.coffee#L70

@gms8994
Copy link
Contributor Author

gms8994 commented Jun 19, 2013

I'm not sure either. I've actually noticed in another hubot instance I have running that he rarely (if ever) responds to ear-drops. Could it be the robot.receive call?

@technicalpickles
Copy link
Contributor

Marking this one as needs-maintainer, since I haven't actively used or worked with this. It's also a good candidate for extraction to an external package if anyone is interested cc #1113

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

No branches or pull requests

4 participants