Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot call method 'insert' of null #9

Open
cadofa opened this issue Jun 17, 2014 · 1 comment
Open

TypeError: Cannot call method 'insert' of null #9

cadofa opened this issue Jun 17, 2014 · 1 comment

Comments

@cadofa
Copy link

cadofa commented Jun 17, 2014

I'm pretty new to nodejs and have a trouble with it.
I use statsd to collect statistics and then send them to mongodb server for store,
but when i send the statsd's timer data to mongodb, i came across this problem.

/home/cadofa/node_modules/mongo-statsd-
backend/node_modules/mongodb/lib/mongodb/connection/base.js:245
        throw message;      
              ^
TypeError: Cannot call method 'insert' of null
    at /home/cadofa/node_modules/mongo-statsd-backend/lib/index.js:161:15
    at /home/cadofa/node_modules/mongo-statsd-
    backend/node_modules/mongodb/lib/mongodb/db.js:1011:22
    at /home/cadofa/node_modules/mongo-statsd-
    backend/node_modules/mongodb/lib/mongodb/db.js:1130:16
    at /home/cadofa/node_modules/mongo-statsd-
    backend/node_modules/mongodb/lib/mongodb/db.js:1846:9
    at Server.Base._callHandler (/home/cadofa/node_modules/mongo-statsd-
    backend/node_modules/mongodb/lib/mongodb/connection/base.js:445:41)
    at /home/cadofa/node_modules/mongo-statsd-
    backend/node_modules/mongodb/lib/mongodb/connection/server.js:478:18
    at MongoReply.parseBody (/home/cadofa/node_modules/mongo-statsd-
    backend/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5)
    at null.<anonymous> (/home/cadofa/node_modules/mongo-statsd-
    backend/node_modules/mongodb/lib/mongodb/connection/server.js:436:20)
    at EventEmitter.emit (events.js:95:17)
    at null.<anonymous> (/home/cadofa/node_modules/mongo-statsd-
    backend/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:201:13)

Anyone who can tell me how to solve the problem, thanks very much!

@rposbo
Copy link

rposbo commented Aug 22, 2014

This is fixed in this pull request: https://github.com/dynmeth/mongo-statsd-backend/pull/8/files

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

No branches or pull requests

2 participants