{"record":{"id":"b600f4bd9a961e74","repo":"apache/seatunnel","slug":"checkresult-getmsg","errorCode":null,"errorMessage":"checkResult.getMsg()","messagePattern":"checkResult\\.getMsg\\(\\)","errorType":"validation","errorClass":"ConfigCheckException","httpStatus":null,"severity":"error","filePath":"seatunnel-core/seatunnel-core-starter/src/main/java/org/apache/seatunnel/core/starter/utils/ConfigValidationUtils.java","lineNumber":115,"sourceCode":"                        for (URL url : urls) {\n                            method.get().invoke(classLoader, url);\n                        }\n                    } catch (Exception e) {\n                        throw new RuntimeException(\n                                \"Unsupported classloader: \" + classLoader.getClass().getName(), e);\n                    }\n                }\n            };\n\n    private ConfigValidationUtils() {}\n\n    public static void validate(Config config) {\n        validate(config, CheckResult.success());\n    }\n\n    public static void validate(Config config, CheckResult checkResult) {\n        if (!checkResult.isSuccess()) {\n            throw new ConfigCheckException(checkResult.getMsg());\n        }\n\n        ClassLoader parentClassLoader = Thread.currentThread().getContextClassLoader();\n        ClassLoader validationClassLoader = prepareClassLoader(config, parentClassLoader);\n        Thread.currentThread().setContextClassLoader(validationClassLoader);\n        try {\n            validateEnvironmentConfig(config);\n            JobContext jobContext = new JobContext();\n            jobContext.setJobMode(RuntimeEnvironment.getJobMode(config));\n            jobContext.setEnableCheckpoint(RuntimeEnvironment.getEnableCheckpoint(config));\n\n            List<TableInfo> sourceTables =\n                    validateSources(\n                            TypesafeConfigUtils.getConfigList(\n                                    config, Constants.SOURCE, Collections.emptyList()),\n                            jobContext);\n            if (sourceTables.isEmpty()) {\n                throw new ConfigCheckException(\"At least one source plugin must be configured.\");","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-core/seatunnel-core-starter/src/main/java/org/apache/seatunnel/core/starter/utils/ConfigValidationUtils.java#L97-L133","documentation":"ConfigValidationUtils.validate checks the provided CheckResult and throws ConfigCheckException(checkResult.getMsg()) when it is not a success, then proceeds with plugin validation. The message text is whatever the failed check produced (the message shown is the msg accessor used at that throw site).","triggerScenarios":"Calling ConfigValidationUtils.validate(config, checkResult) with a failed CheckResult, typically from testValidSourceConfiguration/testValidSinkConfiguration after plugin check() reported an error.","commonSituations":"Plugin factory checks (missing options, invalid ranges) return failed CheckResults; unit tests using assertInvalid; hand-built CheckResult passed by mistake.","solutions":["Read the exception message (the check's msg) and fix the corresponding config option","Run the config through the plugin docs to satisfy required options before validating","In tests, expect ConfigCheckException for invalid configs; ensure success results are built with CheckResult.success()"],"exampleFix":"// before\nCheckResult r = sourceFactory.check(cfg);\nConfigValidationUtils.validate(config, r);\n// after\nCheckResult r = sourceFactory.check(cfg);\nif (!r.isSuccess()) { log.error(\"Config invalid: {}\", r.getMsg()); return; }\nConfigValidationUtils.validate(config, r);","handlingStrategy":"validation","validationCode":"CheckResult r = factory.check(cfg); if (!r.isSuccess()) { throw new ConfigCheckException(r.getMsg()); }","typeGuard":null,"tryCatchPattern":"try { ConfigValidationUtils.validate(config, checkResult); } catch (ConfigCheckException e) { log.error(\"Config check failed: {}\", e.getMessage()); }","preventionTips":["Always run plugin factory check() before validate","Build success results with CheckResult.success()","Surface r.getMsg() to users verbatim"],"tags":["validation","config","plugin"],"backgroundTag":"schema-validation-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T21:17:11.552Z"}