{"record":{"id":"96ef2c2d31c1c802","repo":"apache/incubator-seata","slug":"name-value-of-custom-config-type-must-not-be-blank","errorCode":null,"errorMessage":"name value of custom config type must not be blank","messagePattern":"name value of custom config type must not be blank","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"config/seata-config-custom/src/main/java/org/apache/seata/config/custom/CustomConfigurationProvider.java","lineNumber":39,"sourceCode":"import org.apache.seata.common.util.StringUtils;\nimport org.apache.seata.config.ConfigType;\nimport org.apache.seata.config.Configuration;\nimport org.apache.seata.config.ConfigurationFactory;\nimport org.apache.seata.config.ConfigurationKeys;\nimport org.apache.seata.config.ConfigurationProvider;\n\nimport java.util.stream.Stream;\n\n@LoadLevel(name = \"Custom\")\npublic class CustomConfigurationProvider implements ConfigurationProvider {\n    @Override\n    public Configuration provide() {\n        String pathDataId = ConfigurationKeys.FILE_ROOT_CONFIG + ConfigurationKeys.FILE_CONFIG_SPLIT_CHAR\n                + ConfigType.Custom.name().toLowerCase() + ConfigurationKeys.FILE_CONFIG_SPLIT_CHAR\n                + \"name\";\n        String name = ConfigurationFactory.CURRENT_FILE_INSTANCE.getConfig(pathDataId);\n        if (StringUtils.isBlank(name)) {\n            throw new IllegalArgumentException(\"name value of custom config type must not be blank\");\n        }\n        if (Stream.of(ConfigType.values()).anyMatch(ct -> ct.name().equalsIgnoreCase(name))) {\n            throw new IllegalArgumentException(String.format(\"custom config type name %s is not allowed\", name));\n        }\n        return EnhancedServiceLoader.load(ConfigurationProvider.class, name).provide();\n    }\n}\n","sourceCodeStart":21,"sourceCodeEnd":47,"githubUrl":"https://github.com/apache/incubator-seata/blob/e01f97c6db397165050caa6764020410c2c8199a/config/seata-config-custom/src/main/java/org/apache/seata/config/custom/CustomConfigurationProvider.java#L21-L47","documentation":"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.","triggerScenarios":"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).","commonSituations":"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`).","solutions":["Add `config.custom.name = yourProviderName` (the @LoadLevel name of your SPI ConfigurationProvider implementation) alongside `config.type = custom`","Check for typos in the property key — it must be exactly `custom.name` under the config block","Ensure the value has no stray quotes/whitespace if loaded from a properties or yaml file"],"exampleFix":"# before\nconfig:\n  type: custom\n\n# after\nconfig:\n  type: custom\n  custom:\n    name: myCompanyConfigProvider","handlingStrategy":"validation","validationCode":"String name = currentFileInstance.getConfig(\"config.custom.name\");\nif (StringUtils.isBlank(name)) throw new IllegalStateException(\"config.type=custom requires config.custom.name to be set\");","typeGuard":null,"tryCatchPattern":"try { config = provider.provide(); } catch (IllegalArgumentException e) { fail startup with actionable message including the missing property key; }","preventionTips":["Treat config.type=custom and custom.name as a pair in config templates","Add a startup smoke test that boots ConfigurationFactory with your config","Lint seata config keys in CI"],"tags":["config","seata","spi","custom-provider"],"backgroundTag":null,"analyzedSha":"e01f97c6db397165050caa6764020410c2c8199a","analyzedAt":"2026-08-14T10:23:53.097Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}