apache/incubator-seata · error · IllegalArgumentException

name value of custom config type must not be blank

Error message

name value of custom config type must not be blank

What it means

Thrown by CustomConfigurationProvider.provide() when the seata config declares config.type = Custom but the required companion property custom.name is missing, empty, or whitespace. Seata uses that name to load a third-party ConfigurationProvider via SPI, so a blank value cannot be resolved to any provider.

Source

Thrown at config/seata-config-custom/src/main/java/org/apache/seata/config/custom/CustomConfigurationProvider.java:39

import org.apache.seata.common.util.StringUtils;
import org.apache.seata.config.ConfigType;
import org.apache.seata.config.Configuration;
import org.apache.seata.config.ConfigurationFactory;
import org.apache.seata.config.ConfigurationKeys;
import org.apache.seata.config.ConfigurationProvider;

import java.util.stream.Stream;

@LoadLevel(name = "Custom")
public class CustomConfigurationProvider implements ConfigurationProvider {
    @Override
    public Configuration provide() {
        String pathDataId = ConfigurationKeys.FILE_ROOT_CONFIG + ConfigurationKeys.FILE_CONFIG_SPLIT_CHAR
                + ConfigType.Custom.name().toLowerCase() + ConfigurationKeys.FILE_CONFIG_SPLIT_CHAR
                + "name";
        String name = ConfigurationFactory.CURRENT_FILE_INSTANCE.getConfig(pathDataId);
        if (StringUtils.isBlank(name)) {
            throw new IllegalArgumentException("name value of custom config type must not be blank");
        }
        if (Stream.of(ConfigType.values()).anyMatch(ct -> ct.name().equalsIgnoreCase(name))) {
            throw new IllegalArgumentException(String.format("custom config type name %s is not allowed", name));
        }
        return EnhancedServiceLoader.load(ConfigurationProvider.class, name).provide();
    }
}

View on GitHub (pinned to e01f97c6db)

Solutions

  1. Add `config.custom.name = yourProviderName` (the @LoadLevel name of your SPI ConfigurationProvider implementation) alongside `config.type = custom`
  2. Check for typos in the property key — it must be exactly `custom.name` under the config block
  3. Ensure the value has no stray quotes/whitespace if loaded from a properties or yaml file

Example fix

# before
config:
  type: custom

# after
config:
  type: custom
  custom:
    name: myCompanyConfigProvider
Defensive patterns

Strategy: validation

Validate before calling

String name = currentFileInstance.getConfig("config.custom.name");
if (StringUtils.isBlank(name)) throw new IllegalStateException("config.type=custom requires config.custom.name to be set");

Try / catch

try { config = provider.provide(); } catch (IllegalArgumentException e) { fail startup with actionable message including the missing property key; }

Prevention

When it happens

Trigger: Setting `config.type = custom` in application.properties/file.properties (registry via ConfigType.Custom) without also setting `config.custom.name = <provider-name>`. Any blank, empty, or whitespace-only value triggers this at first configuration access (ConfigurationFactory bootstrap).

Common situations: Adopting the Custom config type to plug in a company-internal config center, following docs that show `config.type: custom` but omitting the `custom.name` key, or misspelling the key (e.g. `custom.type` or `customName`).

Related errors


AI-assisted analysis of apache/incubator-seata@e01f97c6db (2026-08-14). Data as JSON: /api/errors/96ef2c2d31c1c802. Report an issue: GitHub.