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

Explorer start error #398

Closed
gdiscord opened this issue Jul 23, 2020 · 19 comments
Closed

Explorer start error #398

gdiscord opened this issue Jul 23, 2020 · 19 comments

Comments

@gdiscord
Copy link

Trying to run the explorer and getting the error below after issue npm start
Advise to get it resolved would be appreciated.

System: Ubuntu 16.04
Nodejs: v14.6.0
nom: 6.14.6
mongoDB: 4.2 (Current)

=======
internal/fs/utils.js:701
throw new ERR_INVALID_ARG_TYPE(
^

TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received type number (22371)
at Object.writeFile (fs.js:1385:5)
at Object. (/home/blkexpuser/explorer/bin/cluster:5:6)
at Module._compile (internal/modules/cjs/loader.js:1236:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1257:10)
at Module.load (internal/modules/cjs/loader.js:1085:32)
at Function.Module._load (internal/modules/cjs/loader.js:950:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47 {
code: 'ERR_INVALID_ARG_TYPE'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: node --stack-size=10000 ./bin/cluster
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.

@uaktags
Copy link
Collaborator

uaktags commented Jul 23, 2020

fs.writeFile('./tmp/cluster.pid', process.pid, function (err) {

strange that its failing on this line. Claiming it can't write a number format and that it needs to be a string. I wonder if this is a more strict enforcement by the newer node versions.

@TheHolyRoger
Copy link
Collaborator

Yeah that's probably the issue, @gdiscord can you try with node 12.14?

@uaktags
Copy link
Collaborator

uaktags commented Jul 23, 2020

We may just have to do a tostring for that. All we need it for is to input the processid so shouldn't have any residual effect.

@gdiscord
Copy link
Author

Yeah that's probably the issue, @gdiscord can you try with node 12.14?

sure, will do that in some hours from now and report back.

@gdiscord
Copy link
Author

Yeah that's probably the issue, @gdiscord can you try with node 12.14?

sure, will do that in some hours from now and report back.

Indeed can confirm the error has gone away after removing Nodejs: v14.6.0 and installing Nodejs: v12.x instead.

@gdiscord
Copy link
Author

Now the error changes to the below. The output is too long so picked the top 13 lines.
My system setup is the same as before, with node v12.18.3 (could not get the exact 12.4 version with the install).

initial markets entry created for bittrex
OperationalError: no auth mechanism defined
at Auth.onRequest (/home/explorer/node_modules/request/lib/auth.js:132:32)
at Request.auth (/home/explorer/node_modules/request/request.js:1341:14)
at Request.init (/home/explorer/node_modules/request/request.js:378:10)
at new Request (/home/explorer/node_modules/request/request.js:127:8)
at request (/home/explorer/node_modules/request/index.js:53:10)
at /home/explorer/node_modules/request/index.js:61:12
at Object.apply (/home/explorer/node_modules/@uphold/request-logger/src/index.js:27:19)
at Function.post (/home/explorer/node_modules/request/index.js:100:12)
at Function.tryCatcher (/home/explorer/node_modules/bluebird/js/release/util.js:16:23)
at Function.ret [as postAsync] (eval at makeNodePromisifiedEval (/home/explorer/node_modules/bluebird/js/release/promisify.js:184:12), :12:23)

@TheHolyRoger
Copy link
Collaborator

Try this: #385

@TheHolyRoger
Copy link
Collaborator

@gdiscord
Copy link
Author

Try this: #385

Tried it now, but made no difference. I make sure username, password and port match exactly what is in the coin.conf file.

// wallet settings
"wallet": {
"host": "localhost",
"port": 9467,
"user": "username",
"pass": "password"
},

@gdiscord
Copy link
Author

Modified it to
// wallet settings
"wallet": {
"host": "localhost",
"port": 9467,
"username": "username",
"password": "password"
},

then the error below is the result:

__Starting cluster with pid: 12967
OperationalError: socket hang up
at connResetException (internal/errors.js:610:14)
at Socket.socketOnEnd (_http_client.js:453:23)
at Socket.emit (events.js:327:22)
at endReadableNT (_stream_readable.js:1220:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
cause: Error: socket hang up
at connResetException (internal/errors.js:610:14)
at Socket.socketOnEnd (http_client.js:453:23)
at Socket.emit (events.js:327:22)
at endReadableNT (stream_readable.js:1220:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
code: 'ECONNRESET'
},

isOperational: true,
code: 'ECONNRESET'
}
GET /api/getpeerinfo 200 43.565 ms - 39

@TheHolyRoger
Copy link
Collaborator

@gdiscord you are actually supplying the username and password you set in your coin Daemon .conf file correct? You're not leaving "username" and "password" in the settings file like that right? ;)

@gdiscord
Copy link
Author

Yes, as said in one of my posts above, made sure the coin.conf values match what's in the settings.json file

so in the coin.conf file there is
rpcuser=username
rpcpassword=password

then in the settings.json there is:
// wallet settings
"wallet": {
"host": "localhost",
"port": 9467,
"user": "username",
"pass": "password"

},

Also tried changing the settings.json name/value pairs to
// wallet settings
"wallet": {
"host": "localhost",
"port": 9467,
"username": "username",
"password": "password"

},

but the issue still remains.

@gdiscord
Copy link
Author

Issue solved now.
It was due to rpcport missing from coin.conf file.

made a comment also in #385

@gdiscord
Copy link
Author

New error when trying to upload the database:

Error during Stats Update: MongooseError [CastError]: Cast to number failed for value "There was an error. Check your console." at path "connections"
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 /home/explorer/node_modules/kareem/index.js:369:33

@gdiscord
Copy link
Author

events.js:292
throw er; // Unhandled 'error' event
^

TypeError: Cannot read property 'last' of undefined
at /home/explorer/lib/database.js:708: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 /home/explorer/node_modules/kareem/index.js:369:33
at processTicksAndRejections (internal/process/task_queues.js:79:11)
Emitted 'error' event on Function instance at:
at /home/explorer/node_modules/mongoose/lib/model.js:4601:13
at model.Query.Query._findAndModify (/home/explorer/node_modules/mongoose/lib/query.js:3461:16)
[... lines matching original stack trace ...]
at processTicksAndRejections (internal/process/task_queues.js:79:11)

@gdiscord
Copy link
Author

Issue resolved with details in #350

@TheHolyRoger
Copy link
Collaborator

Thanks @gdiscord was it these two fixes? 9692ab9

If you've had to make any other code changes please let us know so that we can add to master.
Thanks!

@gdiscord
Copy link
Author

Thanks @gdiscord was it these two fixes? 9692ab9

If you've had to make any other code changes please let us know so that we can add to master.
Thanks!

it was only the change in lib/explorer.js that fixed it. No other code change was made.
thanks.

@TheHolyRoger
Copy link
Collaborator

Brilliant thanks 👍

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

3 participants