{"record":{"id":"329f64e4cc0ad1fb","repo":"apache/hadoop","slug":"missing-value-for-configuration-option","errorCode":null,"errorMessage":"Missing value for configuration option {}","messagePattern":"Missing value for configuration option (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/RegistrySecurity.java","lineNumber":432,"sourceCode":"    if (usesRealm) {\n      userName = ugi.getUserName();\n    } else {\n      userName = ugi.getShortUserName();\n    }\n    return new ACL(perms, new Id(SCHEME_SASL, userName));\n  }\n\n  /**\n   * Get a conf option, throw an exception if it is null/empty\n   * @param key key\n   * @param defval default value\n   * @return the value\n   * @throws IOException if missing\n   */\n  private String getOrFail(String key, String defval) throws IOException {\n    String val = getConfig().get(key, defval);\n    if (StringUtils.isEmpty(val)) {\n      throw new IOException(\"Missing value for configuration option \" + key);\n    }\n    return val;\n  }\n\n  /**\n   * Check for an id:password tuple being valid.\n   * This test is stricter than that in {@link DigestAuthenticationProvider},\n   * which splits the string, but doesn't check the contents of each\n   * half for being non-\"\".\n   * @param idPasswordPair id:pass pair\n   * @return true if the pass is considered valid.\n   */\n  public boolean isValid(String idPasswordPair) {\n    String[] parts = idPasswordPair.split(\":\");\n    return parts.length == 2\n           && !StringUtils.isEmpty(parts[0])\n           && !StringUtils.isEmpty(parts[1]);\n  }","sourceCodeStart":414,"sourceCodeEnd":450,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/RegistrySecurity.java#L414-L450","documentation":"RegistrySecurity.getOrFail(key, defval) reads a configuration option with a default and throws IOException('Missing value for configuration option <key>') when the effective value is null or empty. It guards the JAAS context (hadoop.registry.jaas.context, default 'Client') in SASL mode and the digest credentials (hadoop.registry.client.auth.id / .password, default '') in digest mode — the message always names the exact missing key.","triggerScenarios":"client.auth=digest without hadoop.registry.client.auth.id or hadoop.registry.client.auth.password set (their empty-string defaults trigger the throw); hadoop.registry.jaas.context explicitly set to an empty string; whitespace-only property values.","commonSituations":"Setting client.auth by hand instead of using RegistryOperationsFactory; partial secure configurations copied between clusters; an empty override of the property in some *-site.xml shadowing a real value.","solutions":["Set the option named in the message to a non-empty value — for digest both hadoop.registry.client.auth.id and hadoop.registry.client.auth.password.","Or use RegistryOperationsFactory.createAuthenticatedInstance(conf, id, password) / createKerberosInstance, which populate these keys correctly.","Audit configuration for empty-string overrides and whitespace-only values of the named key."],"exampleFix":"// before\nconf.set(\"hadoop.registry.client.auth\", \"digest\");\n// id/password never set -> IOException: Missing value for configuration option hadoop.registry.client.auth.id\n\n// after\nconf.set(\"hadoop.registry.client.auth.id\", \"registry\");\nconf.set(\"hadoop.registry.client.auth.password\", \"secret\");\n// or: RegistryOperationsFactory.createAuthenticatedInstance(conf, \"registry\", \"secret\", null);","handlingStrategy":"validation","validationCode":"for (String key : new String[] {\n    \"hadoop.registry.client.auth.id\", \"hadoop.registry.client.auth.password\"}) {\n  if (StringUtils.isEmpty(conf.get(key, \"\"))) {\n    throw new IllegalArgumentException(\"Missing value for configuration option \" + key);\n  }\n}\nRegistryOperations ops = RegistryOperationsFactory.createAuthenticatedInstance(conf, id, pass, null);","typeGuard":null,"tryCatchPattern":"try {\n  RegistryOperations ops = RegistryOperationsFactory.createAuthenticatedInstance(conf, id, pass, null);\n} catch (IOException e) {\n  if (e.getMessage().startsWith(\"Missing value for configuration option\")) {\n    // message names the exact key: set it (e.g. auth.id / auth.password / jaas.context) and retry\n  }\n}","preventionTips":["Use the factory methods (createAuthenticatedInstance/createKerberosInstance) which set the dependent keys together.","Watch for empty-string overrides of registry keys in later-loaded site XML files.","Validate that any config key ending in a credential or context is non-empty before client creation."],"tags":["registry","configuration","missing-config","authentication","hadoop-registry"],"backgroundTag":"missing-config-value","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}