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

Cannot read property 'info' of null #808

Closed
wants to merge 3 commits into from

Conversation

thesmart
Copy link

When piping a CursorStream, I get the following error after about 10K documents:

/home/deploy/test/node-EmailBlast/node_modules/mongodb/lib/mongodb/connection/server.js:484
        throw err;
              ^
TypeError: Cannot read property 'info' of null
    at [object Object].<anonymous> (/home/deploy/test/node-EmailBlast/node_modules/mongodb/lib/mongodb/connection/server.js:336:93)
    at [object Object].emit (events.js:67:17)
    at [object Object].<anonymous> (/home/deploy/test/node-EmailBlast/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:140:13)
    at [object Object].emit (events.js:70:17)
    at Socket.<anonymous> (/home/deploy/test/node-EmailBlast/node_modules/mongodb/lib/mongodb/connection/connection.js:238:18)
    at Socket.emit (events.js:67:17)
    at TCP.onread (net.js:367:14)

This is the offending block of code in server.js starting @ line 322:

        // Locate a callback instance and remove any additional ones
        for(var i = 0; i < server.dbInstances.length; i++) {
          var dbInstanceObjectTemp = server.dbInstances[i];
          var hasHandler = dbInstanceObjectTemp._hasHandler(mongoReply.responseTo.toString());
          // Assign the first one we find and remove any duplicate ones
          if(hasHandler && callbackInfo == null) {
            callbackInfo = dbInstanceObjectTemp._findHandler(mongoReply.responseTo.toString());
            dbInstanceObject = dbInstanceObjectTemp;
          } else if(hasHandler) {
            dbInstanceObjectTemp._removeHandler(mongoReply.responseTo.toString());
          }
        }

        // The command executed another request, log the handler again under that request id
        if(mongoReply.requestId > 0 && mongoReply.cursorId.toString() != "0" && callbackInfo.info && callbackInfo.info.exhaust) {
          dbInstance._reRegisterHandler(mongoReply.requestId, callbackInfo);
        }

Notice that callbackInfo could be null.

@thesmart
Copy link
Author

Made a branch mistake. Will reopen. I'm WAY too tired to be fucking with this shit.

@thesmart thesmart closed this Dec 15, 2012
christkv added a commit that referenced this pull request Dec 18, 2012
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

Successfully merging this pull request may close these issues.

1 participant