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 read properties of undefined (reading 'electionId') during service startup #1257

Open
qtomlinson opened this issue Dec 13, 2024 · 2 comments

Comments

@qtomlinson
Copy link
Collaborator

qtomlinson commented Dec 13, 2024

During service startup, "TypeError: Cannot read properties of undefined (reading 'electionId')" is observed while connecting to DB.

2024-12-12T19:19:48.9569976Z TypeError: Cannot read properties of undefined (reading 'electionId')
2024-12-12T19:19:48.9570006Z     at ReplSetState.update (/opt/service/node_modules/mongodb-core/lib/topologies/replset_state.js:464:71)
2024-12-12T19:19:48.9570035Z     at /opt/service/node_modules/mongodb-core/lib/topologies/replset.js:318:47
2024-12-12T19:19:48.9570069Z     at applyAuth (/opt/service/node_modules/mongodb-core/lib/topologies/replset.js:745:43)
2024-12-12T19:19:48.9570098Z     at /opt/service/node_modules/mongodb-core/lib/topologies/replset.js:752:7
2024-12-12T19:19:48.9570147Z     at /opt/service/node_modules/mongodb-core/lib/connection/pool.js:869:7
2024-12-12T19:19:48.9570176Z     at /opt/service/node_modules/mongodb-core/lib/connection/pool.js:847:11
2024-12-12T19:19:48.9570205Z     at finish (/opt/service/node_modules/mongodb-core/lib/auth/scram.js:229:16)
2024-12-12T19:19:48.9570235Z     at handleEnd (/opt/service/node_modules/mongodb-core/lib/auth/scram.js:243:7)
2024-12-12T19:19:48.9570262Z     at /opt/service/node_modules/mongodb-core/lib/auth/scram.js:348:19
2024-12-12T19:19:48.9570291Z     at /opt/service/node_modules/mongodb-core/lib/connection/pool.js:532:18

Details see attached exception details

@qtomlinson
Copy link
Collaborator Author

qtomlinson commented Dec 13, 2024

This StackExchange suggests "removing the &replicaSet=globaldb from the connection string if you are not using a replica set and only have a single Cosmos DB instance." A similar issue could be found at MongoError: Pool Destroyed, which seemed to be also resolved by the connection string change.
MongoError: pool destroyed at Pool.write was also logged in dev deployment at between 2024-12-12T19:49:10.939Z and 2024-12-12T19:49:14.066Z

@qtomlinson
Copy link
Collaborator Author

@elrayle Thanks for putting in the fix!

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

1 participant