quarkusio/quarkus · error · IllegalArgumentException

Unable to fully read json value

Error message

Unable to fully read json value

What it means

JsonReader.readValue() is called to parse the next JSON value from the input text. If peekChar() returns a negative value, the input ended (EOF) where a value was expected, so the reader concludes the JSON text was truncated and throws IllegalArgumentException. It signals malformed/incomplete JSON input rather than a data problem.

Source

Thrown at independent-projects/bootstrap/json/src/main/java/io/quarkus/bootstrap/json/JsonReader.java:56

        JsonValue result = readValue();
        ignoreWhitespace();
        return result;
    }

    /**
     * value
     * |---- object
     * |---- array
     * |---- string
     * |---- number
     * |---- "true"
     * |---- "false"
     * |---- "null"
     */
    private JsonValue readValue() {
        final int ch = peekChar();
        if (ch < 0) {
            throw new IllegalArgumentException("Unable to fully read json value");
        }

        switch (ch) {
            case '{':
                return readObject();
            case '[':
                return readArray();
            case '"':
                return readString();
            case 't':
                return readConstant("true", JsonBoolean.TRUE);
            case 'f':
                return readConstant("false", JsonBoolean.FALSE);
            case 'n':
                return readConstant("null", JsonNull.INSTANCE);
            default:
                if (Character.isDigit(ch) || '-' == ch) {
                    return readNumber(position);

View on GitHub (pinned to e1c734241f)

Solutions

  1. Verify the JSON input is complete and well-formed with a JSON validator before parsing
  2. Check the source of the text (file, stream, HTTP body) for truncation or early EOF
  3. Log/inspect the full input string around the end to find where it is cut off

Example fix

// before
new JsonReader(truncatedString).read();
// after
if (jsonText.trim().endsWith("}") || jsonText.trim().endsWith("]")) {
    new JsonReader(jsonText).read();
} else {
    throw new IllegalArgumentException("Truncated JSON input");
}
Defensive patterns

Strategy: validation

Validate before calling

if (jsonText == null || jsonText.isBlank()) {
    throw new IllegalArgumentException("Empty or null JSON input");
}
// optionally: validate with a JSON parser before reading

Try / catch

try {
    JsonValue v = new JsonReader(text).read();
} catch (IllegalArgumentException e) {
    if (e.getMessage().contains("Unable to fully read json value")) {
        // treat as truncated input: log the text, re-fetch or abort
    }
}

Prevention

When it happens

Trigger: Calling JsonReader.read()/readValue() on a truncated JSON document, e.g. input ends right after a '{', a ':', or a ',' with no value following.

Common situations: Reading a partially downloaded or cut-off JSON file; a stream closed early; concatenating JSON strings incorrectly so the last value is missing.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/6c4e947a4a54ca48. Report an issue: GitHub.