{"record":{"id":"17f4feba449b94a6","repo":"flowable/flowable-engine","slug":"invalid-command-interceptor-chain-configuration","errorCode":null,"errorMessage":"invalid command interceptor chain configuration: ","messagePattern":"invalid command interceptor chain configuration: ","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfiguration.java","lineNumber":620,"sourceCode":"\n    public abstract String getEngineCfgKey();\n    \n    public abstract String getEngineScopeType();\n\n    public List<CommandInterceptor> getAdditionalDefaultCommandInterceptors() {\n        return null;\n    }\n\n    public void initCommandExecutor() {\n        if (commandExecutor == null) {\n            CommandInterceptor first = initInterceptorChain(commandInterceptors);\n            commandExecutor = new CommandExecutorImpl(getDefaultCommandConfig(), first);\n        }\n    }\n\n    public CommandInterceptor initInterceptorChain(List<CommandInterceptor> chain) {\n        if (chain == null || chain.isEmpty()) {\n            throw new FlowableException(\"invalid command interceptor chain configuration: \" + chain);\n        }\n        for (int i = 0; i < chain.size() - 1; i++) {\n            chain.get(i).setNext(chain.get(i + 1));\n        }\n        return chain.get(0);\n    }\n\n    public abstract CommandInterceptor createTransactionInterceptor();\n\n\n    public void initBeans() {\n        if (beans == null) {\n            beans = new HashMap<>();\n        }\n    }\n\n    // id generator\n    // /////////////////////////////////////////////////////////////","sourceCodeStart":602,"sourceCodeEnd":638,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfiguration.java#L602-L638","documentation":"The command interceptor chain is the pipeline of CommandInterceptor objects that wraps every engine command. initInterceptorChain requires a non-null, non-empty list to link the interceptors; otherwise the CommandExecutor would have no chain head, so this FlowableException is thrown.","triggerScenarios":"Calling initInterceptorChain(chain) (directly or via initCommandInterceptors/customizations) with a null or empty interceptor list, typically from a custom config that overrides initInterceptorChain or clears commandInterceptors.","commonSituations":"Custom engine configuration removing/replacing the default interceptor chain without adding any interceptors; subclass overriding initCommandInterceptors and forgetting to populate the list.","solutions":["Ensure the command interceptor chain contains at least one interceptor (ending with CommandInvoker)","Check overrides of initCommandInterceptors/initInterceptorChain for logic that can return an empty list","Restore the default interceptor configuration or append your interceptor to the existing chain instead of replacing it"],"exampleFix":"// before\nconfig.setCommandInterceptors(Collections.emptyList());\n// after\nList<CommandInterceptor> interceptors = new ArrayList<>();\ninterceptors.add(new LogInterceptor());\ninterceptors.add(new CommandInvoker());\nconfig.setCommandInterceptors(interceptors);","handlingStrategy":"validation","validationCode":"List<CommandInterceptor> chain = config.getCommandInterceptors(); if (chain == null || chain.isEmpty()) { throw new IllegalStateException(\"command interceptor chain must not be empty\"); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never set an empty interceptor list on the engine configuration","When customizing, append to the default chain rather than replacing it","Always terminate the chain with CommandInvoker"],"tags":["flowable","interceptor-chain","configuration"],"backgroundTag":"empty-required-field","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}