{"record":{"id":"20aea16cc50968ab","repo":"aeron-io/aeron","slug":"unexpected-state-state-in-uri","errorCode":null,"errorMessage":"unexpected state=<state> in <uri>","messagePattern":"unexpected state=<state> in <uri>","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"aeron-client/src/main/java/io/aeron/ChannelUri.java","lineNumber":469,"sourceCode":"                        builder.append(c);\n                    }\n                    break;\n\n                case PARAMS_VALUE:\n                    if (c == '|')\n                    {\n                        params.put(key, builder.toString());\n                        builder.setLength(0);\n                        state = State.PARAMS_KEY;\n                    }\n                    else\n                    {\n                        builder.append(c);\n                    }\n                    break;\n\n                default:\n                    throw new IllegalStateException(\"unexpected state=\" + state + \" in \" + uri);\n            }\n        }\n\n        switch (state)\n        {\n            case MEDIA:\n                media = builder.toString();\n                validateMedia(media);\n                break;\n\n            case PARAMS_VALUE:\n                params.put(key, builder.toString());\n                break;\n\n            default:\n                throw new IllegalStateException(\"no more input found, state=\" + state + \" in \" + uri);\n        }\n","sourceCodeStart":451,"sourceCodeEnd":487,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-client/src/main/java/io/aeron/ChannelUri.java#L451-L487","documentation":"ChannelUri.parse()'s state machine hits a state not covered by its switch — a defensive default that should be unreachable for any input, indicating an internal parsing invariant was violated. It throws IllegalStateException including the current state and URI.","triggerScenarios":"In practice unreachable from public parse() input alone; would occur only if the parser code is modified (new State enum value added without a case) or via a corrupted build.","commonSituations":"Custom forks/patches of ChannelUri that add states; unexpected library/version mismatch where a modified parser sees an unknown state value.","solutions":["Report it as a library bug with the URI and state value from the message","Verify you are running unmodified, consistent versions of the Aeron client jars (no shaded/mixed versions)","If you patched the parser, add the missing case for the new State"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    ChannelUri.parse(uri);\n} catch (IllegalStateException e) {\n    if (e.getMessage().startsWith(\"unexpected state=\")) {\n        throw new AssertionError(\"Aeron parser bug, report with URI: \" + uri, e);\n    }\n    throw e;\n}","preventionTips":["Treat this as a library bug: report to Aeron with the URI and state value","Use unmodified, version-consistent Aeron client jars","Do not fork/patch the parser without covering all State enum values"],"tags":["internal","invariant","uri-parsing"],"backgroundTag":"internal-invariant-violation","analyzedSha":"6d60124e15e35c11b49ba2e3c2c2858a09a18803","analyzedAt":"2026-09-12T11:17:07.683Z","contentChangedAt":"2026-09-12T11:17:07.683Z","schemaVersion":2},"datasetVersion":"2026-09-19T12:17:13.211Z"}