{"record":{"id":"a565f5ff6a6a2208","repo":"apache/hadoop","slug":"name-is-null-empty-or-contains-a","errorCode":null,"errorMessage":"${name} is NULL, empty or contains a '&'","messagePattern":"(.+?) is NULL, empty or contains a '&'","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":401,"severity":"error","filePath":"hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/util/AuthToken.java","lineNumber":91,"sourceCode":"    checkForIllegalArgument(userName, \"userName\");\n    checkForIllegalArgument(principal, \"principal\");\n    checkForIllegalArgument(type, \"type\");\n    this.userName = userName;\n    this.principal = principal;\n    this.type = type;\n    this.maxInactives = -1;\n    this.expires = -1;\n  }\n  \n  /**\n   * Check if the provided value is invalid. Throw an error if it is invalid, NOP otherwise.\n   * \n   * @param value the value to check.\n   * @param name the parameter name to use in an error message if the value is invalid.\n   */\n  protected static void checkForIllegalArgument(String value, String name) {\n    if (value == null || value.length() == 0 || value.contains(ATTR_SEPARATOR)) {\n      throw new IllegalArgumentException(name + ILLEGAL_ARG_MSG);\n    }\n  }\n\n  /**\n   * Sets the max inactive interval of the token.\n   *\n   * @param interval max inactive interval of the token in milliseconds since\n   *                 the epoch.\n   */\n  public void setMaxInactives(long interval) {\n    this.maxInactives = interval;\n  }\n\n  /**\n   * Sets the expiration of the token.\n   *\n   * @param expires expiration time of the token in milliseconds since the epoch.\n   */","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/util/AuthToken.java#L73-L109","documentation":"Error \"${name} is NULL, empty or contains a '&'\" 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":["Pass a token attribute name that is non-null, non-empty, and contains no '&' character."],"exampleFix":"Use simple attribute names such as 'u' or 'e' when building the token.","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"}