{"record":{"id":"7104f0d456f83ec6","repo":"apache/seatunnel","slug":"provided-string-configuration-is-null-or-empty-pl","errorCode":null,"errorMessage":"provided string configuration is null or empty! Please use a well-structured content.","messagePattern":"provided string configuration is null or empty! Please use a well-structured content\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-engine/seatunnel-engine-common/src/main/java/org/apache/seatunnel/engine/common/config/ConfigProvider.java","lineNumber":86,"sourceCode":"            // 3. Loading the default YAML configuration file\n            yamlConfigLocator.locateDefault();\n            config =\n                    new YamlSeaTunnelConfigBuilder(yamlConfigLocator)\n                            .setProperties(properties)\n                            .build();\n        }\n        return config;\n    }\n\n    public static SeaTunnelConfig locateAndGetSeaTunnelConfigFromString(String source) {\n        return locateAndGetSeaTunnelConfigFromString(source, null);\n    }\n\n    @NonNull public static SeaTunnelConfig locateAndGetSeaTunnelConfigFromString(\n            String source, Properties properties) {\n        SeaTunnelConfig config;\n        if (isNullOrEmptyAfterTrim(source)) {\n            throw new IllegalArgumentException(\n                    \"provided string configuration is null or empty! \"\n                            + \"Please use a well-structured content.\");\n        }\n        byte[] bytes = source.getBytes();\n        // Try loading YAML config from the source Text String\n        config =\n                new YamlSeaTunnelConfigBuilder(new ByteArrayInputStream(bytes))\n                        .setProperties(properties)\n                        .build();\n        return config;\n    }\n\n    @NonNull public static ClientConfig locateAndGetClientConfig() {\n        validateSuffixInSystemProperty(SYSPROP_CLIENT_CONFIG);\n\n        ClientConfig config;\n        YamlClientConfigLocator yamlConfigLocator = new YamlClientConfigLocator();\n","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-engine/seatunnel-engine-common/src/main/java/org/apache/seatunnel/engine/common/config/ConfigProvider.java#L68-L104","documentation":"ConfigProvider.locateAndGetSeaTunnelConfigFromString builds a SeaTunnelConfig from an inline config string. It rejects null, empty, or whitespace-only input up front with IllegalArgumentException because there is nothing to parse.","triggerScenarios":"Calling locateAndGetSeaTunnelConfigFromString(source, properties) with source == null, \"\", or whitespace-only.","commonSituations":"File-reading helper silently returning empty on a missing file; unset environment variable or secret holding the config; template substitution producing an empty string.","solutions":["Load the config content correctly and assert it is non-empty before calling the API.","Fix the upstream source (env var, secret, template) so it contains actual config text.","Fall back to file-based locateAndGetSeaTunnelConfig() when the inline source is blank."],"exampleFix":"// before\nSeaTunnelConfig cfg = ConfigProvider.locateAndGetSeaTunnelConfigFromString(configString, props);\n// after\nif (configString == null || configString.trim().isEmpty()) {\n    throw new IllegalStateException(\"config content missing from source\");\n}\nSeaTunnelConfig cfg = ConfigProvider.locateAndGetSeaTunnelConfigFromString(configString, props);","handlingStrategy":"validation","validationCode":"if (source == null || source.trim().isEmpty()) {\n    throw new IllegalArgumentException(\"inline config content is empty; check file/env source\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    return ConfigProvider.locateAndGetSeaTunnelConfigFromString(source, props);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"null or empty\")) {\n        return ConfigProvider.locateAndGetSeaTunnelConfig();\n    }\n    throw e;\n}","preventionTips":["Assert config content non-empty right after loading it.","Log the source name (path/env var) when the string is empty.","Prefer file-based config lookup unless inline content is required."],"tags":["config","validation","yaml"],"backgroundTag":"empty-required-field","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}