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

0x not working with Mongoose package whereas Forever is working perfectly fine. #118

Closed
sudhanshugaur4 opened this issue Apr 8, 2018 · 11 comments

Comments

@sudhanshugaur4
Copy link

I don't know why this is happening but previously i was using Forever module with the command forever start app.js to run my node.js app but now as i am using 0x the command i wrote is 0x app.js, now in logs bellow error is printing

{ MongoError: failed to connect to server [XX.XXX.X.X:27017] on first connect [MongoError: connection 0 to XX.XXX.X.X:27017 timed out]
    at Pool.<anonymous> (/home/projects/kj_app/node_modules/mongodb-core/lib/topologies/server.js:336:35)
    at Pool.emit (events.js:180:13)
    at Connection.<anonymous> (/home/projects/kj_app/node_modules/mongodb-core/lib/connection/pool.js:280:12)
    at Object.onceWrapper (events.js:272:13)
    at Connection.emit (events.js:180:13)
    at Socket.<anonymous> (/home/projects/kj_app/node_modules/mongodb-core/lib/connection/connection.js:197:10)
    at Object.onceWrapper (events.js:272:13)
    at Socket.emit (events.js:180:13)
    at Socket._onTimeout (net.js:393:8)
    at ontimeout (timers.js:466:11)
    at tryOnTimeout (timers.js:304:5)
    at Timer.listOnTimeout (timers.js:267:5)
  name: 'MongoError',

But the thing is when using Forever i am not getting this error and everything is working perfectly fine.

@davidmarkclements
Copy link
Owner

What if you directly with node?

@sudhanshugaur4
Copy link
Author

Yes it is working perfectly fine for both node app.js and for forever start app.js

@sudhanshugaur4
Copy link
Author

Also when i exit the profiling by pressing Ctrl+C then i get below error but flamegraph.html get successfully created.

🔥  Process exited, generating flamegraphevalmachine.<anonymous>:2784
  printErr(str);
  ^
ReferenceError: printErr is not defined
    at TickProcessor.printError (evalmachine.<anonymous>:2784:3)
    at TickProcessor.LogReader.processLog_ (evalmachine.<anonymous>:2536:12)
    at TickProcessor.LogReader.processLogLine (evalmachine.<anonymous>:2419:10)
    at TickProcessor.processLogFile (evalmachine.<anonymous>:2812:10)
    at evalmachine.<anonymous>:3994:15
    at internal/v8_prof_processor.js:41:28
    at NativeModule.compile (bootstrap_node.js:654:7)
    at Function.NativeModule.require (bootstrap_node.js:599:18)
    at startup (bootstrap_node.js:140:20)
    at bootstrap_node.js:666:3
🔥  Flamegraph generated in
file:///home/projects/app/10182.0x/flamegraph.html

@mcollina
Copy link
Collaborator

mcollina commented Apr 9, 2018

@sudhanshugaur4 which version of Node.js are you using?
Can you please upload an example that exhibit this behavior?

@davidmarkclements
Copy link
Owner

Yeah that second error is definitely node version related

@sudhanshugaur4
Copy link
Author

Node version is v9.8.0.

@davidmarkclements
Copy link
Owner

davidmarkclements commented Apr 9, 2018 via email

@sudhanshugaur4
Copy link
Author

sudhanshugaur4 commented Apr 9, 2018

Ok Let me try any Nodejs 8.X.X version, also Even numbers you mean this only for NodeJs or for all other npm packages, never heard about it.

@davidmarkclements
Copy link
Owner

davidmarkclements commented Apr 9, 2018

Only Node, even numbers are "active" odd numbers are "current" which in this context means new features lands on this line, and stay there for at least two weeks before they are backported. Odd numbers then disappear after a new even major – so when Node 10 is released, the Node 9 line will disappear
see https://github.com/nodejs/Release

@sudhanshugaur4
Copy link
Author

Hii actually I have two version of node installed on my system one is local and second is bitnami's version provided by default, Can you please tell me how can I pass node version in this command sudo 0x app.js.

@davidmarkclements
Copy link
Owner

davidmarkclements commented Apr 10, 2018 via email

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