Graaljs: Cannot connect remotely on GraalVM debugger

Created on 21 Apr 2020  路  2Comments  路  Source: oracle/graaljs

I'm trying to connect remotely to a GraalVM debugger, but the connection always fails to establish (GraalVM 20.0.0 java 11, running on Ubuntu 19.10).

For the test, I'm running a Java application using GraalVM on my machine, with the following configuration for the engine :

Engine engine = Engine.newBuilder()
            .option("inspect", "9930")
            .option("inspect.Secure", "false")
            .build();
Context.Builder contextBuilder = Context.newBuilder().engine(engine);

I can connect on localhost, using the url provided in the logs :

Debugger listening on port 9930.
To start debugging, open the following URL in Chrome:
    chrome-devtools://devtools/bundled/js_app.html?ws=127.0.0.1:9930/4b4523f8-a5dcc9aabd2

but it doesn't work if I replace 127.0.0.1 by my real ip address.

Running the command sudo netstat -plnt show the following result :

tcp6       0      0 127.0.0.1:9930          :::*                    LISTEN      26280/java

showing that the debugger only listens on localhost, thus refusing external connections.

Is there an additional parameter to enable remote debugging ? Following this link https://www.graalvm.org/docs/tools/chrome-debugger, I tried to add the option .option("inspect.Remote", remoteConnect) as shown in the example, but the parameter is unknown.

Most helpful comment

You need to make the inspector listen on that address. "inspect.Remote" option was abandoned, you should use .option("inspect", "10.10.10.10:9930") instead, where you replace "10.10.10.10" with your IP address.

All 2 comments

You need to make the inspector listen on that address. "inspect.Remote" option was abandoned, you should use .option("inspect", "10.10.10.10:9930") instead, where you replace "10.10.10.10" with your IP address.

Thanks a lot, it works now !

Sorry for the bother.

Was this page helpful?
0 / 5 - 0 ratings