{"record":{"id":"54fe75e902d55e16","repo":"apache/cassandra","slug":"must-specify-param-for-op","errorCode":null,"errorMessage":"Must specify 'param' for \" + op","messagePattern":"Must specify 'param' for \" \\+ op","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java","lineNumber":2055,"sourceCode":"                        break;\n                }\n            }\n\n            if (op == null)\n                throw new IllegalArgumentException(\"Must specify 'op'\");\n\n            final AccordService accord = (AccordService) AccordService.unsafeInstance();\n            final Node node = accord.node();\n            final Function<CommandStore, AsyncResult<?>> function;\n            Supplier<AsyncResult<?>> allFunction = null;\n            switch (op)\n            {\n                default: throw new UnhandledEnum(op);\n                case SET_PROGRESS_LOG_MODE:\n                case UNSET_PROGRESS_LOG_MODE:\n                {\n                    if (param == null)\n                        throw new IllegalArgumentException(\"Must specify 'param' for \" + op);\n                    ModeFlag mode = tryParse(param, true, ModeFlag.class, ModeFlag::valueOf);\n                    boolean set = op == CommandStoreOp.SET_PROGRESS_LOG_MODE;\n                    function = commandStore -> {\n                        DefaultProgressLog progressLog = ((DefaultProgressLog)commandStore.unsafeProgressLog());\n                        if (set) progressLog.setMode(mode);\n                        else progressLog.unsetMode(mode);\n                        return AsyncResults.success(null);\n                    };\n                    break;\n                }\n                case TRY_EXECUTE_LISTENING:\n                {\n                    boolean loop;\n                    if (param == null) loop = false;\n                    else if (param.equalsIgnoreCase(\"loop\")) loop = true;\n                    else throw new InvalidRequestException(\"Unknown param for \" + CommandStoreOp.TRY_EXECUTE_LISTENING + \": '\" + param + \"'; expect only 'loop' or missing\");\n\n                    function = commandStore -> commandStore.tryToExecuteListeningTxns(loop);","sourceCodeStart":2037,"sourceCodeEnd":2073,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java#L2037-L2073","documentation":"For the CommandStoreOps SET_PROGRESS_LOG_MODE and UNSET_PROGRESS_LOG_MODE, the 'param' column is mandatory because it names the ModeFlag to set/unset. When param is null an IllegalArgumentException(\"Must specify 'param' for <op>\") is thrown.","triggerScenarios":"INSERTing into system_views.accord_command_store_ops with op = 'SET_PROGRESS_LOG_MODE' or 'UNSET_PROGRESS_LOG_MODE' but omitting the 'param' column or leaving it NULL.","commonSituations":"Assuming mode ops work without an argument like other ops (e.g. REPLAY); templates copied from ops that don't need params.","solutions":["Supply 'param' with a valid ModeFlag name (e.g. mode enum value used by DefaultProgressLog).","If the intent was not a mode change, choose the correct op that takes no param.","Verify ModeFlag enum values in the source before writing."],"exampleFix":"// before\nINSERT INTO system_views.accord_command_store_ops (command_store_id, op) VALUES (0, 'SET_PROGRESS_LOG_MODE');\n// after\nINSERT INTO system_views.accord_command_store_ops (command_store_id, op, param) VALUES (0, 'SET_PROGRESS_LOG_MODE', 'NORMAL');","handlingStrategy":"validation","validationCode":"if ((op.equals(\"SET_PROGRESS_LOG_MODE\") || op.equals(\"UNSET_PROGRESS_LOG_MODE\")) && (param == null || param.isBlank()))\n    throw new IllegalArgumentException(\"op \" + op + \" requires the 'param' column with a ModeFlag value\");","typeGuard":null,"tryCatchPattern":"try {\n    session.execute(insert);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Must specify 'param' for\")) {\n        // re-issue the INSERT including param = <ModeFlag>\n    }\n}","preventionTips":["Treat SET/UNSET_PROGRESS_LOG_MODE as parameterized ops that always need 'param'.","Validate ModeFlag names before writing (e.g. against the ModeFlag enum).","Model each op's required columns in your automation instead of a single generic insert."],"tags":["missing-required-argument","progress-log","accord-debug"],"backgroundTag":"missing-required-argument","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}