{"record":{"id":"27c89e15f29183fc","repo":"apache/cassandra","slug":"need-to-give-either-a-token-for-a-new-move-operati","errorCode":null,"errorMessage":"Need to give either a token for a new move operation, or --resume/--abort for an existing one","messagePattern":"Need to give either a token for a new move operation, or --resume/--abort for an existing one","errorType":"console","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/nodetool/Move.java","lineNumber":53,"sourceCode":"\n    @Option(description = \"Resume an ongoing move operation\", names = { \"--resume\" })\n    private boolean resume;\n\n    @Override\n    public void execute(NodeProbe probe)\n    {\n        try\n        {\n            if (!newToken.isEmpty())\n            {\n                probe.move(newToken);\n            }\n            else\n            {\n                if (resume)\n                    probe.resumeMove();\n                else\n                    throw new IllegalArgumentException(\"Need to give either a token for a new move operation, or --resume/--abort for an existing one\");\n            }\n        } catch (IOException e)\n        {\n            throw new RuntimeException(\"Error during moving node\", e);\n        }\n    }\n\n    @Command(name = \"abortmove\", description = \"Abort a failed move operation for this or a remote node\")\n    public static class Abort extends AbstractCommand\n    {\n        @Option(paramLabel = \"nodeId\", names = { \"--node\" })\n        private String nodeId;\n\n        @Override\n        public void execute(NodeProbe probe)\n        {\n            probe.abortMove(nodeId);\n        }","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/nodetool/Move.java#L35-L71","documentation":"Nodetool 'move' requires either a new token to move the node to, or --resume/--abort to operate on an existing pending move. If no token argument is given and --resume was not passed, execute() throws this IllegalArgumentException to stop the invocation. It is a pure client-side argument-validation error before any JMX call.","triggerScenarios":"Running `nodetool move` with no token argument and without --resume (e.g. only --abort would pass since abort is handled earlier; only a bare `nodetool move` or `nodetool move --some-unrelated-flag` lands here).","commonSituations":"Operators forget the token argument when scripting moves; copy-pasting an example where the token placeholder was empty; assuming --resume is implied after a failed move.","solutions":["Pass the target token: `nodetool move <new_token>`","If resuming an interrupted move, pass `--resume`","If aborting a failed move, use `nodetool abortmove` (or `move --abort` where supported)","Check `nodetool help move` for the exact argument order"],"exampleFix":"// before\nnodetool move\n// after\nnodetool move 8500565963494345642","handlingStrategy":"validation","validationCode":"if [ -z \"$TOKEN\" ] && [ \"$RESUME\" != \"1\" ]; then echo \"usage: nodetool move <token> | --resume\"; exit 2; fi\nnodetool move \"$TOKEN\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass an explicit token or --resume in scripts","Wrap nodetool calls with usage checks","Consult `nodetool help move` before scripting"],"tags":["nodetool","cli","argument-validation","streaming"],"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"}