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
- 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.
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
- 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.
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
- Unrecognized HTTP client type ${httpClientType}
- Cannot initialize AwsClientFactory, missing no-arg construct
- Cannot initialize AwsClientFactory, %s does not implement Aw
- Cannot acquire closed HTTP client: ${clientKey}
- Cannot create %s to generate and configure the http client b
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/dc7eea7792c0ff58.
Report an issue: GitHub.