{"record":{"id":"0c1bf13171b5cb73","repo":"apache/hadoop","slug":"missing-response","errorCode":null,"errorMessage":"Missing response","messagePattern":"Missing response","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java","lineNumber":969,"sourceCode":"   */\n  abstract class FsPathResponseRunner<T> extends AbstractFsPathRunner<T> {\n    FsPathResponseRunner(final HttpOpParam.Op op, final Path fspath,\n        Param<?,?>... parameters) {\n      super(op, fspath, parameters);\n    }\n\n    FsPathResponseRunner(final HttpOpParam.Op op, Param<?,?>[] parameters,\n        final Path fspath) {\n      super(op, parameters, fspath);\n    }\n\n    @Override\n    final T getResponse(HttpURLConnection conn) throws IOException {\n      try {\n        final Map<?,?> json = jsonParse(conn, false);\n        if (json == null) {\n          // match exception class thrown by parser\n          throw new IllegalStateException(\"Missing response\");\n        }\n        return decodeResponse(json);\n      } catch (IOException ioe) {\n        throw ioe;\n      } catch (Exception e) { // catch json parser errors\n        final IOException ioe =\n            new IOException(\"Response decoding failure: \"+e.toString(), e);\n        LOG.debug(\"Response decoding failure.\", e);\n        throw ioe;\n      } finally {\n        // Don't call conn.disconnect() to allow connection reuse\n        // See http://tinyurl.com/java7-http-keepalive\n        conn.getInputStream().close();\n      }\n    }\n\n    abstract T decodeResponse(Map<?,?> json) throws IOException;\n  }","sourceCodeStart":951,"sourceCodeEnd":987,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java#L951-L987","documentation":"FsPathResponseRunner expects a JSON body for a successful WebHDFS operation. jsonParse returns null when the HTTP connection reports a content length of zero, and getResponse converts that null into IllegalStateException('Missing response'), which is then wrapped as IOException('Response decoding failure: ...'). The operation therefore succeeded at the HTTP layer but returned no decodable payload.","triggerScenarios":"A WebHDFS request receives its expected success status with an empty body, for example a gateway or filter returning 200/204 with no JSON. Any API implemented through FsPathResponseRunner, such as GETFILESTATUS, GETACLSTATUS, or GETFILECHECKSUM, can encounter it.","commonSituations":"A proxy or HttpFS gateway strips the response body; keep-alive reuse yields an empty response after a connection problem; a custom filter or mock returns success without forwarding JSON; a server bug produces an empty success response.","solutions":["Replay the exact request with curl -i and confirm whether the expected success status has Content-Length: 0.","Check reverse-proxy, HttpFS, and NameNode logs for body truncation or filter interception on that path.","Retry once on a new connection to rule out stale keep-alive sockets, then fail over to another NameNode if available.","Repair the gateway or mock so successful WebHDFS operations return the documented application/json body."],"exampleFix":"// before\nFileStatus status = fs.getFileStatus(path); // 200 with empty body\n\n// after: bounded retry on a fresh connection\nfor (int attempt = 0; attempt < 2; attempt++) {\n  try {\n    return fs.getFileStatus(path);\n  } catch (IOException e) {\n    if (attempt == 0 && e.toString().contains(\"Missing response\")) {\n      continue;\n    }\n    throw e;\n  }\n}\nthrow new IOException(\"WebHDFS repeatedly returned an empty response\");","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"IOException last = null;\nfor (int attempt = 0; attempt < 2; attempt++) {\n  try {\n    return fs.getFileStatus(path);\n  } catch (IOException e) {\n    last = e;\n    if (e.toString().contains(\"Missing response\") && attempt == 0) {\n      continue;\n    }\n    throw e;\n  }\n}\nthrow last;","preventionTips":["Limit retries to one fresh attempt for empty responses; repeated emptiness is an endpoint defect.","Ensure proxies do not convert successful WebHDFS JSON responses into empty bodies.","Log the operation and qualified path for every empty-response retry to identify the failing gateway."],"tags":["java","hadoop","webhdfs","http","json","empty-response"],"backgroundTag":"empty-response-body","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}