bipio-server / bipio

The bip.io API Server
https://bip.io
Apache License 2.0
873 stars 117 forks source link

Caught exception: TypeError: Cannot read property 'length' of undefined (mongoose) #49

Closed fnkr closed 9 years ago

fnkr commented 9 years ago

If I start bipio I get the following error (many, many times):

info: WORKER:PID:5231:1429204371283:Caught exception: TypeError: Cannot read property 'length' of undefined
TypeError: Cannot read property 'length' of undefined
    at processResults (/home/bipio/node_modules/bipio/node_modules/mongoose/node_modules/mongodb/lib/mongodb/db.js:1581:31)
    at /home/bipio/node_modules/bipio/node_modules/mongoose/node_modules/mongodb/lib/mongodb/db.js:1619:20
    at /home/bipio/node_modules/bipio/node_modules/mongoose/node_modules/mongodb/lib/mongodb/db.js:1157:7
    at /home/bipio/node_modules/bipio/node_modules/mongoose/node_modules/mongodb/lib/mongodb/db.js:1890:9
    at Server.Base._callHandler (/home/bipio/node_modules/bipio/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/base.js:448:41)
    at /home/bipio/node_modules/bipio/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:481:18
    at MongoReply.parseBody (/home/bipio/node_modules/bipio/node_modules/mongoose/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5)
    at null.<anonymous> (/home/bipio/node_modules/bipio/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:439:20)
    at emit (events.js:95:17)
    at null.<anonymous> (/home/bipio/node_modules/bipio/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:201:13)
$ mongo --version
MongoDB shell version: 3.0.2
mjpearson commented 9 years ago

Hi, this hasn't been tested with mongo 3 yet and the mongoose driver has been pinned to v3.9.7. Updated install docs until this dependency gets upgraded. Downgrading mongo to v2.6, if possible, should solve the issue for now. Sorry for the inconvenience.

fnkr commented 9 years ago

It would make sense to leave this ticket open or create a second ticket "mongodb 3 support", right?

mjpearson commented 9 years ago

yep, we're tracking it in Jira for a 0.4 server version, but will leave it re-opened here.

linking https://github.com/bipio-server/bipio/issues/6

mjpearson commented 9 years ago

mongoose has been tested for mongo 3 and looks ok. Fix pushed in newest server version 0.3.44. Let me know of any issues

fnkr commented 9 years ago

Still doenst work for me, npm install failed. :(

npm-debug.log

mjpearson commented 9 years ago

Thanks for the log. We weren't able to reproduce this error.

Was node_modules removed completely before running npm install, and is mongodb version 3.0 or above?

fnkr commented 9 years ago

I created a seperate user for bipio and deleted the directories ~/.node-gyp, ~/.npm and the bipio git checkout before reinstalling. I use mongodb v3.0.2.