Skip to content
This repository has been archived by the owner on Mar 6, 2018. It is now read-only.

weird exception #3

Open
seiyria opened this issue Nov 7, 2014 · 3 comments
Open

weird exception #3

seiyria opened this issue Nov 7, 2014 · 3 comments

Comments

@seiyria
Copy link

seiyria commented Nov 7, 2014

TypeError: Cannot read property 'findOne' of undefined
  at [object Object].MongoStore.get (/root/idlebot/src/modules/idle/node_modules/express-brute-mongo/index.js:37:13)
  at [object Object].<anonymous> (/root/idlebot/src/modules/idle/node_modules/express-brute/index.js:82:15)
  at keyFunc (/root/idlebot/src/modules/idle/node_modules/express-brute/index.js:49:41)
  at [object Object].<anonymous> (/root/idlebot/src/modules/idle/node_modules/express-brute/index.js:57:3)
  at Layer.handle [as handle_request] (/root/idlebot/src/modules/idle/node_modules/express/lib/router/layer.js:82:5)
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/route.js:100:13)
  at Route.dispatch (/root/idlebot/src/modules/idle/node_modules/express/lib/router/route.js:81:3)
  at Layer.handle [as handle_request] (/root/idlebot/src/modules/idle/node_modules/express/lib/router/layer.js:82:5)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:234:24
  at Function.proto.process_params (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:312:12)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:228:12
  at Function.match_layer (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:295:3)
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:189:10)
  at Function.proto.handle (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:165:3)
  at router (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:34:12)
  at Layer.handle [as handle_request] (/root/idlebot/src/modules/idle/node_modules/express/lib/router/layer.js:82:5)
  at trim_prefix (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:270:13)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:237:9
  at Function.proto.process_params (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:312:12)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:228:12
  at Function.match_layer (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:295:3)
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:189:10)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:559:15
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:186:14)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:191:16
  at Function.match_layer (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:295:3)
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:189:10)
  at Function.proto.handle (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:165:3)
  at router (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:34:12)
  at Layer.handle [as handle_request] (/root/idlebot/src/modules/idle/node_modules/express/lib/router/layer.js:82:5)
  at trim_prefix (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:270:13)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:237:9
  at Function.proto.process_params (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:312:12)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:228:12
  at Function.match_layer (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:295:3)
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:189:10)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:559:15
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:186:14)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:191:16
  at Function.match_layer (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:295:3)
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:189:10)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:191:16
  at Function.match_layer (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:295:3)
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:189:10)
  at Function.proto.handle (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:165:3)
  at router (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:34:12)
  at Layer.handle [as handle_request] (/root/idlebot/src/modules/idle/node_modules/express/lib/router/layer.js:82:5)
  at trim_prefix (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:270:13)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:237:9
  at Function.proto.process_params (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:312:12)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:228:12
  at Function.match_layer (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:295:3)
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:189:10)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:559:15
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:186:14)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:191:16
  at Function.match_layer (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:295:3)
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:189:10)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:191:16
  at Function.match_layer (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:295:3)
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:189:10)
  at Function.proto.handle (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:165:3)
  at router (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:34:12)
  at Layer.handle [as handle_request] (/root/idlebot/src/modules/idle/node_modules/express/lib/router/layer.js:82:5)
  at trim_prefix (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:270:13)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:237:9
  at Function.proto.process_params (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:312:12)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:228:12
  at Function.match_layer (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:295:3)
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:189:10)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:559:15
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:186:14)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:191:16
  at Function.match_layer (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:295:3)
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:189:10)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:191:16
  at Function.match_layer (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:295:3)
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:189:10)
  at Function.proto.handle (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:165:3)
  at router (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:34:12)
  at Layer.handle [as handle_request] (/root/idlebot/src/modules/idle/node_modules/express/lib/router/layer.js:82:5)
  at trim_prefix (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:270:13)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:237:9
  at Function.proto.process_params (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:312:12)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:228:12
  at Function.match_layer (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:295:3)
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:189:10)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:559:15
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:186:14)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:191:16
  at Function.match_layer (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:295:3)
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:189:10)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:191:16
  at Function.match_layer (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:295:3)
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:189:10)
  at Function.proto.handle (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:165:3)
  at router (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:34:12)
  at Layer.handle [as handle_request] (/root/idlebot/src/modules/idle/node_modules/express/lib/router/layer.js:82:5)
  at trim_prefix (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:270:13)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:237:9
  at Function.proto.process_params (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:312:12)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:228:12
  at Function.match_layer (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:295:3)
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:189:10)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:559:15
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:186:14)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:191:16
  at Function.match_layer (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:295:3)
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:189:10)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:191:16
  at Function.match_layer (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:295:3)
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:189:10)
  at Function.proto.handle (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:165:3)
  at router (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:34:12)
  at Layer.handle [as handle_request] (/root/idlebot/src/modules/idle/node_modules/express/lib/router/layer.js:82:5)
  at trim_prefix (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:270:13)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:237:9
  at Function.proto.process_params (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:312:12)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:228:12
  at Function.match_layer (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:295:3)
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:189:10)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:559:15
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:186:14)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:191:16
  at Function.match_layer (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:295:3)
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:189:10)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:191:16
  at Function.match_layer (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:295:3)
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:189:10)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:191:16
  at Function.match_layer (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:295:3)
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:189:10)
  at Function.proto.handle (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:165:3)
  at router (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:34:12)
  at Layer.handle [as handle_request] (/root/idlebot/src/modules/idle/node_modules/express/lib/router/layer.js:82:5)
  at trim_prefix (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:270:13)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:237:9
  at Function.proto.process_params (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:312:12)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:228:12
  at Function.match_layer (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:295:3)
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:189:10)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:559:15
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:186:14)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:191:16
  at Function.match_layer (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:295:3)
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:189:10)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:191:16
  at Function.match_layer (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:295:3)
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:189:10)
  at Function.proto.handle (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:165:3)
  at router (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:34:12)
  at Layer.handle [as handle_request] (/root/idlebot/src/modules/idle/node_modules/express/lib/router/layer.js:82:5)
  at trim_prefix (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:270:13)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:237:9
  at Function.proto.process_params (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:312:12)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:228:12
  at Function.match_layer (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:295:3)
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:189:10)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:559:15
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:186:14)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:191:16
  at Function.match_layer (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:295:3)
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:189:10)
  at Function.proto.handle (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:165:3)
  at router (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:34:12)
  at Layer.handle [as handle_request] (/root/idlebot/src/modules/idle/node_modules/express/lib/router/layer.js:82:5)
  at trim_prefix (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:270:13)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:237:9
  at Function.proto.process_params (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:312:12)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:228:12
  at Function.match_layer (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:295:3)
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:189:10)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:559:15
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:186:14)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:191:16
  at Function.match_layer (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:295:3)
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:189:10)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:191:16
  at Function.match_layer (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:295:3)
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:189:10)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:191:16
  at Function.match_layer (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:295:3)
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:189:10)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:191:16
  at Function.match_layer (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:295:3)
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:189:10)
  at Function.proto.handle (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:165:3)
  at router (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:34:12)
  at Layer.handle [as handle_request] (/root/idlebot/src/modules/idle/node_modules/express/lib/router/layer.js:82:5)
  at trim_prefix (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:270:13)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:237:9
  at Function.proto.process_params (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:312:12)
  at /root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:228:12
  at Function.match_layer (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:295:3)
  at next (/root/idlebot/src/modules/idle/node_modules/express/lib/router/index.js:189:10)
  at /root/idlebot/src/modules/idle/node_modules/body-parser/lib/read.js:107:5
  at IncomingMessage.onEnd (/root/idlebot/src/modules/idle/node_modules/body-parser/node_modules/raw-body/index.js:136:7)
  at IncomingMessage.g (events.js:199:16)
  at IncomingMessage.EventEmitter.emit (events.js:104:17)
  at _stream_readable.js:898:16
  at process._tickCallback (node.js:343:11)
@Magnitus-
Copy link

This is quite the stack trace.

I'd venture to guess that the cause of your exception would be a lack of proper error checking when getting a collection from the database to make sure that no error occurred during the fetching.

Basically, you experienced some kind of database failure and the library you were using did not safeguard against it to handle that gracefully.

If I decide to use express-brute, I'll take a good look at the code and see if I can spot where it could have occurred.

@jfromaniello
Copy link
Member

Cannot read property 'findOne' of undefined

Is not a db failure,this library expect a collection object but instead he passed undefined. I should do a better handling of this and throw a more descriptive error

@Magnitus-
Copy link

Thanks for the feedback.

I should be more rigorous with bad input handling from programmers in my libraries as well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants