{"record":{"id":"05191194cd0e88ca","repo":"apache/hadoop","slug":"zstdcompressctx-is-not-initialized","errorCode":null,"errorMessage":"ZstdCompressCtx is not initialized","messagePattern":"ZstdCompressCtx is not initialized","errorType":"exception","errorClass":"NullPointerException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/compress/zstd/ZStandardCompressor.java","lineNumber":329,"sourceCode":"    userBufLen = 0;\n  }\n\n  @Override\n  public void end() {\n    if (zstdJniCtx != null) {\n      zstdJniCtx.close();\n      zstdJniCtx = null;\n    }\n  }\n\n  @Override\n  protected void finalize() {\n    end();\n  }\n\n  private void checkStream() {\n    if (zstdJniCtx == null) {\n      throw new NullPointerException(\"ZstdCompressCtx is not initialized\");\n    }\n  }\n}\n","sourceCodeStart":311,"sourceCodeEnd":333,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/compress/zstd/ZStandardCompressor.java#L311-L333","documentation":"Error \"ZstdCompressCtx is not initialized\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/compress/zstd/ZStandardCompressor.java:329 when the library encounters an invalid state.","commonSituations":"Occurs when the native Zstd compression context has not been initialized (e.g., init not called or after close/finish). Ensure the compressor is properly initialized and not finished before compressing.","solutions":["Ensure the native zstd library is loaded and the compressor was properly initialized before use; check the native library load logs.","Re-create the ZStandardCompressor instead of reusing one whose native context was released."],"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"}