Search code examples
node.jsnode-inspectorcountly-analytics

node-inspector cannot connect to running nodes on debian


I have been unable to get node-inspector web page url to show the sources of nodes source codes.

here is how I start countly nodes:

root@mitendebian:/opt/software/countly# service supervisor start
Starting supervisor: --nodaemon --configuration /opt/software/countly/bin/config/supervisord.conf2014-08-07 18:07:52,036 CRIT Set uid to user 0
2014-08-07 18:07:52,061 INFO RPC interface 'supervisor' initialized
2014-08-07 18:07:52,061 WARN cElementTree not installed, using slower XML parser for XML-RPC
2014-08-07 18:07:52,061 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2014-08-07 18:07:52,066 INFO supervisord started with pid 6332
2014-08-07 18:07:53,070 INFO spawned: 'countly-dashboard' with pid 6333
2014-08-07 18:07:53,071 INFO spawned: 'countly-api' with pid 6334
2014-08-07 18:07:53,093 DEBG 'countly-api' stdout output:
debugger listening on port 8087

2014-08-07 18:07:53,102 DEBG 'countly-dashboard' stdout output:
debugger listening on port 8086

2014-08-07 18:07:54,103 INFO success: countly-dashboard entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2014-08-07 18:07:54,103 INFO success: countly-api entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2014-08-07 18:29:40,526 DEBG fd 7 closed, stopped monitoring <POutputDispatcher at 170156780 for <Subprocess at 170010188 with name countly-dashboard in state RUNNING> (stdout)>
2014-08-07 18:29:40,528 INFO exited: countly-dashboard (terminated by SIGUSR1; not expected)
2014-08-07 18:29:40,529 DEBG received SIGCLD indicating a child quit
2014-08-07 18:29:41,532 INFO spawned: 'countly-dashboard' with pid 6528
2014-08-07 18:29:41,585 DEBG 'countly-dashboard' stdout output:
debugger listening on port 8086

2014-08-07 18:29:42,585 INFO success: countly-dashboard entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2014-08-07 18:29:43,060 DEBG fd 10 closed, stopped monitoring <POutputDispatcher at 170225580 for <Subprocess at 170010252 with name countly-api in state RUNNING> (stdout)>
2014-08-07 18:29:43,061 INFO exited: countly-api (terminated by SIGUSR1; not expected)
2014-08-07 18:29:43,061 DEBG received SIGCLD indicating a child quit
2014-08-07 18:29:44,064 INFO spawned: 'countly-api' with pid 6536
2014-08-07 18:29:44,069 DEBG 'countly-api' stdout output:
debugger listening on port 8087

2014-08-07 18:29:45,071 INFO success: countly-api entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

Then I start node-inspector:

root@mitendebian:/opt/software/countly/bin# Node Inspector v0.7.4
Visit http://localhost:8080/debug?port=5858 to start debugging.

root@mitendebian:/opt/software/countly/bin# ps -ef | grep node
root      6333  6332  0 18:07 pts/6    00:00:00 node --debug=8086 /opt/software/countly/bin/config/../../frontend/express/app.js
root      6334  6332  0 18:07 pts/6    00:00:00 node --debug=8087 /opt/software/countly/bin/config/../../api/api.js
root      6382  5518  0 18:12 pts/5    00:00:00 node /usr/local/bin/node-inspector
root      6527  5518  0 18:29 pts/5    00:00:00 grep node

root@mitendebian:/opt/software/countly/bin# kill -s USR1 6333
root@mitendebian:/opt/software/countly/bin# kill -s USR1 6334

root@mitendebian:/opt/software/countly/bin# ps -ef | grep node
root      6382  5518  0 18:12 pts/5    00:00:00 node /usr/local/bin/node-inspector
root      6528  6332 14 18:29 pts/6    00:00:00 node --debug=8086 /opt/software/countly/bin/config/../../frontend/express/app.js
root      6536  6332 18 18:29 pts/6    00:00:00 node --debug=8087 /opt/software/countly/bin/config/../../api/api.js
root      6544  5518  0 18:29 pts/5    00:00:00 grep node

root@mitendebian:/opt/software/countly/api# node --version
v0.10.29


root@mitendebian:/opt/software# npm -g ls
/usr/local/lib
├─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └─┬ [email protected]
│ │ │   ├── [email protected]
│ │ │   ├── [email protected]
│ │ │   └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ └─┬ [email protected]
│ │   ├── [email protected]
│ │   └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ └─┬ [email protected]
│   └── [email protected]

As per info on net I read when I visit the http://mylocalhost.com:8080/debug?port=5858 it should have shown me sources. I do not see them. I replaced 127 numeric ip address with mylocalhost.com since stackoverflow was giving some error.


Solution

  • Notice that you're telling node-inspector to connect on port 5858, but your applications aren't exposing the debugger on that port.