oracle/graal · warning · IOException
Could not connect to the IGV on %s:%d
Error message
Could not connect to the IGV on %s:%d
What it means
When Graal is configured to send graph dumps to the Ideal Graph Visualizer over a socket (host/port from the IGV dump options), IgvDumpChannel tries to open a SocketChannel. If the connection fails with IOException, this message names the host and port; depending on configuration it either falls back to writing graphs to a local file (pathProvider set) or rethrows the IOException.
Source
Thrown at compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/debug/IgvDumpChannel.java:147
int port = PrintGraphPort.getValue(options);
try {
WritableByteChannel channel = SocketChannel.open(new InetSocketAddress(host, port));
String targetAnnouncement = String.format("Connected to the IGV on %s:%d", host, port);
maybeAnnounceTarget(targetAnnouncement);
return channel;
} catch (ClosedByInterruptException | InterruptedIOException e) {
/*
* Interrupts should not count as errors because they may be caused by a cancelled Graal
* compilation. ClosedByInterruptException occurs if the SocketChannel could not be
* opened. InterruptedIOException occurs if new Socket(..) was interrupted.
*/
return null;
} catch (IOException e) {
String networkFailure = String.format("Could not connect to the IGV on %s:%d", host, port);
if (pathProvider != null) {
return createFileChannel(pathProvider, networkFailure);
} else {
throw new IOException(networkFailure, e);
}
}
}
private static String lastTargetAnnouncement;
private static void maybeAnnounceTarget(String targetAnnouncement) {
if (!targetAnnouncement.equals(lastTargetAnnouncement)) {
// Ignore races - an extra announcement is ok
lastTargetAnnouncement = targetAnnouncement;
TTY.println(targetAnnouncement);
}
}
private static WritableByteChannel createFileChannel(Supplier<String> pathProvider, String networkFailure) throws IOException {
String path = pathProvider.get();
try {
WritableByteChannel channel = PathUtilities.openFileChannel(path, StandardOpenOption.WRITE, StandardOpenOption.CREATE);View on GitHub (pinned to a66e9ccd1d)
Solutions
- Start IGV first (igv/idealgraphvisualizer binary) and confirm it listens on the configured port, then rerun with the dump options.
- Check -Dgraal.PrintGraphHost / -Dgraal.PrintGraphPort values match where IGV actually runs.
- If IGV is unavailable, let the fallback write graphs to a file directory (-Dgraal.DumpPath) and open the .igv files offline.
- If you never intended to dump, remove the -Dgraal.Dump option — no connection is attempted without it.
Defensive patterns
Strategy: fallback
Validate before calling
// probe IGV before launching the expensive workload
try (java.net.Socket s = new java.net.Socket()) {
s.connect(new java.net.InetSocketAddress(host, port), 500);
// IGV reachable
} catch (IOException e) {
// configure DumpPath file fallback instead of socket dumping
} Try / catch
try {
channel = IgvDumpChannel.open(host, port, pathProvider);
} catch (IOException e) {
if (e.getMessage().startsWith("Could not connect to the IGV")) {
// acceptable: graphs fall back to local files under DumpPath; keep going
LOG.warn("{}", e.getMessage());
} else {
throw e;
}
} Prevention
- Start IGV and verify the port before launching the JVM with dump options.
- Always set -Dgraal.DumpPath so socket failure degrades to file dumping instead of failing the run.
When it happens
Trigger: Running with -Dgraal.Dump=... while IGV is not listening (or listening on a different host/port), a firewall blocking localhost/remote ports, or IGV still starting up when the first dump is sent. Interrupts during connection are deliberately ignored and return null, so only genuine connection failures produce this.
Common situations: Forgetting to start IGV (or starting it after the JVM), stale -Dgraal.PrintGraphHost/-Dgraal.PrintGraphPort values pointing at a machine that no longer runs IGV, containers without networking to the IGV host, or ports occupied by another service.
Related errors
- Failed to open %s to dump IGV graphs
- Error archiving %s. This directory will not be deleted and m
- Unable to handshake with debugger
- Error disassembling %s%nPartial disassembly:%n%s
- Error loading phase plan from %s
AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14).
Data as JSON: /api/errors/2d0524d090bde122.
Report an issue: GitHub.