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

Error during Stats Update: { CastError: Cast to number failed for value "NaN" at path "supply" #369

Closed
TrexcoinTREX opened this issue Apr 12, 2020 · 4 comments

Comments

@TrexcoinTREX
Copy link

### Hello Any one Please solve this issue ?

root@Testcoin_Explorer:/home/explorer# sudo node scripts/sync.js index update
script launched with pid: 2631
Error during Stats Update: { CastError: Cast to number failed for value "NaN" at path "supply"
at new CastError (/home/explorer/node_modules/mongoose/lib/error/cast.js:29:11)
at SchemaNumber.cast (/home/explorer/node_modules/mongoose/lib/schema/number.js:315:11)
at SchemaNumber.SchemaType.applySetters (/home/explorer/node_modules/mongoose/lib/schematype.js:969:12)
at SchemaNumber.SchemaType._castForQuery (/home/explorer/node_modules/mongoose/lib/schematype.js:1383:15)
at SchemaNumber.castForQuery (/home/explorer/node_modules/mongoose/lib/schema/number.js:367:14)
at SchemaNumber.SchemaType.castForQueryWrapper (/home/explorer/node_modules/mongoose/lib/schematype.js:1352:15)
at castUpdateVal (/home/explorer/node_modules/mongoose/lib/helpers/query/castUpdate.js:463:19)
at walkUpdatePath (/home/explorer/node_modules/mongoose/lib/helpers/query/castUpdate.js:290:22)
at castUpdate (/home/explorer/node_modules/mongoose/lib/helpers/query/castUpdate.js:81:18)
at model.Query._castUpdate (/home/explorer/node_modules/mongoose/lib/query.js:4442:10)
at castDoc (/home/explorer/node_modules/mongoose/lib/query.js:4470:18)
at model.Query.Query._findAndModify (/home/explorer/node_modules/mongoose/lib/query.js:3448:22)
at model.Query. (/home/explorer/node_modules/mongoose/lib/query.js:3001:8)
at model.Query._wrappedThunk [as _findOneAndUpdate] (/home/explorer/node_modules/mongoose/lib/helpers/query/wrapThunk.js:16:8)
at process.nextTick (/home/explorer/node_modules/kareem/index.js:369:33)
at _combinedTickCallback (internal/process/next_tick.js:132:7)
at process._tickCallback (internal/process/next_tick.js:181:9)
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:183
throw er; // Unhandled 'error' event
^

TypeError: Cannot read property 'last' of undefined
at /home/explorer/lib/database.js:771:31
at /home/explorer/node_modules/mongoose/lib/model.js:4599:16
at model.Query.Query._findAndModify (/home/explorer/node_modules/mongoose/lib/query.js:3461:16)
at model.Query. (/home/explorer/node_modules/mongoose/lib/query.js:3001:8)
at model.Query._wrappedThunk [as _findOneAndUpdate] (/home/explorer/node_modules/mongoose/lib/helpers/query/wrapThunk.js:16:8)
at process.nextTick (/home/explorer/node_modules/kareem/index.js:369:33)
at _combinedTickCallback (internal/process/next_tick.js:132:7)
at process._tickCallback (internal/process/next_tick.js:181:9)
root@Testcoin_Explorer:/home/explorer#

error

@uaktags
Copy link
Collaborator

uaktags commented Apr 12, 2020

It won't fix this, but please don't sudo the scripts. There's nothing about them that need root access.

So it looks like either your coin.stats database has NaN written, in which is replace it with 0 and see if that fixes you.

Otherwise, I'm guessing the issue is something is wrong with getting the count from your coind. Try changing to getinfo.

@TrexcoinTREX
Copy link
Author

where i replace 0?? and where i change getinfo ??

@uaktags
Copy link
Collaborator

uaktags commented Apr 12, 2020 via email

@gogoX1
Copy link

gogoX1 commented Apr 15, 2020

#350 (comment) works for me thx

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

4 participants