hubot fails to start with flowdock adapter - node.js

node: 0.10.0
npm: 1.2.14
I've set the environment variables HUBOT_FLOWDOCK_LOGIN_EMAIL and HUBOT_FLOWDOCK_LOGIN_PASSWORD, and then tried the following.
Pulled down the prebuilt hubot from the hubot site.
Modified the package.json as above.
Run npm install
Added
"hubot-flowdock": ">= 0.0.1",
just underneath dependencies in my package.json
Removed redis from hubot-scripts.json
run npm install
then running ./bin/hubot -a flowdock -d
With this implementation, ./bin/hubot - flowdock
Produces the following stacktrace:
TypeError: Uncaught, unspecified "error" event.
at TypeError (<anonymous>)
at Session.EventEmitter.emit (events.js:74:15)
at Request._callback (/Users/gb/workspace/hubot-2.2.0/node_modules/hubot-flowdock/node_modules/flowdock/lib/flowdock.js:49:17)
at Request.self.callback (/Users/gb/workspace/hubot-2.2.0/node_modules/hubot-flowdock/node_modules/flowdock/node_modules/request/main.js:122:22)
at Request.EventEmitter.emit (events.js:98:17)
at Request.<anonymous> (/Users/gb/workspace/hubot-2.2.0/node_modules/hubot-flowdock/node_modules/flowdock/node_modules/request/main.js:661:16)
at Request.EventEmitter.emit (events.js:117:20)
at IncomingMessage.<anonymous> (/Users/gb/workspace/hubot-2.2.0/node_modules/hubot-flowdock/node_modules/flowdock/node_modules/request/main.js:623:14)
at IncomingMessage.EventEmitter.emit (events.js:117:20)
at _stream_readable.js:870:14
Looking at /Users/gb/workspace/hubot-2.2.0/node_modules/hubot-flowdock/node_modules/flowdock/lib/flowdock.js:49:17, that is a fail on a response statusCode > 300.
So far so good. Adding a console.log to the line above produces "401" unauthorized.
How? The credentials are correct (I log in with that email/password routinely).

For anyone who cares, eventually I realized that my password was incorrect. I was attempting to use my email password, while the correct answer is to use the password you set up when you first connect to flowdock

Related

Jasmine test suite doesn't run

I can't figure out what I've done to mess up Jasmine.
Here's a link to the repo I'm working on:
https://github.com/bryanbeus/04-09-bloccit/tree/v0.1.3
The problem is somehow related to the files /spec/integration/flairs_spec.js, /spec/integration/post_spec.js, and probably more.
The problem can be seen when running a command like npm test. I get the following result:
04-09-bloccit#1.0.0 test /home/siddhartha/Documents/07-Temp/01-Bloc/04-09-bloccit
export NODE_ENV=test && jasmine
npm ERR! Test failed. See above for more details.
It used to be that this ERR would only occur if I had an non-compilable error somewhere in my code. (For example, a simple thing like ; out of place, or an improper use of this.)
Recently, I've heard from someone else that this type of failure for Jasmine isn't normal. Usually, if there's a problem in the code, Jasmine is still supposed to say something. ?
Whatever the problem is, it is now spreading to general usage.
I'm trying to call the server npm module for a test with this command:
const server = require("../../src/server");
If that line is anywhere in my files, the entire Jasmine test fails in the exact same manner. (npm ERR... and no other details.)
If I run npm test /spec/integration/flairs_spec.js with that call to server active, the test fails in the npm ERR... manner.
However, if I comment out the call to server, then Jasmine at least runs. It returns this error:
....................
Started
F
Failures:
1) routes : flairs GET /topics/:topicId/posts/:postId/flairs/new should render a new flair form
Message:
Expected Error: connect ECONNREFUSED 127.0.0.1:3000 to be null.
Stack:
Error: Expected Error: connect ECONNREFUSED 127.0.0.1:3000 to be null.
at
at Request.request.get [as _callback] (/home/siddhartha/Documents/07-Temp/01-Bloc/04-09-bloccit/spec/integration/flairs_spec.js:57:21)
at self.callback (/home/siddhartha/Documents/07-Temp/01-Bloc/04-09-bloccit/node_modules/request/request.js:186:22)
at Request.emit (events.js:160:13)
at Request.onRequestError (/home/siddhartha/Documents/07-Temp/01-Bloc/04-09-bloccit/node_modules/request/request.js:878:8)
at ClientRequest.emit (events.js:160:13)
at Socket.socketErrorListener (_http_client.js:389:9)
at Socket.emit (events.js:160:13)
at emitErrorNT (internal/streams/destroy.js:64:8)
at process._tickCallback (internal/process/next_tick.js:152:19)
Message:
Expected undefined to contain 'New Flair'.
Stack:
Error: Expected undefined to contain 'New Flair'.
at
at Request.request.get [as _callback] (/home/siddhartha/Documents/07-Temp/01-Bloc/04-09-bloccit/spec/integration/flairs_spec.js:58:22)
at self.callback (/home/siddhartha/Documents/07-Temp/01-Bloc/04-09-bloccit/node_modules/request/request.js:186:22)
at Request.emit (events.js:160:13)
at Request.onRequestError (/home/siddhartha/Documents/07-Temp/01-Bloc/04-09-bloccit/node_modules/request/request.js:878:8)
at ClientRequest.emit (events.js:160:13)
at Socket.socketErrorListener (_http_client.js:389:9)
at Socket.emit (events.js:160:13)
at emitErrorNT (internal/streams/destroy.js:64:8)
at process._tickCallback (internal/process/next_tick.js:152:19)
1 spec, 1 failure
Finished in 0.399 seconds
npm ERR! Test failed. See above for more details.
.......
So, removing the server call at least lets Jasmine run.
Any help on this is appreciated. Thank you for helping a novice programmer.
I found the source of the error.
Using git diff v0.1.2..v0.1.3 I was able to see the differences between the last working branch, and the current one.
From here, I saw that in db/src/controllers/flairController.js I had placed this in the controller for the flair object:
const flairQueries = require("./db/queries.flairs.js");
The problem with that is that the directory isn't correct. I replaced it with this:
const flairQueries = require("../db/queries.flairs.js");
After this, the Jasmine test suite worked.
I understand that this means that the controller couldn't load properly. The full understanding of this is still elusive, so if anyone has time to try to explain, I would appreciate it. Otherwise, we can consider this question closed. Thanks!

error: A hook (`userconfig`) failed to load

after npm install , getting error like, i have checked every config file and also installed lodash manually after but still not working
error: A hook (`userconfig`) failed to load!
error: Error: In Sails v1.x, `sails.config.globals._` must be either `false` or an object (typically the value of `require('lodash')`)
at Sails.exposeGlobals (D:\Node_Project\POS\trunk\node_modules\sails\lib\app\private\exposeGlobals.js:47:44)
at Sails.wrapper [as exposeGlobals] (D:\Node_Project\POS\trunk\node_modules\#sailshq\lodash\lib\index.js:3250:19)
at emitNone (events.js:91:20)
at Sails.emit (events.js:185:7)
at Sails.emitter.emit (D:\Node_Project\POS\trunk\node_modules\sails\lib\app\private\after.js:50:11)
at D:\Node_Project\POS\trunk\node_modules\sails\lib\app\private\loadHooks.js:111:15
at Hook.initialize (D:\Node_Project\POS\trunk\node_modules\sails\lib\hooks\index.js:154:14)
at Hook.wrapper [as initialize] (D:\Node_Project\POS\trunk\node_modules\#sailshq\lodash\lib\index.js:3250:19)
at D:\Node_Project\POS\trunk\node_modules\sails\lib\hooks\index.js:88:16
at D:\Node_Project\POS\trunk\node_modules\sails\node_modules\async\dist\async.js:486:20
First : Make sure you've installed dependencies with npm install
Second : Check that this app was built for a compatible version of Sails.

Passport Nodejs failed to verify assertion

InternalOpenIDError: Failed to verify assertion
at /var/nodejs/Website/node_modules/passport-openid/lib/passport-openid/strategy.js:184:36
at /var/nodejs/Website/node_modules/openid/openid.js:927:12
at /var/nodejs/Website/node_modules/openid/openid.js:1051:16
at /var/nodejs/Website/node_modules/openid/openid.js:1169:16
at Request._callback (/var/nodejs/Website/node_modules/openid/openid.js:190:7)
at Request.self.callback (/var/nodejs/Website/node_modules/request/request.js:198:22)
at emitTwo (events.js:87:13)
at Request.emit (events.js:172:7)
at Request.<anonymous> (/var/nodejs/Website/node_modules/request/request.js:1035:10)
at emitOne (events.js:82:20)
GET /auth/steam/callback?openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.mode=id_res&openid.op_endpoint=https%3A%2F%2Fsteamcommunity.com%2Fopenid%2Flogin&openid.claimed_id=http%3A%2F%2Fsteamcommunity.com%2Fopenid%2Fid%2F76561198197967283&openid.identity=http%3A%2F%2Fsteamcommunity.com%2Fopenid%2Fid%2F76561198197967283&openid.return_to=http%3A%2F%2Fcsgomayhem.com%2Fauth%2Fsteam%2Fcallback&openid.response_nonce=2015-11-25T18%3A40%3A44ZOdgvGQXoVnz9LWfko54I371tMOM%3D&openid.assoc_handle=1234567890&openid.signed=signed%2Cop_endpoint%2Cclaimed_id%2Cidentity%2Creturn_to%2Cresponse_nonce%2Cassoc_handle&openid.sig=L5jXiwo2S4mVe0r%2BkcpU%2Bj%2BaEEU%3D 500 665ms - 708b
I've had my code working for several weeks now in my windows dev environment but now trying to run it on an Ubuntu 14.04 prod machine I am presented with this error when authenticating someone through Steam. I have no idea what the error means and Googling and searching on here hasn't yielded any results. I can provide the relevant code if you tell me what I'm looking for or if this is an easy fix please let me know.
All help would be greatly appreciated, regards.
I solved this by downgrading my version of passport as if appeared to be incompatible with passport-steam. I see some examples for authentication on the github of passport-steam if you ever need if for just authenticating users but not getting their details.

OpenID for Node.js cannot run the sample server

When I try to run the sample nodejs server using openid found at
http://ox.no/software/node-openid
I get the following trace:
/home/ubuntu/node_modules/openid/openid.js:868
return callback({ message: 'No providers found for the given identifier'
^
TypeError: undefined is not a function
at /home/ubuntu/node_modules/openid/openid.js:868:14
at /home/ubuntu/node_modules/openid/openid.js:656:13
at /home/ubuntu/node_modules/openid/openid.js:612:11
at /home/ubuntu/node_modules/openid/openid.js:254:9
at IncomingMessage.<anonymous> (/home/ubuntu/node_modules/openid/openid.js:258:32)
at IncomingMessage.emit (events.js:88:20)
at HTTPParser.onMessageComplete (http.js:137:23)
at CleartextStream.ondata (http.js:1150:24)
at CleartextStream._push (tls.js:375:27)
at SecurePair.cycle (tls.js:734:20)
Perhaps the problem is the openid_identifier I supply on the first page. I have tried
yahoo.com
www.google.com/accounts/o8/id
www.google.com/accounts/o9/ud
When I try www.google.com/accounts/o8/id I get a slightly different trace:
/home/ubuntu/node_modules/openid/openid.js:895
return callback(null, authUrl);
^
TypeError: undefined is not a function
at successOrNext (/home/ubuntu/node_modules/openid/openid.js:895:18)
at /home/ubuntu/node_modules/openid/openid.js:1008:3
at successOrNext (/home/ubuntu/node_modules/openid/openid.js:909:9)
at /home/ubuntu/node_modules/openid/openid.js:931:5
at /home/ubuntu/node_modules/openid/openid.js:678:7
at /home/ubuntu/node_modules/openid/openid.js:544:16
at /home/ubuntu/node_modules/openid/openid.js:254:9
at IncomingMessage.<anonymous> (/home/ubuntu/node_modules/openid/openid.js:258:32)
at IncomingMessage.emit (events.js:88:20)
at HTTPParser.onMessageComplete (http.js:137:23)
Anyone have any idea what I've done wrong, how I can fix it?
At least for me the following worked like a charm:
git clone git#github.com:havard/node-openid.git
cd node-openid/
sudo node sample.js
I then launched my browser to localhost and logged in with Google's address: https://www.google.com/accounts/o8/id
It worked fine. So it looks like the sample on their website is a bit out of date while the one in their git repo works.

Can not create nodester account

I want to register on http://nodester.com/. I got my coupon, registered on site, installed nodester (npm install nodester-cli -g)
and user setup command (nodester user setup gio.beri#gmail.com pass***) gives me error:
nodester info verifying credentials
/usr/local/lib/node_modules/nodester-cli/node_modules/nodester-api/node_modules/request/vendor/cookie/index.js:45
: url.parse(req.url).pathname;
^
TypeError: Cannot read property 'url' of undefined
at new Cookie (/usr/local/lib/node_modules/nodester-cli/node_modules/nodester-api/node_modules/request/vendor/cookie/index.js:45:20)
at /usr/local/lib/node_modules/nodester-cli/node_modules/nodester-api/node_modules/request/main.js:432:33
at Array.forEach (native)
at Request. (/usr/local/lib/node_modules/nodester-cli/node_modules/nodester-api/node_modules/request/main.js:426:46)
at Request.emit (events.js:64:17)
at IncomingMessage. (/usr/local/lib/node_modules/nodester-cli/node_modules/nodester-api/node_modules/request/main.js:391:16)
at IncomingMessage.emit (events.js:81:20)
at HTTPParser.onMessageComplete (http.js:133:23)
at CleartextStream.ondata (http.js:1231:22)
at CleartextStream._push (tls.js:303:27)
Can anyone suggest anything?
EDIT:
I think that problem is in my password. what must me there coupon???

Resources