Debugging Node.js inside a docker compose does not work with Ubuntu 20.04

If you create a running configuration for remote debugging node.js that is running inside a docker compose container and try to debug, you get the following error:

Error in JetBrains node debug connector:  { Error: EACCES: permission denied, open '/opt/intellij_unique_1/nodejs_debug_ports'
at Object.openSync (fs.js:448:3)
at Object.writeFileSync (fs.js:1210:35)
at Object.appendFileSync (fs.js:1256:6)
at Object.<anonymous> (/opt/intellij_unique_1/dockerComposeDebugConnector.js:21:6)
at Module._compile (internal/modules/cjs/loader.js:816:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
at Module.load (internal/modules/cjs/loader.js:685:32)
at Function.Module._load (internal/modules/cjs/loader.js:620:12)
at Module.require (internal/modules/cjs/loader.js:723:19)
at Module._preloadModules (internal/modules/cjs/loader.js:945:12)
errno: -13,
syscall: 'open',
code: 'EACCES',
path: '/opt/intellij_unique_1/nodejs_debug_ports' }

The code is still run, but the debugger does not work.

I create the run configuration like this:
1. Add a Node.js run configuration
2. For Node Interpreter press the button on the right to select another interpreter
3. In the opened window press '+' to add a new interpreter and select 'Add remote'
4. Select docker-compose and select the correct docker-compose file. For server select Docker

 

I tried this with both Webstorm 201.7223.93 and Webstorm 192.7142.35 but got the same result with both. Debugging without docker works. The configuration I used works on Ubuntu 18.04.

Is there a way to fix this?

2 comments
Comment actions Permalink

please try disabling js.debugger.use.node.options key in Registry... (Help | Find action, type Registry to locate it) - does it make things any better?

0
Comment actions Permalink

Thanks, that seems to fix it!

0

Please sign in to leave a comment.