{"record":{"id":"6c4e947a4a54ca48","repo":"quarkusio/quarkus","slug":"unable-to-fully-read-json-value-6c4e94","errorCode":null,"errorMessage":"Unable to fully read json value","messagePattern":"Unable to fully read json value","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/json/src/main/java/io/quarkus/bootstrap/json/JsonReader.java","lineNumber":56,"sourceCode":"        JsonValue result = readValue();\n        ignoreWhitespace();\n        return result;\n    }\n\n    /**\n     * value\n     * |---- object\n     * |---- array\n     * |---- string\n     * |---- number\n     * |---- \"true\"\n     * |---- \"false\"\n     * |---- \"null\"\n     */\n    private JsonValue readValue() {\n        final int ch = peekChar();\n        if (ch < 0) {\n            throw new IllegalArgumentException(\"Unable to fully read json value\");\n        }\n\n        switch (ch) {\n            case '{':\n                return readObject();\n            case '[':\n                return readArray();\n            case '\"':\n                return readString();\n            case 't':\n                return readConstant(\"true\", JsonBoolean.TRUE);\n            case 'f':\n                return readConstant(\"false\", JsonBoolean.FALSE);\n            case 'n':\n                return readConstant(\"null\", JsonNull.INSTANCE);\n            default:\n                if (Character.isDigit(ch) || '-' == ch) {\n                    return readNumber(position);","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/json/src/main/java/io/quarkus/bootstrap/json/JsonReader.java#L38-L74","documentation":"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.","triggerScenarios":"Calling JsonReader.read()/readValue() on a truncated JSON document, e.g. input ends right after a '{', a ':', or a ',' with no value following.","commonSituations":"Reading a partially downloaded or cut-off JSON file; a stream closed early; concatenating JSON strings incorrectly so the last value is missing.","solutions":["Verify the JSON input is complete and well-formed with a JSON validator before parsing","Check the source of the text (file, stream, HTTP body) for truncation or early EOF","Log/inspect the full input string around the end to find where it is cut off"],"exampleFix":"// before\nnew JsonReader(truncatedString).read();\n// after\nif (jsonText.trim().endsWith(\"}\") || jsonText.trim().endsWith(\"]\")) {\n    new JsonReader(jsonText).read();\n} else {\n    throw new IllegalArgumentException(\"Truncated JSON input\");\n}","handlingStrategy":"validation","validationCode":"if (jsonText == null || jsonText.isBlank()) {\n    throw new IllegalArgumentException(\"Empty or null JSON input\");\n}\n// optionally: validate with a JSON parser before reading","typeGuard":null,"tryCatchPattern":"try {\n    JsonValue v = new JsonReader(text).read();\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"Unable to fully read json value\")) {\n        // treat as truncated input: log the text, re-fetch or abort\n    }\n}","preventionTips":["Validate JSON completeness before parsing (e.g. check balanced braces/brackets)","Check read limits: file size caps, buffer boundaries, HTTP body truncation","Log the raw input when this error occurs to identify where it is cut off"],"tags":["json","parser","eof"],"backgroundTag":"malformed-json-input","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}