Reputation: 314
I have express.js
REST API server on Heroku.
I am trying to debug an error remotely. But, I receive below exception. The steps I tried to debug remote server are mentioned after this exception section.
Can someone please help me how can I debug remote node.js/express.js server?
events.js:291
throw er; // Unhandled 'error' event
^
Error: connection not allowed by ruleset
at Parser._onData (/usr/local/Cellar/heroku/7.47.11/lib/client/7.59.1/node_modules/@heroku/socksv5/lib/client.parser.js:122:21)
at Socket.Parser.__onData (/usr/local/Cellar/heroku/7.47.11/lib/client/7.59.1/node_modules/@heroku/socksv5/lib/client.parser.js:33:10)
at Socket.emit (events.js:314:20)
at addChunk (_stream_readable.js:297:12)
at readableAddChunk (_stream_readable.js:272:9)
at Socket.Readable.push (_stream_readable.js:213:10)
at TCP.onStreamRead (internal/stream_base_commons.js:188:23)
Emitted 'error' event on Client instance at:
at Parser.<anonymous> (/usr/local/Cellar/heroku/7.47.11/lib/client/7.59.1/node_modules/@heroku/socksv5/lib/client.js:132:10)
at Parser.emit (events.js:314:20)
at Parser._onData (/usr/local/Cellar/heroku/7.47.11/lib/client/7.59.1/node_modules/@heroku/socksv5/lib/client.parser.js:126:16)
at Socket.Parser.__onData (/usr/local/Cellar/heroku/7.47.11/lib/client/7.59.1/node_modules/@heroku/socksv5/lib/client.parser.js:33:10)
[... lines matching original stack trace ...]
at TCP.onStreamRead (internal/stream_base_commons.js:188:23) {
code: 'EACCES'
}
heroku ps:forward 9229 --app MY_EXPRESS_APP
command.launch.json
configuration. I tried with both the configurations mentioned in it. (I understand I need only one. But I checked other Stackoverflow articles. So, I tried both the suggestions). "configurations": [
{
"address": "TCP/IP address of process to be debugged",
"localRoot": "${workspaceFolder}",
"name": "ONE: Attach to Remote",
"port": 9229,
"remoteRoot": "/app",
"request": "attach",
"skipFiles": [
"<node_internals>/**"
],
"type": "node"
},
{
"type": "node",
"request": "attach",
"name": "TWO: Remote Heroku: Debug Remote Server",
"address": "localhost",
"port": 9229,
"protocol": "inspector",
"localRoot": "${workspaceFolder}",
"remoteRoot": "/app"
}
]
$ heroku ps:forward 9229 --app MY_EXPRESS_APP
heroku ps:forward 9229 --app MY_EXPRESS_APP
Establishing credentials... done
SOCKSv5 proxy server started on port 1080
Listening on 9229 and forwarding to web.1:9229
Use CTRL+C to stop port fowarding
Upvotes: 2
Views: 170
Reputation: 341
One cause for this error to happen is the CPU being overloaded or throttled.
On an old Windows 10 laptop in which I configured the energy settings to throttle my CPU to 60% (to prevent overheating), the error was reliably happening less than one minute after starting a snapshot. After removing this throttling setting (max CPU usage in advanced power settings), I was able to snapshot the heap with a 95% success rate.
I suggest the following:
heroku ps:forward ...
.Antimalware Service Executable
;Upvotes: 0