{"record":{"id":"44be4777d8ea0678","repo":"apache/iceberg","slug":"unknown-key-element-s","errorCode":null,"errorMessage":"Unknown key element %s","messagePattern":"Unknown key element (.+?)","errorType":"validation","errorClass":"ValidationException","httpStatus":400,"severity":"error","filePath":"hive-metastore/src/main/java/org/apache/iceberg/hive/CachedClientPool.java","lineNumber":160,"sourceCode":"    Map<String, String> confElements = Maps.newTreeMap();\n    for (String element : cacheKeys.split(\",\", -1)) {\n      String trimmed = element.trim();\n      if (trimmed.toLowerCase(Locale.ROOT).startsWith(CONF_ELEMENT_PREFIX)) {\n        String key = trimmed.substring(CONF_ELEMENT_PREFIX.length());\n        ValidationException.check(\n            !confElements.containsKey(key), \"Conf key element %s already specified\", key);\n        confElements.put(key, conf.get(key));\n      } else {\n        KeyElementType type = KeyElementType.valueOf(trimmed.toUpperCase(Locale.ROOT));\n        switch (type) {\n          case UGI:\n          case USER_NAME:\n            ValidationException.check(\n                !types.contains(type), \"%s key element already specified\", type.name());\n            types.add(type);\n            break;\n          default:\n            throw new ValidationException(\"Unknown key element %s\", trimmed);\n        }\n      }\n    }\n    for (KeyElementType type : types) {\n      switch (type) {\n        case UGI:\n          try {\n            elements.add(UserGroupInformation.getCurrentUser());\n          } catch (IOException e) {\n            throw new UncheckedIOException(e);\n          }\n          break;\n        case USER_NAME:\n          try {\n            elements.add(UserGroupInformation.getCurrentUser().getUserName());\n          } catch (IOException e) {\n            throw new UncheckedIOException(e);\n          }","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/hive-metastore/src/main/java/org/apache/iceberg/hive/CachedClientPool.java#L142-L178","documentation":"CachedClientPool.extractKey() throws ValidationException when an entry in the configured client-pool key (e.g. HiveConf client pool key elements) is not one of the recognized KeyElementType values (UGI, USER_NAME, etc.). It means an unknown element was supplied in the comma-separated key-element configuration.","triggerScenarios":"Setting the client-pool key-element property to a token that does not match any KeyElementType enum, e.g. a typo or unsupported element name; extractKey() parses the trimmed tokens in a switch and hits default.","commonSituations":"Typo in configuration (e.g. 'ugi ' vs 'UGI' handled, but 'user' vs 'username' not); upgrading Iceberg where an element name changed; copying config from another connector with different element names.","solutions":["Fix the key-element configuration to use only supported values (ugi, user_name)","Check the KeyElementType enum in the Iceberg version you use for exact names","Remove unknown elements from the client-pool key configuration"],"exampleFix":"// before\nclient.pool.key-elements = user,ugi\n// after\nclient.pool.key-elements = user_name,ugi","handlingStrategy":"validation","validationCode":"Set<String> valid = Set.of(\"ugi\",\"user_name\"); // check every configured element against KeyElementType names before building the pool","typeGuard":null,"tryCatchPattern":"try { new CachedClientPool(dbName, conf, keyElements, ...); } catch (ValidationException e) { /* log bad element name, fall back to defaults */ }","preventionTips":["Copy key-element values only from the enum for your Iceberg version","Add startup-time config validation","Avoid hand-editing connector configs without checking docs"],"tags":["hive","configuration","validation"],"backgroundTag":"invalid-enum-value","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}