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

CastError: Cast to number failed for value "NaN" at path "supply" #350

Closed
lubhub612 opened this issue Feb 14, 2020 · 5 comments
Closed

CastError: Cast to number failed for value "NaN" at path "supply" #350

lubhub612 opened this issue Feb 14, 2020 · 5 comments

Comments

@lubhub612
Copy link

Error during Stats Update: { CastError: Cast to number failed for value "NaN" at path "supply"
at new CastError (/root/es/explorer/node_modules/mongoose/lib/error/cast.js:29:11)
at SchemaNumber.cast (/root/es/explorer/node_modules/mongoose/lib/schema/number.js:315:11)
at SchemaNumber.SchemaType.applySetters (/root/es/explorer/node_modules/mongoose/lib/schematype.js:969:12)
at SchemaNumber.SchemaType._castForQuery (/root/es/explorer/node_modules/mongoose/lib/schematype.js:1383:15)
at SchemaNumber.castForQuery (/root/es/explorer/node_modules/mongoose/lib/schema/number.js:367:14)
at SchemaNumber.SchemaType.castForQueryWrapper (/root/es/explorer/node_modules/mongoose/lib/schematype.js:1352:15)
at castUpdateVal (/root/es/explorer/node_modules/mongoose/lib/helpers/query/castUpdate.js:463:19)
at walkUpdatePath (/root/es/explorer/node_modules/mongoose/lib/helpers/query/castUpdate.js:290:22)
at castUpdate (/root/es/explorer/node_modules/mongoose/lib/helpers/query/castUpdate.js:81:18)
at model.Query._castUpdate (/root/es/explorer/node_modules/mongoose/lib/query.js:4442:10)
at castDoc (/root/es/explorer/node_modules/mongoose/lib/query.js:4470:18)
at model.Query.Query._findAndModify (/root/es/explorer/node_modules/mongoose/lib/query.js:3448:22)
at model.Query. (/root/es/explorer/node_modules/mongoose/lib/query.js:3001:8)
at model.Query._wrappedThunk [as _findOneAndUpdate] (/root/es/explorer/node_modules/mongoose/lib/helpers/query/wrapThunk.js:16:8)
at process.nextTick (/root/es/explorer/node_modules/kareem/index.js:369:33)
at process._tickCallback (internal/process/next_tick.js:61:11)
message: 'Cast to number failed for value "NaN" at path "supply"',
name: 'CastError',
stringValue: '"NaN"',
kind: 'number',
value: NaN,
path: 'supply',
reason: undefined }
events.js:174
throw er; // Unhandled 'error' event
^

TypeError: Cannot read property 'last' of undefined
at /root/es/explorer/lib/database.js:771:31
at /root/es/explorer/node_modules/mongoose/lib/model.js:4599:16
at model.Query.Query._findAndModify (/root/es/explorer/node_modules/mongoose/lib/query.js:3461:16)
at model.Query. (/root/es/explorer/node_modules/mongoose/lib/query.js:3001:8)
at model.Query._wrappedThunk [as _findOneAndUpdate] (/root/es/explorer/node_modules/mongoose/lib/helpers/query/wrapThunk.js:16:8)
at process.nextTick (/root/es/explorer/node_modules/kareem/index.js:369:33)
at process._tickCallback (internal/process/next_tick.js:61:11)
Emitted 'error' event at:
at /root/es/explorer/node_modules/mongoose/lib/model.js:4601:13
at model.Query.Query._findAndModify (/root/es/explorer/node_modules/mongoose/lib/query.js:3461:16)
[... lines matching original stack trace ...]
at process._tickCallback (internal/process/next_tick.js:61:11)

I facing this issue , any sugestions

@SIM128
Copy link

SIM128 commented Feb 21, 2020

Hi lubhub612,

I've had the same issue. After some debugging, I've found a solution.

change line 17 in the lib/explorer.js file to: return cb(0);

@uaktags
Copy link
Collaborator

uaktags commented Feb 21, 2020

I like this correction. Not sure why it wouldn't be there in the first place.

@emarkproject
Copy link

I've had the same issue. After change line 17 in the lib/explorer.js file to:
return cb(0);
there is a new error:
~/explorer$ node scripts/sync.js index update
script launched with pid: 31339
/home/rumhocker/explorer/lib/explorer.js:582
module.exports.syncLoop(tx.vin.length, function (loop) {
^

TypeError: Cannot read property 'length' of undefined
at Object.prepare_vin (/home/rumhocker/explorer/lib/explorer.js:582:36)
at /home/rumhocker/explorer/lib/database.js:128:11
at Request._callback (/home/rumhocker/explorer/lib/explorer.js:212:16)
at Request.self.callback (/home/rumhocker/explorer/node_modules/request/request.js:185:22)
at Request.emit (events.js:311:20)
at Request. (/home/rumhocker/explorer/node_modules/request/request.js:1154:10)
at Request.emit (events.js:311:20)
at IncomingMessage. (/home/rumhocker/explorer/node_modules/request/request.js:1076:12)
at Object.onceWrapper (events.js:417:28)
at IncomingMessage.emit (events.js:323:22)
at endReadableNT (_stream_readable.js:1204:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21)

i use mongodb 4.2.3
Is there anyone with an idea?

@uaktags
Copy link
Collaborator

uaktags commented Mar 4, 2020 via email

@TheHolyRoger
Copy link
Collaborator

Dup of #56

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

5 participants