{"record":{"id":"5bea91f3bacb273a","repo":"aeron-io/aeron","slug":"unknown-media-media","errorCode":null,"errorMessage":"unknown media: ${media}","messagePattern":"unknown media: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"aeron-client/src/main/java/io/aeron/ChannelUri.java","lineNumber":698,"sourceCode":"    /**\n     * Determines if the supplied channel has specified <code>control-mode=response</code>.\n     *\n     * @param channelUri to check if the control mode is response\n     * @return true if the supplied channel has specified <code>control-mode=response</code>.\n     */\n    public static boolean isControlModeResponse(final String channelUri)\n    {\n        return parse(channelUri).hasControlModeResponse();\n    }\n\n    private static void validateMedia(final String media)\n    {\n        if (IPC_MEDIA.equals(media) || UDP_MEDIA.equals(media))\n        {\n            return;\n        }\n\n        throw new IllegalArgumentException(\"unknown media: \" + media);\n    }\n\n    private static boolean startsWith(final CharSequence input, final int position, final String prefix)\n    {\n        if ((input.length() - position) < prefix.length())\n        {\n            return false;\n        }\n\n        for (int i = 0; i < prefix.length(); i++)\n        {\n            if (input.charAt(position + i) != prefix.charAt(i))\n            {\n                return false;\n            }\n        }\n\n        return true;","sourceCodeStart":680,"sourceCodeEnd":716,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-client/src/main/java/io/aeron/ChannelUri.java#L680-L716","documentation":"ChannelUri.validateMedia() (used by media() and parse()) accepts only \"ipc\" or \"udp\" as the URI media component; anything else throws IllegalArgumentException. The media determines the transport type of the Aeron channel.","triggerScenarios":"Calling ChannelUri.parse() on a URI like \"aeron:tcp?endpoint=...\" or \"aeron:foo?...\", or ChannelUri.media(\"tcp\") — any media string other than \"ipc\" or \"udp\".","commonSituations":"Assuming other network protocols (tcp, websocket) are supported; typos like \"UDP\" (case matters) or \"ip c\"; migrating configs from other messaging systems.","solutions":["Change the URI media to \"udp\" or \"ipc\" (lowercase, exactly)","If you need a different transport, check the Aeron version/docs for supported media; this build supports only udp and ipc","Normalize/case-fold media values from config before constructing the URI"],"exampleFix":"// before\nAeron.connect().addPublication(\"aeron:tcp?endpoint=localhost:40456\", streamId);\n// after\nAeron.connect().addPublication(\"aeron:udp?endpoint=localhost:40456\", streamId);","handlingStrategy":"validation","validationCode":"static void requireSupportedMedia(String media) {\n    if (!\"udp\".equals(media) && !\"ipc\".equals(media)) {\n        throw new IllegalArgumentException(\"unsupported media '\" + media + \"', use 'udp' or 'ipc'\");\n    }\n}","typeGuard":"static boolean isSupportedMedia(String media) {\n    return \"udp\".equals(media) || \"ipc\".equals(media);\n}","tryCatchPattern":"try {\n    ChannelUri.parse(channelUri);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"unknown media\")) {\n        throw new IllegalArgumentException(\"Unsupported channel media in: \" + channelUri, e);\n    }\n    throw e;\n}","preventionTips":["Use only lowercase \"udp\" or \"ipc\" in channel URIs — matching is case-sensitive","Validate media from config files/environment against a whitelist before constructing URIs","Check Aeron docs for your version before assuming other transports (tcp, etc.) are supported"],"tags":["uri","media","validation","aeron"],"backgroundTag":"invalid-enum-value","analyzedSha":"6d60124e15e35c11b49ba2e3c2c2858a09a18803","analyzedAt":"2026-09-12T11:17:07.683Z","contentChangedAt":"2026-09-12T11:17:07.683Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}