SocketCluster / SocketCluster/socketcluster
Getting error invalid ObjectId, ObjectId.id must be either a string or a Buffer, but is [{"base64":true,"data":"VsWHAZWlq7w7zDEn"}]
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 6.2k
- Forks
- 318
- PR merge metrics
- No merged PRs in 30d
Description
Getting following error after running application:
1527160551492 - Origin: Worker (PID 24814)
[Error] Error: invalid ObjectId, ObjectId.id must be either a string or a Buffer, but is [{"base64":true,"data":"VsWHAZWlq7w7zDEn"}]
at ObjectID.toHexString (/apps/node_app/hendrix_notification/node_modules/mongojs/node_modules/mongodb/node_modules/mongodb-core/node_modules/bson/lib/bson/objectid.js:93:11)
at ObjectID.toJSON (/apps/node_app/hendrix_notification/node_modules/mongojs/node_modules/mongodb/node_modules/mongodb-core/node_modules/bson/lib/bson/objectid.js:208:15)
at Object.stringify (native)
at Object.module.exports.stringify (/apps/node_app/hendrix_notification/node_modules/socketcluster/node_modules/sc-formatter/index.js:77:15)
at EventEmitter.self.write (/apps/node_app/hendrix_notification/node_modules/socketcluster/node_modules/sc-broker-cluster/node_modules/sc-broker/node_modules/ncom/index.js:78:23)
at EventEmitter.self._exec (/apps/node_app/hendrix_notification/node_modules/socketcluster/node_modules/sc-broker-cluster/node_modules/sc-broker/index.js:253:20)
at EventEmitter.self.publish (/apps/node_app/hendrix_notification/node_modules/socketcluster/node_modules/sc-broker-cluster/node_modules/sc-broker/index.js:357:10)
at EventEmitter.self.(anonymous function) [as publish] (/apps/node_app/hendrix_notification/node_modules/socketcluster/node_modules/sc-broker-cluster/clientcluster.js:106:49)
at EventEmitter.Client.publish (/apps/node_app/hendrix_notification/node_modules/socketcluster/node_modules/sc-broker-cluster/index.js:551:30)
at EventEmitter.Exchange.publish (/apps/node_app/hendrix_notification/node_modules/socketcluster/node_modules/sc-broker-cluster/index.js:187:25)
Tried a lot to resolve this but no clue, please help
Due to above error, worker is getting reswapened
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the worker error and trace the ObjectID value through bson's objectid.js, sc-formatter/index.js, and the broker publish path shown in the stack trace. Determine which published payload causes serialization to reject the ObjectId, then verify that publishing it no longer throws or respawns the worker.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, mongodb, nodejs
- Domain
- backend, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100