{"record":{"id":"69f92d6fd39bc09d","repo":"influxdata/influxdb","slug":"invalid-unregister-for-node-node-id-current-state-current","errorCode":null,"errorMessage":"invalid unregister for node '{node_id}' (current state: {current_state})","messagePattern":"invalid unregister for node '(.+?)' \\(current state: (.+?)\\)","errorType":"error_code","errorClass":"CatalogError","httpStatus":null,"severity":"error","filePath":"influxdb3_catalog/src/error.rs","lineNumber":317,"sourceCode":"\n    #[error(\n        \"node '{node_id}' is not fully stopped (current state: {current_state}); run \\\"stop node\\\" first\"\n    )]\n    NodeNotFullyStopped {\n        node_id: Arc<str>,\n        current_state: &'static str,\n    },\n\n    #[error(\"node '{node_id}' has compact mode and cannot be removed\")]\n    NodeModeNotRemovable { node_id: Arc<str> },\n\n    #[error(\"invalid stop ack for node '{node_id}' (current state: {current_state})\")]\n    InvalidStopAck {\n        node_id: Arc<str>,\n        current_state: &'static str,\n    },\n\n    #[error(\"invalid unregister for node '{node_id}' (current state: {current_state})\")]\n    InvalidUnregister {\n        node_id: Arc<str>,\n        current_state: &'static str,\n    },\n\n    #[error(\"idempotent no-op\")]\n    IdempotentNoOp,\n\n    #[error(\"cannot delete operator token\")]\n    CannotDeleteOperatorToken,\n\n    #[error(\n        \"cannot change the configured generation duration for level {level}; \\\n        attempted to set to {attempted:#} but its already set to {existing:#}\"\n    )]\n    CannotChangeGenerationDuration {\n        level: u8,\n        existing: Duration,","sourceCodeStart":299,"sourceCodeEnd":335,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_catalog/src/error.rs#L299-L335","documentation":"Raised when an unregister request for a node is invalid given the node's current lifecycle state in the catalog. Unregistration is only permitted from specific states; requesting it from a running or otherwise ineligible state is rejected. The error carries the node_id and current state to aid diagnosis.","triggerScenarios":"Calling the catalog unregister-node API with a node_id whose state machine state does not allow unregistering (e.g. node not yet stopped, or already unregistered).","commonSituations":"Decommission scripts that unregister before the node finishes stopping; double-unregister from retried automation; operator forgets to stop the node before removing it.","solutions":["Stop the node and wait until its catalog state reaches the state required for unregistering, then retry.","Check the reported current_state and issue the correct intermediate transition (e.g. stop ack) first.","Skip the call if the node is already unregistered (the operation already succeeded).","Fix automation ordering so unregister always follows successful stop."],"exampleFix":"// before\ncatalog.unregister_node(node_id).await?;\n// after\nlet state = catalog.node_state(node_id)?.current_state;\nif state != \"stopped\" {\n    return Err(format!(\"node {node_id} must be stopped first (state: {state})\").into());\n}\ncatalog.unregister_node(node_id).await?;","handlingStrategy":"validation","validationCode":"let state = catalog.node_state(node_id)?.current_state;\nif !unregister_allowed_states().contains(&state) {\n    return Err(format!(\"node {node_id} in state {state}; cannot unregister\"));\n}","typeGuard":null,"tryCatchPattern":"match result {\n    Err(CatalogError::InvalidUnregister { current_state, .. }) => {\n        log::warn!(\"unregister rejected, node state={current_state}\");\n    }\n    other => other?,\n}","preventionTips":["Always stop nodes before unregistering","Make decommission scripts state-aware","Check for prior unregister to avoid double calls"],"tags":["cluster","node-lifecycle","state-machine"],"backgroundTag":"invalid-state-transition","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}