{"record":{"id":"d603ae31da0a42f5","repo":"apache/hadoop","slug":"variable-substitution-depth-too-large-20","errorCode":null,"errorMessage":"Variable substitution depth too large: 20 {}","messagePattern":"Variable substitution depth too large: 20 (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java","lineNumber":1207,"sourceCode":"      if (val == null) {\n        return eval; // return literal ${var}: var is unbound\n      }\n\n      final int dollar = varBounds[SUB_START_IDX] - \"${\".length();\n      final int afterRightBrace = varBounds[SUB_END_IDX] + \"}\".length();\n      final String refVar = eval.substring(dollar, afterRightBrace);\n\n      // detect self-referential values\n      if (val.contains(refVar)) {\n        return expr; // return original expression if there is a loop\n      }\n\n      // substitute\n      eval = eval.substring(0, dollar)\n             + val\n             + eval.substring(afterRightBrace);\n    }\n    throw new IllegalStateException(\"Variable substitution depth too large: \" \n                                    + MAX_SUBST + \" \" + expr);\n  }\n\n  /**\n   * Get the environment variable value if\n   * {@link #restrictSystemProps} does not block this.\n   * @param name environment variable name.\n   * @return the value or null if either it is unset or access forbidden.\n   */\n  String getenv(String name) {\n    if (!restrictSystemProps) {\n      return System.getenv(name);\n    } else {\n      return null;\n    }\n  }\n\n  /**","sourceCodeStart":1189,"sourceCodeEnd":1225,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java#L1189-L1225","documentation":"Error \"Variable substitution depth too large: 20 {}\" thrown in apache/hadoop.","triggerScenarios":"Raised at runtime when the documented precondition or configuration requirement for this operation is violated.","commonSituations":"Misconfigured or missing property, invalid user input, or calling the API before its prerequisites are met.","solutions":["Simplify the configuration value: nested variable expansion beyond depth 20 indicates a recursive or overly deep property reference."],"exampleFix":"Replace the deeply nested ${...} chain with a direct value.","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"}