{"record":{"id":"56ba1b3b189cb12e","repo":"apache/incubator-seata","slug":"config-type-can-not-be-null","errorCode":null,"errorMessage":"config type can not be null","messagePattern":"config type can not be null","errorType":"exception","errorClass":"NotSupportYetException","httpStatus":null,"severity":"critical","filePath":"config/seata-config-core/src/main/java/org/apache/seata/config/ConfigurationFactory.java","lineNumber":152,"sourceCode":"            String pathDataId = String.join(\n                    ConfigurationKeys.FILE_CONFIG_SPLIT_CHAR, ConfigurationKeys.FILE_ROOT_CONFIG, FILE_TYPE, NAME_KEY);\n            String name = CURRENT_FILE_INSTANCE.getConfig(pathDataId);\n            // create FileConfiguration for read file.conf\n            ORIGIN_FILE_INSTANCE = new FileConfiguration(name);\n        }\n    }\n\n    /**\n     * Notes: should not rely on the ConfigType type, as it will prevent the extension of configuration types\n     * implemented externally.\n     * @return\n     */\n    private static String getConfigType() {\n        String configTypeName = CURRENT_FILE_INSTANCE.getConfig(ConfigurationKeys.FILE_ROOT_CONFIG\n                + ConfigurationKeys.FILE_CONFIG_SPLIT_CHAR\n                + ConfigurationKeys.FILE_ROOT_TYPE);\n        if (StringUtils.isBlank(configTypeName)) {\n            throw new NotSupportYetException(\"config type can not be null\");\n        }\n        return configTypeName;\n    }\n\n    public static Optional<FileConfiguration> getOriginFileInstance() {\n        return Optional.ofNullable(ORIGIN_FILE_INSTANCE);\n    }\n\n    private static Configuration buildConfiguration() {\n        String configTypeName = getConfigType();\n        Configuration configuration = ORIGIN_FILE_INSTANCE;\n        Configuration extConfiguration = getSpringConfiguration();\n        if (null == extConfiguration) {\n            Configuration springConfiguration = getNonSpringConfiguration(configTypeName);\n            if (null != springConfiguration) {\n                configuration = springConfiguration;\n            }\n        }","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/apache/incubator-seata/blob/e01f97c6db397165050caa6764020410c2c8199a/config/seata-config-core/src/main/java/org/apache/seata/config/ConfigurationFactory.java#L134-L170","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Add an explicit config block: config { type = \"file\" } (or nacos/apollo/...) in file.conf or registry.conf on the classpath.","Verify the config file is actually loaded (check startup logs for 'file.conf' / registry file location) — a missing file makes every lookup blank.","Set the JVM property seata.config.type (file.root + '.type' key) if you configure programmatically.","Check the key spelling: the lookup is exactly config.type composed from FILE_ROOT_CONFIG + '.' + 'type'."],"exampleFix":"# before\n# file.conf with no config section\nservice { ... }\n\n# after\nconfig {\n  type = \"file\"\n  file { name = \"file.conf\" }\n}","handlingStrategy":"validation","validationCode":"String type = fileConfig.getConfig(\"config.type\");\nif (type == null || type.trim().isEmpty()) {\n    throw new IllegalStateException(\"config.type is required; set it in file.conf/registry.conf or -Dseata.config.type\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always ship an explicit config { type = ... } block in the seata config file","Verify in CI that the packaged artifact contains the config file and that type is non-blank","Log the loaded config file path at startup to catch silent misloads"],"tags":["config","startup","configuration","seata"],"backgroundTag":null,"analyzedSha":"e01f97c6db397165050caa6764020410c2c8199a","analyzedAt":"2026-08-14T10:23:53.097Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}