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

Starting Hubot using hubot-spark has errors, sometimes fails and chat randomly stops the bot from responding #15

Open
ernestgwilsonii opened this issue Sep 13, 2017 · 4 comments

Comments

@ernestgwilsonii
Copy link

What versions of Node, Hubot and Spark etc is known to work with hubot-spark?

Can someone please post a package.json that specifies versions of things known to work?

I get errors sometimes when starting the bot:

$ node_modules/.bin/hubot --adapter spark -n roberto
[Wed Sep 13 2017 14:58:15 GMT-0400 (Eastern Daylight Time)] INFO Trying connection to https://api.ciscospark.com/v1
one flight: attempted to invoke _getBinding while previous invocation still in flight
one flight: attempted to invoke _getBinding while previous invocation still in flight
[Wed Sep 13 2017 14:58:16 GMT-0400 (Eastern Daylight Time)] INFO Created connection instance to Spark
(node:26888) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 14): BadGateway: Bad Gateway
undefined https://api.ciscospark.com/v1/messages
WEBEX_TRACKING_ID: spark-js-sdk_82b92ea0-2895-4543-aa57-c534ecexxx
and
[DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Also, after a few minutes Hubot stops hearing my requests and stops answering completely randomly.

Lastly, during the brief periods I can get Hubot to connect and stay connected and hear and respond to chat when using hubot-spark as the adapter type, the responses take like 10 or 15 seconds for my bot to even hear chats which makes it slow to respond. I have been using the hubot-slack adapter for two years without any issues. What do I need to do to get hubot-spark working reliably? Specific versions of stuff or settings?

@d48
Copy link

d48 commented Oct 13, 2017

getting the same thing. any luck?

@jrimmer
Copy link

jrimmer commented Oct 25, 2017

I'm seeing the same effects being reported and while I've only glanced at the code the error message and odd performance I speculate are due to the Spark connections not being handled the way Cisco/Spark wants. I don't see this as a configuration or dependency issue as the adapter basically works - which is awesome, go @tonybaloney - so improving it ... should... be straightforward.

I may look into it...

@jrimmer
Copy link

jrimmer commented Oct 26, 2017

Did some more research - feel free to tell me shove off into a different issue...

The slow response is due to the Spark messages API the adapter uses which doesn't have streaming capabilities (such as Slack) and the connection failures are due to the adapter not respecting Spark API limiters.

Spark has message callbacks (webhooks) which improve the performance (and likely the API limiter) situation but this adapter's not using them. This is how Flint and Botkit, the bots Cisco recommends, access Spark.

I don't see the situation you're reporting improving without significantly changing the way the adapter receives Spark message. Fortunately adapters such as hubot-groupme-webhook use webhooks so there are templates upon which to base the work.

@ernestgwilsonii
Copy link
Author

Sadly, for Cisco Spark, I had to give up Hubot and switch to BotKit. I have BotKit configured similar to Hubot and working nicely now: https://github.com/ernestgwilsonii/genericCiscoSparkBot

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

3 participants