apache/incubator-seata · critical · NotSupportYetException

config type can not be null

Error message

config type can not be null

What it means

ConfigurationFactory.getConfigType() reads the 'config.type' entry from the loaded file configuration and throws NotSupportYetException('config type can not be null') when it is blank. Without a type, the factory cannot decide which Configuration implementation to build, so bootstrap halts. This is a fail-fast guard during seata config bootstrap.

Source

Thrown at config/seata-config-core/src/main/java/org/apache/seata/config/ConfigurationFactory.java:152

            String pathDataId = String.join(
                    ConfigurationKeys.FILE_CONFIG_SPLIT_CHAR, ConfigurationKeys.FILE_ROOT_CONFIG, FILE_TYPE, NAME_KEY);
            String name = CURRENT_FILE_INSTANCE.getConfig(pathDataId);
            // create FileConfiguration for read file.conf
            ORIGIN_FILE_INSTANCE = new FileConfiguration(name);
        }
    }

    /**
     * Notes: should not rely on the ConfigType type, as it will prevent the extension of configuration types
     * implemented externally.
     * @return
     */
    private static String getConfigType() {
        String configTypeName = CURRENT_FILE_INSTANCE.getConfig(ConfigurationKeys.FILE_ROOT_CONFIG
                + ConfigurationKeys.FILE_CONFIG_SPLIT_CHAR
                + ConfigurationKeys.FILE_ROOT_TYPE);
        if (StringUtils.isBlank(configTypeName)) {
            throw new NotSupportYetException("config type can not be null");
        }
        return configTypeName;
    }

    public static Optional<FileConfiguration> getOriginFileInstance() {
        return Optional.ofNullable(ORIGIN_FILE_INSTANCE);
    }

    private static Configuration buildConfiguration() {
        String configTypeName = getConfigType();
        Configuration configuration = ORIGIN_FILE_INSTANCE;
        Configuration extConfiguration = getSpringConfiguration();
        if (null == extConfiguration) {
            Configuration springConfiguration = getNonSpringConfiguration(configTypeName);
            if (null != springConfiguration) {
                configuration = springConfiguration;
            }
        }

View on GitHub (pinned to e01f97c6db)

Solutions

  1. Add an explicit config block: config { type = "file" } (or nacos/apollo/...) in file.conf or registry.conf on the classpath.
  2. Verify the config file is actually loaded (check startup logs for 'file.conf' / registry file location) — a missing file makes every lookup blank.
  3. Set the JVM property seata.config.type (file.root + '.type' key) if you configure programmatically.
  4. Check the key spelling: the lookup is exactly config.type composed from FILE_ROOT_CONFIG + '.' + 'type'.

Example fix

# before
# file.conf with no config section
service { ... }

# after
config {
  type = "file"
  file { name = "file.conf" }
}
Defensive patterns

Strategy: validation

Validate before calling

String type = fileConfig.getConfig("config.type");
if (type == null || type.trim().isEmpty()) {
    throw new IllegalStateException("config.type is required; set it in file.conf/registry.conf or -Dseata.config.type");
}

Prevention

When it happens

Trigger: file.conf/registry.conf missing the config { type = ... } block; the config file itself not found on the classpath so CURRENT_FILE_INSTANCE returns blank for every key; type key misspelled (e.g. 'configType'); a blank/quoted-empty value from environment overrides.

Common situations: Spring Boot apps packaging seata without a registry.conf/file.conf in resources; custom deployments that set only -Dseata.config.type on a JVM where the file took precedence; malformed HOCON/properties files silently failing to parse; upgrading seata where config file layout changed.

Related errors


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