-
Type: Bug
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: 2.0.33
-
Component/s: None
-
Environment:CentOS 7 x64,. node v0.12.2, mongodb server version v3.0.2
-
Empty show more show less
Getting an uncaught exception TypeError with stack trace below on server startup. The code in our application triggering the exception is:
mongoDb.collection(collName,
{w:mongo.writeConcern, strict:true}, function (err, existingColl) {
The stack trace we see is:
TypeError: Cannot read property 'maxWriteBatchSize' of null
at new ServerCapabilities
(/redacted/node_modules/mongodb/lib/topology_base.js:98
:40)
at Server.capabilities
(/redacted/node_modules/mongodb/lib/server.js:300:26)
at Db.listCollections
(/redacted/node_modules/mongodb/lib/db.js:477:24)
at Db.collection
(/redacted/node_modules/mongodb/lib/db.js:356:8)
at create_storage_collection
(/redacted/common/session_store/lib/veh_session_
store.js:384:13)
at
/redacted/common/session_store/lib/veh_session_s
tore.js:91:17
at Object.getDb
(/redacted/common/session_store/lib/mongodb.js:1
4:9)
at Object.init
(/redacted/common/session_store/lib/veh_session_
store.js:86:15)
at
/redacted/server/client_server/lib/client_server
_main.js:42:30
at
/redacted/server/mpulse_db_api/lib/mpulse_db_api
.js:9:9
at Object.get_sql_client
(/redacted/common/server_utils/lib/sql_util.js:2
0:9)
at Object.init
(/redacted/server/mpulse_db_api/lib/mpulse_db_ap
i.js:6:17)
at
/redacted/server/client_server/lib/client_server
_main.js:41:38
at
/redacted/server/template_db_api/lib/template_db
_api.js:15:9
at Object.get_sql_client_ro
(/redacted/common/server_utils/lib/sql_util.js:4
3:9)
at Object.init
(/redacted/server/template_db_api/lib/template_d
b_api.js:13:17)
at
/redacted/server/client_server/lib/client_server
_main.js:40:36
at
/redacted/server/vehI18N_support/lib/label_db_ap
i.js:9:9
at Object.get_sql_client_ro
(/redacted/common/server_utils/lib/sql_util.js:3
5:13)
at Object.init
(/redacted/server/vehI18N_support/lib/label_db_a
pi.js:6:17)
at Object.init
(/redacted/server/vehI18N_support/lib/translate_
json.js:5:16)
at
/redacted/server/client_server/lib/client_server
_main.js:39:32
at
/redacted/server/history_db_api/lib/history_db_a
pi.js:8:9
at Object.get_sql_client
(/redacted/common/server_utils/lib/sql_util.js:1
8:9)
at Object.init
(/redacted/server/history_db_api/lib/history_db_
api.js:6:17)
at Object.<anonymous>
(/redacted/server/client_server/lib/client_serve
r_main.js:38:27)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
We see this once but otherwise things continue working. I looked briefly into the code and it looks like the internal topology state is not yet established when this happens, thus it seems like a startup race condition. We see this consistently in our integration test environment but not in our local development environment. We were previously running node-mongodb-native v2.0.28 and did not see this issue.