apache/iceberg · error · IllegalArgumentException

Unrecognized HTTP client type ${httpClientType}

Error message

Unrecognized HTTP client type ${httpClientType}

What it means

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.

Source

Thrown at aws/src/main/java/org/apache/iceberg/aws/HttpClientProperties.java:255

   */
  public <T extends AwsSyncClientBuilder> void applyHttpClientConfigurations(T builder) {
    if (Strings.isNullOrEmpty(httpClientType)) {
      httpClientType = CLIENT_TYPE_DEFAULT;
    }

    switch (httpClientType) {
      case CLIENT_TYPE_URLCONNECTION:
        UrlConnectionHttpClientConfigurations urlConnectionHttpClientConfigurations =
            loadHttpClientConfigurations(UrlConnectionHttpClientConfigurations.class.getName());
        urlConnectionHttpClientConfigurations.configureHttpClientBuilder(builder);
        break;
      case CLIENT_TYPE_APACHE:
        ApacheHttpClientConfigurations apacheHttpClientConfigurations =
            loadHttpClientConfigurations(ApacheHttpClientConfigurations.class.getName());
        apacheHttpClientConfigurations.configureHttpClientBuilder(builder);
        break;
      default:
        throw new IllegalArgumentException("Unrecognized HTTP client type " + httpClientType);
    }
  }

  /**
   * Dynamically load the http client builder to avoid runtime deps requirements of both {@link
   * software.amazon.awssdk.http.urlconnection.UrlConnectionHttpClient} and {@link
   * software.amazon.awssdk.http.apache.ApacheHttpClient}, since including both will cause error
   * described in <a href="https://github.com/apache/iceberg/issues/6715">issue#6715</a>
   */
  private <T> T loadHttpClientConfigurations(String impl) {
    Object httpClientConfigurations;
    try {
      httpClientConfigurations =
          DynMethods.builder("create")
              .hiddenImpl(impl, Map.class)
              .buildStaticChecked()
              .invoke(httpClientProperties);
      return (T) httpClientConfigurations;

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Set the HTTP client type property to HttpClientProperties.CLIENT_TYPE_URLCONNECTION ('urlconnection') or CLIENT_TYPE_APACHE ('apache').
  2. Check the property source (JVM args, Hadoop conf, catalog properties) for a stale or mistyped value.
  3. Remove the property entirely to use the default client type.

Example fix

// before
props.put("client.type", "Apache"); // wrong casing
// after
props.put("client.type", "apache");
Defensive patterns

Strategy: validation

Validate before calling

String type = props.getOrDefault("client.type", "apache");
if (!Set.of("urlconnection", "apache").contains(type)) {
  throw new IllegalArgumentException("Unsupported client.type: " + type);
}

Try / catch

try {
  clientProps = new HttpClientProperties(props);
} catch (IllegalArgumentException e) {
  LOG.error("Invalid HTTP client type in config: {}", e.getMessage());
  throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: Wrong casing or hyphenation in client.type; assuming other AWS SDK HTTP clients are supported; config templating injecting a wrong default value.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12). Data as JSON: /api/errors/dc7eea7792c0ff58. Report an issue: GitHub.