Webstorm 2020.2.1 Remote Debugging do not work

Webstorm 2020.2.1 only opens a about:blank page, if i want to debug my angular application. After a while i get this error message:

Waiting for connection to localhost:52421. Please ensure that the browser was started successfully with remote debugging port opened. Port cannot be opened if Chrome having the same User Data Directory is already launched.

Thats correct on Windows 10 i cannot find any open port 52421 on any started chrome instance using netstat -ano. I only see the SYN_SEND from my webstorm instance. My guess the chrome instance is not started with the --remote-debuging-port option. What i have tried so far:

Changed the path directrly to chrome.exe under Tools -> Web Browsers. Add the remote-debugging-port option manually with port 52421 and used another chrome-user-data folder. Start the IDE as administrator. Without any effect. Chrome always starts with a blank page and i am unable to debug anything.

2020-08-28 10:12:16,546 [ 25] INFO - #com.intellij.idea.Main - IDE: WebStorm (build #WS-202.6948.73, 25 Aug 2020 10:11)
2020-08-28 10:12:16,547 [ 26] INFO - #com.intellij.idea.Main - OS: Windows 10 (10.0, amd64)
2020-08-28 10:12:16,547 [ 26] INFO - #com.intellij.idea.Main - JRE: 11.0.8+10-b944.31 (JetBrains s.r.o.)
2020-08-28 10:12:16,547 [ 26] INFO - #com.intellij.idea.Main - JVM: 11.0.8+10-b944.31 (OpenJDK 64-Bit Server VM)

...

2020-08-28 10:12:21,376 [ 4855] INFO - .diagnostic.PerformanceWatcher - Post-startup activities under progress took 751ms; general responsiveness: ok; EDT responsiveness: 1/1 sluggish
2020-08-28 10:12:21,384 [ 4863] INFO - cloudConfig.CloudConfigManager - === StatusBar.start create ===
2020-08-28 10:12:21,492 [ 4971] INFO - tor.impl.FileEditorManagerImpl - Project opening took 3519 ms
2020-08-28 10:12:21,704 [ 5183] INFO - .diagnostic.PerformanceWatcher - Pushing properties took 251ms; general responsiveness: ok; EDT responsiveness: ok
2020-08-28 10:12:22,054 [ 5533] INFO - .diagnostic.PerformanceWatcher - Pushing JS language level to 115 libraries took 1308ms; general responsiveness: ok; EDT responsiveness: 1/2 sluggish
2020-08-28 10:12:22,793 [ 6272] INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 1088ms; general responsiveness: ok; EDT responsiveness: ok
2020-08-28 10:12:22,798 [ 6277] INFO - indexing.UnindexedFilesUpdater - Unindexed files update started: 0 files to index
2020-08-28 10:12:26,534 [ 10013] INFO - gnostic.WindowsDefenderChecker - Windows Defender status: not used
2020-08-28 10:12:27,631 [ 11110] INFO - ion.PackageVersionRangeMatcher - Matching 61 done in 208 ms
2020-08-28 10:12:30,949 [ 14428] INFO - tellij.xml.Html5SchemaProvider - HTML5_SCHEMA_LOCATION = C:/Program Files/JetBrains/WebStorm 2020.2.1/lib/intellij-xml.jar!/resources/html5-schema/html5.rnc
2020-08-28 10:12:36,982 [ 20461] INFO - .script.IdeScriptEngineManager - javax.script.ScriptEngineManager initialized in 114 ms
2020-08-28 10:13:09,536 [ 53015] INFO - m.pty4j.windows.WindowsVersion - Windows version: 10.0.19041
2020-08-28 10:13:16,172 [ 59651] INFO - sole.jcef.JCEFConsoleHtmlPanel - WebConsole page loaded
2020-08-28 10:13:16,176 [ 59655] INFO - .console.WebConsoleHistoryView - WebConsole page initialization complete
2020-08-28 10:13:16,176 [ 59655] INFO - sole.jcef.JCEFConsoleHtmlPanel - initialization complete
2020-08-28 10:13:27,763 [ 71242] INFO - rowsers.BrowserLauncherAppless - Timed out
2020-08-28 10:13:27,763 [ 71242] INFO - rowsers.BrowserLauncherAppless - [20016:20400:0828/101317.874:ERROR:tcp_socket_win.cc(352)] bind() returned an error: Der Zugriff auf einen Socket war aufgrund der Zugriffsrechte des Sockets unzulässig. (0x271D)
[20016:20400:0828/101317.875:ERROR:tcp_socket_win.cc(352)] bind() returned an error: Der Zugriff auf einen Socket war aufgrund der Zugriffsrechte des Sockets unzulässig. (0x271D)
[20016:20400:0828/101317.875:ERROR:devtools_http_handler.cc(298)] Cannot start http server for devtools.

2020-08-28 10:24:25,062 [ 728541] INFO - sole.jcef.JCEFConsoleHtmlPanel - WebConsole page loaded
2020-08-28 10:24:25,063 [ 728542] INFO - .console.WebConsoleHistoryView - WebConsole page initialization complete
2020-08-28 10:24:25,063 [ 728542] INFO - sole.jcef.JCEFConsoleHtmlPanel - initialization complete
2020-08-28 10:27:45,332 [ 928811] INFO - j.ide.actions.RevealFileAction - Exit code 1
2020-08-28 10:30:10,126 [1073605] INFO - sole.jcef.JCEFConsoleHtmlPanel - WebConsole page loaded
2020-08-28 10:30:10,127 [1073606] INFO - .console.WebConsoleHistoryView - WebConsole page initialization complete
2020-08-28 10:30:10,127 [1073606] INFO - sole.jcef.JCEFConsoleHtmlPanel - initialization complete
2020-08-28 10:30:23,348 [1086827] INFO - rowsers.BrowserLauncherAppless - Timed out
2020-08-28 10:30:23,348 [1086827] INFO - rowsers.BrowserLauncherAppless - [18796:12556:0828/103013.456:ERROR:tcp_socket_win.cc(352)] bind() returned an error: Der Zugriff auf einen Socket war aufgrund der Zugriffsrechte des Sockets unzulässig. (0x271D)
[18796:12556:0828/103013.456:ERROR:tcp_socket_win.cc(352)] bind() returned an error: Der Zugriff auf einen Socket war aufgrund der Zugriffsrechte des Sockets unzulässig. (0x271D)
[18796:12556:0828/103013.456:ERROR:devtools_http_handler.cc(298)] Cannot start http server for devtools.

 

Any further advice?

23 comments
Comment actions Permalink

Looks like a permissions issu on opening a socket (similar to https://appuals.com/fix-an-attempt-was-made-to-access-a-socket-in-a-way-forbidden-by-its-access-permissions/). Seems that some certain dynamic port numbers are blocked by a firewall/proxy/etc.
Does the issue persist after IDE restart/system reboot? If yes, please try shutting down the IDE and then removing both ~\AppData\Roaming\JetBrains\WebStorm2020.2\options\web-browsers.xml and ~\AppData\Roaming\JetBrains\WebStorm2020.2\options\other.xml files - does the issue persist?

10
Comment actions Permalink

Elena you are awesome! Deleted these two files and everything is working as expected! Amazing. Thank you very much!

3
Comment actions Permalink

Using Rider, I only have other.xml, and this fix works. It did twice!

1
Comment actions Permalink

Deleting other.xml worked for me too.  Thanks Lucas K for well described issue and Elena for giving clear fix.

1
Comment actions Permalink

I had no web-browsers.xml file.  Deleting the other.xml file worked for me too.  It was at C:\Users\jhouser\AppData\Roaming\JetBrains\IntelliJIdea2020.3\options

 

Edit:  Almost worked.. now I need a debugger statement in the code or else the IntelliJ debugger will never pick up on breakpoints.  Once the first debugger statement is triggered; breakpoints work as expected.

How weird' I would have sworn this worked w/o issue last week.

 

0
Comment actions Permalink

I am facing same issue for IntelliJ Idea. I tried to delete the files mentioned above but it did not work.

Should I do anything else for IntelliJ Idea ?

0
Comment actions Permalink

Thank you, Elena, it worked for me.

0
Comment actions Permalink

I just removed the property "js.chrome.debugger.port..." and "last_opened_file_path" from other.xml and that was enought.

0
Comment actions Permalink

FYI - worked for me as well on WebStorm 2021.1.2 (and only other.xml)

 

0
Comment actions Permalink

i deleted other.xml and web-browsers.xml but  not working.

 

(i m using ubuntu )

 

this my event log

Waiting for connection to localhost:40079.
Please ensure that the browser was started successfully with remote debugging port opened.
Port cannot be opened if Chrome having the same User Data Directory is already launched.

 

0
Comment actions Permalink

Most probably the next auto-generated port number doesn't work for you as well

If you are sure that the port 40079 is not occupied by the other app/blocked by firewall, you can check if it's excluded from the dynamic ports range using netsh interface ipv4 show excludedportrange protocol=tcp and then replace the 40079 port with some port valid on your system in other.xml

1
Comment actions Permalink

i don't understand how to do this

Waiting for connection to localhost:45261. Please ensure that the browser was started successfully with remote debugging port opened. Port cannot be opened if Chrome having the same User Data Directory is already launched.

0
Comment actions Permalink

What problems doing this have you faced?

0
Comment actions Permalink

as far as I can see, you are using the wrong configuration for debugging; npm start runs react-scripts start, running it in debugger makes no sense unless you'd like to debug the react-scripts; you need using JavaScript Debug run configuration to attach the debugger to your page.

  • create a JavaScript Debug run configuration with your app URL
  • run the npm start to build your app and start the dev server
  • debug the JavaScript Debug run configuration above

Please see https://www.jetbrains.com/help/webstorm/2021.1/react.html#react_running_and_debugging_debug for instructions on debugging React applications

0
Comment actions Permalink

>Waiting for connection to localhost:45261

if closing all chrome instances prior to starting the debugger doesn't help, please try the steps from https://intellij-support.jetbrains.com/hc/en-us/community/posts/360009567459/comments/4406239534354 above

>then i see in chrome

 

do you mean that you can see Apache web server start page if you open localhost:3000 in browser? It's strange, as the run console shows that the React dev server is started on this URL... Anyway, this problem is not related to debugging

0
Comment actions Permalink

>When you press the link that appears in the picture with CTRL+SHIFT+CLICK. Apache2 Ubuntu Default Page opens in a new Chrome tab

this means that the Apache server is listening on http://192.168.0.20. This, again, has nothing to do with debugging

>I don't understand how to do it here

what is unclaer namely?

0
Comment actions Permalink

Anyway, I gave up on debug.
I can not.
Thank you for your interest

0
Comment actions Permalink

I am facing the same problem with a freshly installed WebStorm 2021.3.2 on macOS Monterey 12.1. When I try debugging a new instance of Chrome gets opened on the about:black page and after a few seconds I get the following message in PyCharm:

Waiting for connection to localhost:49680. 
            Please ensure that the browser was started successfully with remote debugging port opened. 
            Port cannot be opened if Chrome having the same User Data Directory is already launched.

I have tried deleting the two .xml files you mentioned. I have restarted the IDE and rebooted the machine, but nothing helps. What could I do? Thanks.

0
Comment actions Permalink

Found the problem, for me it was having added these two lines in WebStorm.app.vmoptions

-Djava.net.preferIPv4Stack=false
-Djava.net.preferIPv6Addresses=true

Removing them made the debugger work.

1
Comment actions Permalink
After I removed the other.xml file other.xml I have a problem
 
I put a debugger in the JS code, I start the debugging process in rider, a new browser window opens and when I call breakpoint from the UI, my application stops in the browser, but nothing happens in the debugger tab(Rider IDE).
When I press F12 I see that the application is stopped at a breakpoint.
Can you help me? 
 
Update: Rider seems to have a bug. The Debugger tab starts working by itself. After 15-20 minutes or when changing any "JavaScript Debug" settings in "Edit configuration"
0
Comment actions Permalink

If you are running WebStorm on CentOS and you have reached the current page by an Internet search like "WebStorm Could not initialize class com.intellij.javascript.debugger.console.jcef.JCE", you might have searched for the following workaround for a CentOS problem:

Add ide.browser.jcef.enabled=false in Help | Edit Custom Properties, then restart the IDE.

See https://vocon-it.com/2022/06/13/solved-webstormcentos-bug-could-not-initialize-class-com-intellij-javascript-debugger-console-jcef-jce/ for more details.

0
Comment actions Permalink

My problem was the Hyper-v port exclusion range. Thanks Elena Pogorelova.

0

Please sign in to leave a comment.