{"record":{"id":"dc7eea7792c0ff58","repo":"apache/iceberg","slug":"unrecognized-http-client-type-httpclienttype-dc7eea","errorCode":null,"errorMessage":"Unrecognized HTTP client type ${httpClientType}","messagePattern":"Unrecognized HTTP client type (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"aws/src/main/java/org/apache/iceberg/aws/HttpClientProperties.java","lineNumber":255,"sourceCode":"   */\n  public <T extends AwsSyncClientBuilder> void applyHttpClientConfigurations(T builder) {\n    if (Strings.isNullOrEmpty(httpClientType)) {\n      httpClientType = CLIENT_TYPE_DEFAULT;\n    }\n\n    switch (httpClientType) {\n      case CLIENT_TYPE_URLCONNECTION:\n        UrlConnectionHttpClientConfigurations urlConnectionHttpClientConfigurations =\n            loadHttpClientConfigurations(UrlConnectionHttpClientConfigurations.class.getName());\n        urlConnectionHttpClientConfigurations.configureHttpClientBuilder(builder);\n        break;\n      case CLIENT_TYPE_APACHE:\n        ApacheHttpClientConfigurations apacheHttpClientConfigurations =\n            loadHttpClientConfigurations(ApacheHttpClientConfigurations.class.getName());\n        apacheHttpClientConfigurations.configureHttpClientBuilder(builder);\n        break;\n      default:\n        throw new IllegalArgumentException(\"Unrecognized HTTP client type \" + httpClientType);\n    }\n  }\n\n  /**\n   * Dynamically load the http client builder to avoid runtime deps requirements of both {@link\n   * software.amazon.awssdk.http.urlconnection.UrlConnectionHttpClient} and {@link\n   * software.amazon.awssdk.http.apache.ApacheHttpClient}, since including both will cause error\n   * described in <a href=\"https://github.com/apache/iceberg/issues/6715\">issue#6715</a>\n   */\n  private <T> T loadHttpClientConfigurations(String impl) {\n    Object httpClientConfigurations;\n    try {\n      httpClientConfigurations =\n          DynMethods.builder(\"create\")\n              .hiddenImpl(impl, Map.class)\n              .buildStaticChecked()\n              .invoke(httpClientProperties);\n      return (T) httpClientConfigurations;","sourceCodeStart":237,"sourceCodeEnd":273,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/aws/src/main/java/org/apache/iceberg/aws/HttpClientProperties.java#L237-L273","documentation":"HttpClientProperties.applyHttpClientConfigurations configures the SDK client builder according to the configured HTTP client type. Only 'urlconnection' and 'apache' are supported; any other value reaches the switch's default branch and throws this IllegalArgumentException. The identical message also exists in AwsClientFactories, so check which property source produced it.","triggerScenarios":"Passing an unsupported value in HttpClientProperties.HTTP_CLIENT_TYPE when building an HTTP client configuration (tested via testInvalidHttpClientType), such as 'UrlConnection', 'netty', or an empty/garbage string.","commonSituations":"Wrong casing or hyphenation in client.type; assuming other AWS SDK HTTP clients are supported; config templating injecting a wrong default value.","solutions":["Set the HTTP client type property to HttpClientProperties.CLIENT_TYPE_URLCONNECTION ('urlconnection') or CLIENT_TYPE_APACHE ('apache').","Check the property source (JVM args, Hadoop conf, catalog properties) for a stale or mistyped value.","Remove the property entirely to use the default client type."],"exampleFix":"// before\nprops.put(\"client.type\", \"Apache\"); // wrong casing\n// after\nprops.put(\"client.type\", \"apache\");","handlingStrategy":"validation","validationCode":"String type = props.getOrDefault(\"client.type\", \"apache\");\nif (!Set.of(\"urlconnection\", \"apache\").contains(type)) {\n  throw new IllegalArgumentException(\"Unsupported client.type: \" + type);\n}","typeGuard":null,"tryCatchPattern":"try {\n  clientProps = new HttpClientProperties(props);\n} catch (IllegalArgumentException e) {\n  LOG.error(\"Invalid HTTP client type in config: {}\", e.getMessage());\n  throw e;\n}","preventionTips":["Always use exact lowercase values 'urlconnection' or 'apache'.","Centralize config construction so client.type is set from constants.","Sanitize environment-injected config values (trim, lowercase) before use."],"tags":["aws","configuration","http-client","invalid-enum-value"],"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"}