{"record":{"id":"d89d1c788c898b26","repo":"apache/hadoop","slug":"failed-to-read-from-stream-remaining-partremaini","errorCode":null,"errorMessage":"Failed to read from stream. Remaining:{partRemaining}","messagePattern":"Failed to read from stream\\. Remaining:(.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/AliyunOSSInputStream.java","lineNumber":253,"sourceCode":"        reopen(position);\n      }\n\n      int bytes = 0;\n      for (int i = this.buffer.length - (int)partRemaining;\n           i < this.buffer.length; i++) {\n        buf[off + bytesRead] = this.buffer[i];\n        bytes++;\n        bytesRead++;\n        if (off + bytesRead >= len) {\n          break;\n        }\n      }\n\n      if (bytes > 0) {\n        position += bytes;\n        partRemaining -= bytes;\n      } else if (partRemaining != 0) {\n        throw new IOException(\"Failed to read from stream. Remaining:\" +\n            partRemaining);\n      }\n    }\n\n    if (statistics != null && bytesRead > 0) {\n      statistics.incrementBytesRead(bytesRead);\n    }\n\n    // Read nothing, but attempt to read something\n    if (bytesRead == 0 && len > 0) {\n      return -1;\n    } else {\n      return bytesRead;\n    }\n  }\n\n  @Override\n  public synchronized void close() throws IOException {","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/AliyunOSSInputStream.java#L235-L271","documentation":"Error \"Failed to read from stream. Remaining:{partRemaining}\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/AliyunOSSInputStream.java:253 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check network connectivity to OSS; the read of an open part stream failed, so retry the operation and inspect the underlying cause in the logs."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}