aeron-io/aeron · error · IllegalStateException

no more input found, state=

Error message

no more input found, state=<state> in <uri>

What it means

After consuming all input, ChannelUri.parse() checks the final state. Only CHANNEL (done) and PARAMS_VALUE (a pending key=value to flush) are acceptable; any other trailing state (e.g. ended mid-key, mid-prefix, or mid-media) throws this IllegalStateException because the URI ended prematurely.

Solutions

  1. Print and complete the URI — ensure it has scheme prefix, media, and well-formed params (e.g. "aeron:udp?endpoint=host:port")
  2. Check where the URI string comes from (env var, config file) for truncation or newline issues
  3. Catch IllegalStateException around parse() for untrusted input and report a clear invalid-channel error

Example fix

// before
String uri = System.getenv("AERON_CHANNEL"); // "aeron:udp?endpoint" (truncated)
ChannelUri.parse(uri);
// after
String uri = System.getenv("AERON_CHANNEL");
if (uri == null || !uri.startsWith("aeron:")) throw new IllegalArgumentException("bad AERON_CHANNEL: " + uri);
ChannelUri.parse("aeron:udp?endpoint=localhost:40456");
Defensive patterns

Strategy: validation

Validate before calling

static boolean looksLikeCompleteChannelUri(String uri) {
    return uri.startsWith("aeron:") && uri.length() > "aeron:".length()
        && (uri.startsWith("aeron:udp") || uri.startsWith("aeron:ipc"));
}

Type guard

static boolean isCompleteUri(String uri) {
    try { ChannelUri.parse(uri); return true; } catch (IllegalStateException e) { return false; }
}

Try / catch

try {
    ChannelUri.parse(uri);
} catch (IllegalStateException e) {
    throw new IllegalArgumentException("Channel URI truncated or incomplete: '" + uri + "'", e);
}

Prevention

When it happens

Trigger: Calling ChannelUri.parse() on truncated URIs, e.g. "aeron:udp?endpoint" (ends mid-key), "aeron:" or "aeron:udp" fragments, or a URI ending with a bare "|key".

Common situations: Configuration values cut off by env-var truncation or bad templating; URIs split across lines and partially read; protocol/scheme typos leaving the parser mid-state.

Understand the failure class

Background: "Invalid URL" errors: why new URL(), URI.parse, and reqwest::Url reject your string — missing scheme, whitespace, and bad path format — this error's family across 39 libraries.

Related errors


AI-assisted analysis of aeron-io/aeron@6d60124e15 (2026-09-12). Data as JSON: /api/errors/6483f8662971ef94. Report an issue: GitHub.

Appendix: source

Thrown at aeron-client/src/main/java/io/aeron/ChannelUri.java:485

                default:
                    throw new IllegalStateException("unexpected state=" + state + " in " + uri);
            }
        }

        switch (state)
        {
            case MEDIA:
                media = builder.toString();
                validateMedia(media);
                break;

            case PARAMS_VALUE:
                params.put(key, builder.toString());
                break;

            default:
                throw new IllegalStateException("no more input found, state=" + state + " in " + uri);
        }

        return new ChannelUri(prefix, media, params);
    }

    /**
     * Add a sessionId to a given channel.
     *
     * @param channel   to add sessionId to.
     * @param sessionId to add to channel.
     * @return new string that represents channel with sessionId added.
     */
    public static String addSessionId(final String channel, final int sessionId)
    {
        final ChannelUri channelUri = ChannelUri.parse(channel);
        channelUri.put(CommonContext.SESSION_ID_PARAM_NAME, Integer.toString(sessionId));

        return channelUri.toString();

View on GitHub (pinned to 6d60124e15)