{"record":{"id":"deadd780695fce07","repo":"flowable/flowable-engine","slug":"the-config-is-null-deadd7","errorCode":null,"errorMessage":"The config is null","messagePattern":"The config is null","errorType":"exception","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/ManagementServiceImpl.java","lineNumber":431,"sourceCode":"                ProcessEngineConfigurationImpl engineConfiguration = CommandContextUtil.getProcessEngineConfiguration(commandContext);\n                engineConfiguration.getCommonSchemaManager().schemaUpdate();\n                return engineConfiguration.getSchemaManager().schemaUpdate();\n            }\n        });\n    }\n\n    @Override\n    public <T> T executeCommand(Command<T> command) {\n        if (command == null) {\n            throw new FlowableIllegalArgumentException(\"The command is null\");\n        }\n        return commandExecutor.execute(command);\n    }\n\n    @Override\n    public <T> T executeCommand(CommandConfig config, Command<T> command) {\n        if (config == null) {\n            throw new FlowableIllegalArgumentException(\"The config is null\");\n        }\n        if (command == null) {\n            throw new FlowableIllegalArgumentException(\"The command is null\");\n        }\n        return commandExecutor.execute(config, command);\n    }\n\n    @Override\n    public LockManager getLockManager(String lockName) {\n        return new LockManagerImpl(commandExecutor, lockName, getConfiguration().getLockPollRate(), configuration.getEngineCfgKey());\n    }\n\n    @Override\n    public <MapperType, ResultType> ResultType executeCustomSql(CustomSqlExecution<MapperType, ResultType> customSqlExecution) {\n        Class<MapperType> mapperClass = customSqlExecution.getMapperClass();\n        return commandExecutor.execute(new ExecuteCustomSqlCmd<>(mapperClass, customSqlExecution));\n    }\n","sourceCodeStart":413,"sourceCodeEnd":449,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/ManagementServiceImpl.java#L413-L449","documentation":"ManagementServiceImpl.executeCommand(CommandConfig, Command) validates both parameters before delegating to the command executor. It throws FlowableIllegalArgumentException when the CommandConfig is null, because the interceptor chain that wraps the command requires a config (e.g. default or custom retry/log configuration). This is a fail-fast null-argument guard.","triggerScenarios":"Calling managementService.executeCommand(config, command) with a null config, e.g. when the config was resolved from configuration that was absent, or a helper returning null config.","commonSituations":"Developers copying the single-argument executeCommand overload and adding a config sourced from a properties map that returned null; refactoring around CommandConfigFactory; dynamic config selection logic with no default branch.","solutions":["Pass an explicit config, e.g. managementService.executeCommand(new DefaultCommandConfig(), command)","Fall back to the single-argument overload executeCommand(command) which uses the default config","Null-check the config before invoking and substitute processEngineConfiguration.getDefaultCommandConfig()","Review config-loading code for missing defaults"],"exampleFix":"// before\nCommandConfig cfg = loadConfig(); // may return null\nmanagementService.executeCommand(cfg, cmd);\n// after\nCommandConfig cfg = loadConfig();\nif (cfg == null) {\n    cfg = processEngineConfiguration.getDefaultCommandConfig();\n}\nmanagementService.executeCommand(cfg, cmd);","handlingStrategy":"type-guard","validationCode":"if (config == null) { config = processEngineConfiguration.getDefaultCommandConfig(); }\nmanagementService.executeCommand(config, command);","typeGuard":"boolean hasConfig(CommandConfig c) { return c != null; }","tryCatchPattern":"try {\n    managementService.executeCommand(config, command);\n} catch (FlowableIllegalArgumentException e) {\n    log.error(\"executeCommand rejected arguments: {}\", e.getMessage());\n}","preventionTips":["Prefer the single-argument executeCommand overload unless a custom config is truly needed","Centralize config resolution so it always yields a non-null CommandConfig","Add defaults when loading CommandConfig from properties/config files"],"tags":["java","flowable","null-argument","validation"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}