IRC Robot says everything twice #71

Closed
dcarley opened this Issue Oct 27, 2011 · 24 comments

Comments

Projects
None yet
@dcarley

dcarley commented Oct 27, 2011

Hubot seems so keen to talk to IRC that it repeats everything twice.

09:44 <@dan> hubot: ping
09:44 < hubot> PONG
09:44 < hubot> PONG

From dan to #test: hubot: ping
undefined: PONG
27 Oct 09:44:47 - SEND: PRIVMSG #test :PONG
undefined: PONG
27 Oct 09:44:47 - SEND: PRIVMSG #test :PONG
@atmos

This comment has been minimized.

Show comment Hide comment
@atmos

atmos Oct 28, 2011

Contributor

Closing in favor of #72

Contributor

atmos commented Oct 28, 2011

Closing in favor of #72

@atmos atmos closed this Oct 28, 2011

@dcarley

This comment has been minimized.

Show comment Hide comment
@dcarley

dcarley Oct 28, 2011

This is still happening in 5c76e7c. Separate from #72, which is now fixed.

dcarley commented Oct 28, 2011

This is still happening in 5c76e7c. Separate from #72, which is now fixed.

@atmos atmos reopened this Oct 28, 2011

@atmos atmos closed this in 2ec62c3 Oct 28, 2011

@atmos

This comment has been minimized.

Show comment Hide comment
@atmos

atmos Oct 28, 2011

Contributor

@dcarley can you try 0.1.4?

Contributor

atmos commented Oct 28, 2011

@dcarley can you try 0.1.4?

@marceldegraaf

This comment has been minimized.

Show comment Hide comment
@marceldegraaf

marceldegraaf Oct 28, 2011

Weird, I get the exact same behavior on the shell and in Campfire. The answer for each command I throw at Hubot (ping, math, image, mustache) is outputted twice. How can I help resolve this?

Weird, I get the exact same behavior on the shell and in Campfire. The answer for each command I throw at Hubot (ping, math, image, mustache) is outputted twice. How can I help resolve this?

@dcarley

This comment has been minimized.

Show comment Hide comment
@dcarley

dcarley Oct 28, 2011

That raises an error. But, if I'm reading it correctly, still wants to reply twice.

From dan to #test: hubot: ping
#test <dan> hubot: ping
#test PONG
error while calling listener: TypeError: Cannot call method 'say' of undefined
#test PONG
error while calling listener: TypeError: Cannot call method 'say' of undefined

In case it's relevant I'm launching Hubot with:

PATH=$PATH:node_modules/coffee-script/bin \
HUBOT_IRC_SERVER="irc" \
HUBOT_IRC_ROOMS="#test" \
HUBOT_IRC_NICK="hubot" \
./bin/hubot -a irc

dcarley commented Oct 28, 2011

That raises an error. But, if I'm reading it correctly, still wants to reply twice.

From dan to #test: hubot: ping
#test <dan> hubot: ping
#test PONG
error while calling listener: TypeError: Cannot call method 'say' of undefined
#test PONG
error while calling listener: TypeError: Cannot call method 'say' of undefined

In case it's relevant I'm launching Hubot with:

PATH=$PATH:node_modules/coffee-script/bin \
HUBOT_IRC_SERVER="irc" \
HUBOT_IRC_ROOMS="#test" \
HUBOT_IRC_NICK="hubot" \
./bin/hubot -a irc
@dcarley

This comment has been minimized.

Show comment Hide comment
@dcarley

dcarley Oct 28, 2011

Oh, this is my fault!

I think there was a time when I had trouble loading the distributed scripts and for reasons that I can no longer qualify I symlinked src/hubot/scripts to src/scripts. This must have caused all of the scripts to be loaded twice.

After removing the symlink it behaves as normal. 2ec62c3 can probably be reverted.

dcarley commented Oct 28, 2011

Oh, this is my fault!

I think there was a time when I had trouble loading the distributed scripts and for reasons that I can no longer qualify I symlinked src/hubot/scripts to src/scripts. This must have caused all of the scripts to be loaded twice.

After removing the symlink it behaves as normal. 2ec62c3 can probably be reverted.

@marceldegraaf

This comment has been minimized.

Show comment Hide comment
@marceldegraaf

marceldegraaf Oct 28, 2011

Aha! @dcarley, thanks for your hint. Apparently I had two separate scripts directories. Don't know why, but after removing the second one it all works normally again.

Aha! @dcarley, thanks for your hint. Apparently I had two separate scripts directories. Don't know why, but after removing the second one it all works normally again.

@cadwallion

This comment has been minimized.

Show comment Hide comment
@cadwallion

cadwallion Oct 28, 2011

Contributor

This is causing error while calling listener: TypeError: Cannot call method 'say' of undefined because you're losing scope of the @bot within the do () -> on line 7 and 17 of irc.coffee. It should be => so it maintains scope of the @bot attrib on lines 10 and 13.

Contributor

cadwallion commented Oct 28, 2011

This is causing error while calling listener: TypeError: Cannot call method 'say' of undefined because you're losing scope of the @bot within the do () -> on line 7 and 17 of irc.coffee. It should be => so it maintains scope of the @bot attrib on lines 10 and 13.

glucero pushed a commit to absperf/hubot that referenced this issue Aug 20, 2012

@findchris

This comment has been minimized.

Show comment Hide comment
@findchris

findchris Jan 31, 2013

Any clues for debugging the "hubot repeats everything twice" problem? I don't believe I've symlinked any scripts directory. Any help is appreciated.

Any clues for debugging the "hubot repeats everything twice" problem? I don't believe I've symlinked any scripts directory. Any help is appreciated.

@jeffmcfadden

This comment has been minimized.

Show comment Hide comment
@jeffmcfadden

jeffmcfadden Feb 19, 2013

@findchris I solved it for us by realizing I had scripts in both the scripts dir and in the hubots-scripts.json file.

@findchris I solved it for us by realizing I had scripts in both the scripts dir and in the hubots-scripts.json file.

@findchris

This comment has been minimized.

Show comment Hide comment
@findchris

findchris Feb 19, 2013

@jeffmcfadden Is that not correct behavior? github/hubot-scripts has the following in the README:
Just put them in scripts, add the new scripts to the hubot-scripts.json file.

@jeffmcfadden Is that not correct behavior? github/hubot-scripts has the following in the README:
Just put them in scripts, add the new scripts to the hubot-scripts.json file.

@jeffmcfadden

This comment has been minimized.

Show comment Hide comment
@jeffmcfadden

jeffmcfadden Feb 19, 2013

@findchris that's how I read it the first time too, but it seems there's an "or" missing in there.

If the script is in hubot-scripts catalog you can add it to the hubot-scripts file, otherwise you must drop it into scripts.

@findchris that's how I read it the first time too, but it seems there's an "or" missing in there.

If the script is in hubot-scripts catalog you can add it to the hubot-scripts file, otherwise you must drop it into scripts.

@findchris

This comment has been minimized.

Show comment Hide comment
@findchris

findchris Feb 20, 2013

@jeffmcfadden That did it. Thank you for the help! 👍

@jeffmcfadden That did it. Thank you for the help! 👍

@technicalpickles

This comment has been minimized.

Show comment Hide comment
@technicalpickles

technicalpickles Feb 24, 2013

Contributor

I updated the hubot-scripts README to be less ambiguous, thanks @findchris and @jeffmcfadden!

Contributor

technicalpickles commented Feb 24, 2013

I updated the hubot-scripts README to be less ambiguous, thanks @findchris and @jeffmcfadden!

@timfallkrux

This comment has been minimized.

Show comment Hide comment
@timfallkrux

timfallkrux Jun 6, 2013

This actually continues to happen when using the flowdock adapter. I suspect that it may actually happen when you create a new hubot inside the same directory as the git clone. Thus you could get a copy of your scripts from the original clone and another when creating the bot. As further evidence, a script that is only included in hubot-scripts.json only fires once.

This actually continues to happen when using the flowdock adapter. I suspect that it may actually happen when you create a new hubot inside the same directory as the git clone. Thus you could get a copy of your scripts from the original clone and another when creating the bot. As further evidence, a script that is only included in hubot-scripts.json only fires once.

@timfallkrux timfallkrux referenced this issue in flowdock/hubot-flowdock Jun 6, 2013

Closed

Hubot Crash After One Response #30

@tombell

This comment has been minimized.

Show comment Hide comment
@tombell

tombell Jun 6, 2013

Contributor

It must be a bug in the flowdock adapter as this isn't an issue with the core adapters (shell and campfire).

Contributor

tombell commented Jun 6, 2013

It must be a bug in the flowdock adapter as this isn't an issue with the core adapters (shell and campfire).

@timfallkrux

This comment has been minimized.

Show comment Hide comment
@timfallkrux

timfallkrux Jun 6, 2013

Actually, it happens when you store your hubot and hubot git clone in the same dir. It reads both the /scripts folder and the src/scripts folder. Moving it fixed the issue.

Actually, it happens when you store your hubot and hubot git clone in the same dir. It reads both the /scripts folder and the src/scripts folder. Moving it fixed the issue.

@picsoung

This comment has been minimized.

Show comment Hide comment
@picsoung

picsoung Sep 20, 2014

it also happened to me because my .coffee files were compiling to .js files

it also happened to me because my .coffee files were compiling to .js files

@gmelika

This comment has been minimized.

Show comment Hide comment
@gmelika

gmelika Oct 1, 2014

this seems to happen when hubot loses/restablishes connection

gmelika commented Oct 1, 2014

this seems to happen when hubot loses/restablishes connection

@lukaszraczylo

This comment has been minimized.

Show comment Hide comment
@lukaszraczylo

lukaszraczylo Apr 10, 2015

+1 on lost & re-established connection issue.

+1 on lost & re-established connection issue.

@michaelansel

This comment has been minimized.

Show comment Hide comment
@michaelansel

michaelansel Apr 13, 2015

Collaborator

The double load on reconnect is likely caused by the 'connected' event getting emitted again. The robot listens for 'connected' and loads all scripts at that point (assuming it will only get fired once). This would be adapter dependent (adapter decides when to emit 'connected'). Can you confirm which adapter you are using when this happens?

Collaborator

michaelansel commented Apr 13, 2015

The double load on reconnect is likely caused by the 'connected' event getting emitted again. The robot listens for 'connected' and loads all scripts at that point (assuming it will only get fired once). This would be adapter dependent (adapter decides when to emit 'connected'). Can you confirm which adapter you are using when this happens?

@gmelika

This comment has been minimized.

Show comment Hide comment
@gmelika

gmelika Apr 13, 2015

I use the hipchat adapter

gmelika commented Apr 13, 2015

I use the hipchat adapter

@michaelansel

This comment has been minimized.

Show comment Hide comment
@michaelansel

michaelansel Apr 14, 2015

Collaborator

Filed #919 to track the reconnecting issue

Collaborator

michaelansel commented Apr 14, 2015

Filed #919 to track the reconnecting issue

@brianjdoherty

This comment has been minimized.

Show comment Hide comment
@brianjdoherty

brianjdoherty Apr 20, 2015

This was happening to me, and I realized I was running the hubot process twice on my server. :-)

This was happening to me, and I realized I was running the hubot process twice on my server. :-)

@bardoloi bardoloi referenced this issue in HeadspringLabs/hsbot Jun 25, 2015

Closed

Duplicate Messages/Responses #43

11 of 11 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment