Sunday, 16 June 2013

Trying to running HuBot (and being stuck on ‘ERROR XMPP authentication failure’)

Sitting on a Starbucks in a Saturday morning (after dropping the kids on PSSA) it felt like a good time to try HuBot (repo is here).

Since I already had NodeJS installed on my test VM, I stated with the Deploying Hubot onto Windows instructions:

image

Running the installer, downloads a bunch of missing modules:

image

Which worked but, but when I started Hubot for the first time I had this error

image

I turned out to be because HuBot defaults to port 8080

image

… which I already had a server running there.

So after stopping that service, HuBot started with no errors

image

Since this is the first time I’m running HuBot I don’t really know what to do :)

image

And the browser didn’t help too:

image
image

Weirdly the main HuBot website didn’t had a ‘start here’ article, so I started digging through the documentation and found:

image

... which implied that /hubot/version was a valid url, which it was :)

image

So we know the HuBot is alive :)

I googled a bit and found http://server.dzone.com/articles/installing-and-running-hubot which looked like a good place to start:

image

I skipped the installation bit (since we already have HuBot installed) and started here

image

...which indicates that we should use the ‘hubot’ prefix to talk with Hubot

image

Good, HuBot is also alive from there :)

Next step was to install OpenFire and Spark, which you can read how I did it here

It this stage I tried to run the ./bin/hubot script, but I was missing CoffeeScript

image

After installing coffee-script

image

… I was able to execute .bin/hubot ok:

image

… and execute the next instruction from Deploying Hubot onto Windows which is hubot –c ./my-bot

image

This created a folder called my-bot in the .bin folder (UPDATE: this should had been done of the folder above (i.e. not inside the .bin folder)

image

... containing what looks like the contents of a Git repo:

image

The next steps from Deploying Hubot onto Windows  are to:

image

After making the config changes I executed npm install

image

... which failed because of this error:

image

... caused by the lack of python:

image

Here is the script I used to install python 3.3.2:

image

Here is the python shell being automatically picked up from the command line (which was not the default option in python install (you will need to manually check the box to add Python to system path)

image

But running npm install still fails because it doesn’t like the python 3.3.2

image

So I installed Python 2.7 with this script:

image

After the install I set the PYTHON environment variable to:

image

And now the npm install worked with just a couple warnings (note: I had to clear the node-gyp compilation cache before):

image

Trying to run HuBot (the custom my-bot one) gives this error:

image
image

.... which says that we need to install the node-stringprep module, which fails to install with this error:

image

The error above has nothing to do with node-stringprep , and related to the lack of this environment variable:

image

We’re getting close, now it starts the connection but we get an authentication failure

image

which I think is caused by the current environment HUBOT environment variables that I have setup

image

Lets change the authentication values to the credential used to connect to OpenFire directly using Jabber-net (see Using Jabber-net to talk to OpenFire post) :

image

And just to make sure, I added those values directly to the xmpp.coffee file

image

But the Authentication failure still happens:

image

Looking at the logs

image

in info.log

image

in jive.audit*.log (which looks like an xml)

image

So to see it I quickly wrote this script:

image

...which showed this formated view of the xml content:

image

... which unfortunately didn't help, because there were no any references to the o2-user account

Note: if I remove the preferredSaaslMechanism value, I get no errors or log messages:

image


STOPPING FOR NOW

At this stage I can’t spend more time on this, so I’m going to blog as it is and ask for help to the the HuBot community
Post a Comment