{"record":{"id":"2d0524d090bde122","repo":"oracle/graal","slug":"could-not-connect-to-the-igv-on-s-d","errorCode":null,"errorMessage":"Could not connect to the IGV on %s:%d","messagePattern":"Could not connect to the IGV on (.+?):(.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"warning","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/debug/IgvDumpChannel.java","lineNumber":147,"sourceCode":"        int port = PrintGraphPort.getValue(options);\n        try {\n            WritableByteChannel channel = SocketChannel.open(new InetSocketAddress(host, port));\n            String targetAnnouncement = String.format(\"Connected to the IGV on %s:%d\", host, port);\n            maybeAnnounceTarget(targetAnnouncement);\n            return channel;\n        } catch (ClosedByInterruptException | InterruptedIOException e) {\n            /*\n             * Interrupts should not count as errors because they may be caused by a cancelled Graal\n             * compilation. ClosedByInterruptException occurs if the SocketChannel could not be\n             * opened. InterruptedIOException occurs if new Socket(..) was interrupted.\n             */\n            return null;\n        } catch (IOException e) {\n            String networkFailure = String.format(\"Could not connect to the IGV on %s:%d\", host, port);\n            if (pathProvider != null) {\n                return createFileChannel(pathProvider, networkFailure);\n            } else {\n                throw new IOException(networkFailure, e);\n            }\n        }\n    }\n\n    private static String lastTargetAnnouncement;\n\n    private static void maybeAnnounceTarget(String targetAnnouncement) {\n        if (!targetAnnouncement.equals(lastTargetAnnouncement)) {\n            // Ignore races - an extra announcement is ok\n            lastTargetAnnouncement = targetAnnouncement;\n            TTY.println(targetAnnouncement);\n        }\n    }\n\n    private static WritableByteChannel createFileChannel(Supplier<String> pathProvider, String networkFailure) throws IOException {\n        String path = pathProvider.get();\n        try {\n            WritableByteChannel channel = PathUtilities.openFileChannel(path, StandardOpenOption.WRITE, StandardOpenOption.CREATE);","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/debug/IgvDumpChannel.java#L129-L165","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// probe IGV before launching the expensive workload\ntry (java.net.Socket s = new java.net.Socket()) {\n    s.connect(new java.net.InetSocketAddress(host, port), 500);\n    // IGV reachable\n} catch (IOException e) {\n    // configure DumpPath file fallback instead of socket dumping\n}","typeGuard":null,"tryCatchPattern":"try {\n    channel = IgvDumpChannel.open(host, port, pathProvider);\n} catch (IOException e) {\n    if (e.getMessage().startsWith(\"Could not connect to the IGV\")) {\n        // acceptable: graphs fall back to local files under DumpPath; keep going\n        LOG.warn(\"{}\", e.getMessage());\n    } else {\n        throw e;\n    }\n}","preventionTips":["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."],"tags":["igv","network","graph-dumping","debugging","io"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}