{"record":{"id":"7136851fcae18bd7","repo":"opendataloader-project/opendataloader-pdf","slug":"pdf2img-inner-result-is-null","errorCode":null,"errorMessage":"pdf2img inner RESULT is null","messagePattern":"pdf2img inner RESULT is null","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"java/opendataloader-pdf-core/src/main/java/org/opendataloader/pdf/hybrid/HancomAIClient.java","lineNumber":706,"sourceCode":"                throw new IOException(\"pdf2img returned HTTP \" + response.code());\n            }\n\n            ResponseBody respBody = response.body();\n            if (respBody == null) {\n                throw new IOException(\"pdf2img returned empty body\");\n            }\n\n            JsonNode root = objectMapper.readTree(respBody.string());\n            // Navigate: RESULT[0].RESULT.PAGE_PNG_DATA\n            JsonNode resultArr = root.get(\"RESULT\");\n            if (resultArr == null || !resultArr.isArray() || resultArr.size() == 0) {\n                throw new IOException(\"pdf2img RESULT is empty\");\n            }\n\n            JsonNode pageResult = resultArr.get(0);\n            JsonNode innerResult = pageResult.get(\"RESULT\");\n            if (innerResult == null) {\n                throw new IOException(\"pdf2img inner RESULT is null\");\n            }\n\n            String pngBase64 = innerResult.has(\"PAGE_PNG_DATA\")\n                ? innerResult.get(\"PAGE_PNG_DATA\").asText() : null;\n            if (pngBase64 == null || pngBase64.isEmpty()) {\n                throw new IOException(\"pdf2img PAGE_PNG_DATA is empty\");\n            }\n\n            byte[] pngBytes;\n            try {\n                pngBytes = Base64.getDecoder().decode(pngBase64);\n            } catch (IllegalArgumentException e) {\n                // fetchPageImage is declared to throw IOException and callers catch\n                // only IOException. Escaping IAE would abort the whole conversion\n                // instead of skipping the failed page.\n                throw new IOException(\"pdf2img PAGE_PNG_DATA is not valid Base64\", e);\n            }\n            BufferedImage image = ImageIO.read(new ByteArrayInputStream(pngBytes));","sourceCodeStart":688,"sourceCodeEnd":724,"githubUrl":"https://github.com/opendataloader-project/opendataloader-pdf/blob/a7789b8e77dd05e2b8659eb3ea12fc458f80bfb8/java/opendataloader-pdf-core/src/main/java/org/opendataloader/pdf/hybrid/HancomAIClient.java#L688-L724","documentation":"RESULT[0] exists but its inner RESULT field (expected to hold PAGE_PNG_DATA) is null. This means the pdf2img envelope shape is unexpected — the backend returned a RESULT array whose first element lacks the nested RESULT object. Per-page IOException, caught and logged by table/figure handlers.","triggerScenarios":"resultArr.get(0) is present but pageResult.get(\"RESULT\") returns null inside fetchPageImage.","commonSituations":"Backend pdf2img returned an error/wrapper object in RESULT[0] without the nested RESULT (e.g. an error envelope); version skew altering the nesting; backend returning metadata-only entries.","solutions":["Inspect the raw RESULT[0] payload to see why the nested RESULT is absent","Check backend pdf2img version matches the expected envelope","Retry the page; if persistent, accept the per-page skip","Review backend logs for the PAGE_INDEX that produced the malformed entry"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    return cache.getOrFetch(pageNum, idx -> client.fetchPageImage(pdf, idx, crop));\n} catch (IOException e) {\n    if (e.getMessage().contains(\"inner RESULT is null\")) {\n        log.warn(\"page {} pdf2img envelope malformed (no nested RESULT)\", pageNum);\n    }\n    continue;\n}","preventionTips":["Pin the backend pdf2img version that produces the expected RESULT[0].RESULT nesting","Capture raw responses when envelope errors cluster on specific pages","Accept per-page skips rather than aborting the whole conversion"],"tags":["hybrid","hancom-ai","pdf2img","response-parsing","schema"],"backgroundTag":null,"analyzedSha":"a7789b8e77dd05e2b8659eb3ea12fc458f80bfb8","analyzedAt":"2026-08-14T05:22:03.953Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}