{"record":{"id":"137809c02fd0971b","repo":"apache/cassandra","slug":"must-specify-op","errorCode":null,"errorMessage":"Must specify 'op'","messagePattern":"Must specify 'op'","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java","lineNumber":2042,"sourceCode":"\n            CommandStoreOp op = null;\n            String param = null;\n            for (int i = 0 ; i < columns.length ; ++i)\n            {\n                switch (columns[i].name.toString())\n                {\n                    default: throw new IllegalArgumentException(\"Unknown column \" + columns[i].name.toString());\n                    case \"op\":\n                        op = tryParse(values[i], true, CommandStoreOp.class, CommandStoreOp::valueOf);\n                        break;\n                    case \"param\":\n                        param = (String) values[i];\n                        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);","sourceCodeStart":2024,"sourceCodeEnd":2060,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java#L2024-L2060","documentation":"After parsing an INSERT into accord_command_store_ops, if no 'op' column value was supplied the row cannot dispatch any debug operation, so an IllegalArgumentException(\"Must specify 'op'\") is thrown. Every write to this table must name the CommandStoreOp to run.","triggerScenarios":"INSERTing a row that sets only command_store_id (and optionally 'param') without an 'op' column, or inserting NULL for 'op'.","commonSituations":"Partially filled INSERT templates; forgetting that virtual-table writes require all meaningful columns; trying to 'clear' a row by omitting op.","solutions":["Include the 'op' column with a valid CommandStoreOp enum value (e.g. 'REPLAY', 'SET_PROGRESS_LOG_MODE').","List accepted ops via the enum CommandStoreOp in the Cassandra source or DESCRIBE the table.","Remove the stray empty INSERT instead of sending an op-less row."],"exampleFix":"// before\nINSERT INTO system_views.accord_command_store_ops (command_store_id) VALUES (0);\n// after\nINSERT INTO system_views.accord_command_store_ops (command_store_id, op) VALUES (0, 'REPLAY');","handlingStrategy":"validation","validationCode":"if (insertValues.get(\"op\") == null || insertValues.get(\"op\").isBlank())\n    throw new IllegalArgumentException(\"accord_command_store_ops inserts must specify 'op'\");","typeGuard":null,"tryCatchPattern":"try {\n    session.execute(insert);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().equals(\"Must specify 'op'\")) {\n        // add the op column with a valid CommandStoreOp value and retry\n    }\n}","preventionTips":["Always include 'op' in every INSERT to accord_command_store_ops.","Validate op names against the CommandStoreOp enum.","Build inserts from a shared helper that enforces required columns."],"tags":["missing-required-argument","virtual-table","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"}