{"record":{"id":"670314996303c7cf","repo":"apache/hadoop","slug":"can-t-create-md5-digests","errorCode":null,"errorMessage":"Can't create MD5 digests","messagePattern":"Can't create MD5 digests","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-rumen/src/main/java/org/apache/hadoop/tools/rumen/RandomSeedGenerator.java","lineNumber":55,"sourceCode":" * random numbers with better theoretical guarantees, see\n * P. L'Ecuyer, R. Simard, E. J. Chen, and W. D. Kelton, \n * ``An Objected-Oriented Random-Number Package with Many Long Streams and \n * Substreams'', Operations Research, 50, 6 (2002), 1073--1075\n * http://www.iro.umontreal.ca/~lecuyer/papers.html\n * http://www.iro.umontreal.ca/~lecuyer/myftp/streams00/\n */\npublic class RandomSeedGenerator {\n  private static Logger LOG = LoggerFactory.getLogger(RandomSeedGenerator.class);\n\n  /** MD5 algorithm instance, one for each thread. */\n  private static final ThreadLocal<MessageDigest> md5Holder =\n      new ThreadLocal<MessageDigest>() {\n        @Override protected MessageDigest initialValue() {\n          MessageDigest md5 = null; \n          try {\n            md5 = MessageDigest.getInstance(\"MD5\");\n          } catch (NoSuchAlgorithmException nsae) {\n            throw new RuntimeException(\"Can't create MD5 digests\", nsae);\n          }\n          return md5;\n        }\n      };\n      \n  /**\n   * Generates a new random seed.\n   *\n   * @param streamId a string identifying the stream of random numbers\n   * @param masterSeed higher level master random seed\n   * @return the random seed. Different (streamId, masterSeed) pairs result in\n   *         (vastly) different random seeds.\n   */   \n  public static long getSeed(String streamId, long masterSeed) {\n    MessageDigest md5 = md5Holder.get();\n    md5.reset();\n    //'/' : make sure that we don't get the same str from ('11',0) and ('1',10)\n    // We could have fed the bytes of masterSeed one by one to md5.update()","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-rumen/src/main/java/org/apache/hadoop/tools/rumen/RandomSeedGenerator.java#L37-L73","documentation":"Error \"Can't create MD5 digests\" thrown in apache/hadoop.","triggerScenarios":"The JVM's MessageDigest does not support MD5 when RandomSeedGenerator initializes, an environment/JCE configuration problem.","commonSituations":"See trigger scenarios.","solutions":["Run on a JRE that provides the MD5 MessageDigest algorithm (any standard JDK does)."],"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"}