benbalter / hubot-webscale

A web-sockets based Hubot adapter to allow Hubot to be embedded in a website at webscale.
MIT License
6 stars 3 forks source link

How does one get this working? #2

Closed rhclayto closed 8 years ago

rhclayto commented 8 years ago

Hi,

Thanks for putting this up on GitHub. It looks really interesting.

I am having trouble getting this to work for me. I've got the server started & with hubot debugging turned on I get the following messages on start:

> hubot-webscale@0.0.1 start /var/www/hubot-webscale
> bin/hubot

connect deprecated multipart: use parser (multiparty, busboy, formidable) npm module instead node_modules/connect/lib/middleware/bodyParser.js:56:20
connect deprecated limit: Restrict request size at location of read node_modules/connect/lib/middleware/multipart.js:86:15
[Sat Jul 02 2016 11:30:06 GMT-0600 (MDT)] DEBUG Loading adapter webscale
[Sat Jul 02 2016 11:30:06 GMT-0600 (MDT)] DEBUG Loading scripts from /var/www/hubot-webscale/scripts
[Sat Jul 02 2016 11:30:06 GMT-0600 (MDT)] DEBUG Loading scripts from /var/www/hubot-webscale/src/scripts
[Sat Jul 02 2016 11:30:06 GMT-0600 (MDT)] DEBUG Loading hubot-scripts from /var/www/hubot-webscale/node_modules/hubot-scripts/src/scripts
[Sat Jul 02 2016 11:30:06 GMT-0600 (MDT)] DEBUG Loading external-scripts from npm packages
[Sat Jul 02 2016 11:30:07 GMT-0600 (MDT)] DEBUG Parsing help for /var/www/hubot-webscale/node_modules/hubot-diagnostics/src/diagnostics.coffee
[Sat Jul 02 2016 11:30:07 GMT-0600 (MDT)] DEBUG Parsing help for /var/www/hubot-webscale/node_modules/hubot-help/src/help.coffee
[Sat Jul 02 2016 11:30:07 GMT-0600 (MDT)] DEBUG Parsing help for /var/www/hubot-webscale/node_modules/hubot-google-images/src/google-images.coffee
[Sat Jul 02 2016 11:30:07 GMT-0600 (MDT)] DEBUG Parsing help for /var/www/hubot-webscale/node_modules/hubot-google-translate/src/google-translate.coffee
[Sat Jul 02 2016 11:30:07 GMT-0600 (MDT)] DEBUG Parsing help for /var/www/hubot-webscale/node_modules/hubot-pugme/src/pugme.coffee
[Sat Jul 02 2016 11:30:07 GMT-0600 (MDT)] DEBUG Parsing help for /var/www/hubot-webscale/node_modules/hubot-maps/src/maps.coffee
[Sat Jul 02 2016 11:30:07 GMT-0600 (MDT)] INFO Using default redis on localhost:6379
[Sat Jul 02 2016 11:30:07 GMT-0600 (MDT)] DEBUG Parsing help for /var/www/hubot-webscale/node_modules/hubot-redis-brain/src/redis-brain.coffee
[Sat Jul 02 2016 11:30:07 GMT-0600 (MDT)] DEBUG Parsing help for /var/www/hubot-webscale/node_modules/hubot-rules/src/rules.coffee
[Sat Jul 02 2016 11:30:07 GMT-0600 (MDT)] DEBUG Parsing help for /var/www/hubot-webscale/node_modules/hubot-shipit/src/shipit.coffee
[Sat Jul 02 2016 11:30:07 GMT-0600 (MDT)] DEBUG Parsing help for /var/www/hubot-webscale/node_modules/hubot-youtube/src/youtube.coffee
[Sat Jul 02 2016 11:30:07 GMT-0600 (MDT)] DEBUG Successfully connected to Redis
[Sat Jul 02 2016 11:30:07 GMT-0600 (MDT)] INFO Data for hubot brain retrieved from Redis

I load the front end page served by Express & in the Chrome Devtools Network view I see that socket.io is connected successfully, sending ping & pong messages between the server & client. When I type /help into the text box & submit it, I see that the message is emitted over the websocket. I get 'User /help' in the log window on that page.

That's where it ends. There is no response from hubot. Nothing is logged. When I check the socket object on the client side, it has the property connected: true. Is there anything I'm missing here? Thanks.

rhclayto commented 8 years ago

I've determined that nothing in the adapter inside of io.sockets.on 'connection', (socket) => is firing. If I put console.log "hey" just before that line, I get 'hey' in the logs, but if I put it right after that line, nothing. It seems the connection event is never reaching the code in the server. Any ideas why?

rhclayto commented 8 years ago

Well, just reporting back. I found the cause of my problem. I have multiple socket.io servers running on different ports. I was connecting to the wrong one! Thanks again for this cool adapter!