{"record":{"id":"edbbb06393b455d7","repo":"apache/cassandra","slug":"can-t-proceed-from-the-state","errorCode":null,"errorMessage":"Can't proceed from the state ","messagePattern":"Can't proceed from the state ","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tcm/Startup.java","lineNumber":716,"sourceCode":"                break;\n            case BOOTSTRAPPING:\n            case BOOT_REPLACING:\n                if (finishJoiningRing)\n                {\n                    throw new IllegalStateException(\"Expected to complete startup sequence, but did not. \" +\n                                                    \"Can't proceed from the state \" + metadata.directory.peerState(self));\n                }\n                break;\n            case LEAVING:\n                logger.info(\"Node is currently being decommissioned, resume with `nodetool decommission`\");\n                StorageService.instance.markDecommissionFailed();\n                break;\n            case MOVING:\n                logger.info(\"Node is currently moving, resume with nodetool move --resume or abort with nodetool move --abort\");\n                StorageService.instance.markMoveFailed();\n                break;\n            default:\n                throw new IllegalStateException(\"Can't proceed from the state \" + metadata.directory.peerState(self));\n        }\n    }\n\n    /**\n     * Returns:\n     *   * {@link PrepareReplace}, the first step of the multi-step replacement process sequence, if {@param finishJoiningRing} is true\n     *   * {@link UnsafeJoin}, a single-step join transformation, if {@param shouldBootstrap} is set to false, and the node is not\n     *     in a write survey mode (in other words {@param finishJoiningRing} is true. This mode is mostly used for testing, but can\n     *     also be used to quickly set up a fresh cluster.\n     *   * and {@link PrepareJoin}, the first step of the multi-step join process, otherwise.\n     */\n    private static Transformation getInitialTransformation(boolean finishJoiningRing, boolean shouldBootstrap, boolean isReplacing)\n    {\n        ClusterMetadata metadata = ClusterMetadata.current();\n        if (isReplacing)\n        {\n            InetAddressAndPort replacingEndpoint = DatabaseDescriptor.getReplaceAddress();\n            if (FailureDetector.instance.isAlive(replacingEndpoint))","sourceCodeStart":698,"sourceCodeEnd":734,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tcm/Startup.java#L698-L734","documentation":"The default branch of Startup.java's resume switch: the node's ClusterMetadata peer state is not one of the resumable states (JOINED, BOOTSTRAPPING, BOOT_REPLACING, LEAVING, MOVING), so startup cannot proceed and throws IllegalStateException. This guards against booting from states like LEFT/REMOVED where resuming is meaningless.","triggerScenarios":"Starting a node whose recorded peer state in ClusterMetadata is an unhandled value (e.g. LEFT, REMOVED, unknown enum value) during the TCM startup sequence.","commonSituations":"Restarting a node that was decommissioned or removed from the cluster; corrupted/stale ClusterMetadata on disk; running an older binary against metadata written by a newer version with extra states.","solutions":["If the node was decommissioned/removed, wipe its data directory and bootstrap as a new node","Check the peer state in ClusterMetadata to identify the exact unresumable state","Upgrade/downgrade to a version whose Startup switch understands the recorded state","If metadata is corrupted, restore from backup or re-initialize the TCM metadata carefully (risky; consult CMS operator docs)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"NodeState s = ClusterMetadata.current().directory.peerState(self);\nif (s == NodeState.LEFT || s == NodeState.REMOVED)\n    throw new IllegalStateException(\"Node was removed; wipe data and re-bootstrap\");","typeGuard":null,"tryCatchPattern":"try { startup(); }\ncatch (IllegalStateException e) {\n    if (e.getMessage().startsWith(\"Can't proceed from the state\")) { /* inspect peer state, re-bootstrap */ }\n    else throw e;\n}","preventionTips":["Never restart a node after decommission/removal expecting it to rejoin with old data","Record decommission events in ops tooling so restarts of removed nodes are blocked","Validate recorded peer state against expected lifecycle before startup automation"],"tags":["tcm","startup","state-machine"],"backgroundTag":"invalid-state-transition","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}