{"record":{"id":"8d9988becc36d076","repo":"risingwavelabs/risingwave","slug":"election-failed-0","errorCode":null,"errorMessage":"Election failed: {0}","messagePattern":"Election failed: (.+?)","errorType":"error_code","errorClass":"MetaError","httpStatus":null,"severity":"critical","filePath":"src/meta/src/error.rs","lineNumber":94,"sourceCode":"    #[error(\"{0} id not found: {1}\")]\n    #[construct(skip)]\n    CatalogIdNotFound(&'static str, String),\n\n    #[error(\"table_fragment does not exist: id={0}\")]\n    FragmentNotFound(FragmentId),\n\n    #[error(\"{0} named {1} already exists{under_creation}\", under_creation = (.2).map(|_| \" and is still being created\").unwrap_or(\"\"))]\n    Duplicated(\n        &'static str,\n        String,\n        // if under creation, take streaming job id, otherwise None\n        Option<JobId>,\n    ),\n\n    #[error(\"Service unavailable: {0}\")]\n    Unavailable(#[message] String),\n\n    #[error(\"Election failed: {0}\")]\n    Election(#[source] BoxedError),\n\n    #[error(\"Cancelled: {0}\")]\n    Cancelled(String),\n\n    #[error(\"System parameters error: {0}\")]\n    SystemParams(String),\n\n    #[error(\"Session parameters error: {0}\")]\n    SessionConfig(\n        #[from]\n        #[backtrace]\n        SessionConfigError,\n    ),\n\n    #[error(transparent)]\n    Connector(\n        #[from]","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/meta/src/error.rs#L76-L112","documentation":"MetaError::ElectionFailed: the meta-node failed in a leader-election operation (e.g. acquiring or renewing leadership via the election backend). Wrapped error carries the backend-specific reason; typically indicates metastore/etcd connectivity or session issues.","triggerScenarios":"meta node startup when it cannot acquire the leader lease (etcd errors, another leader active), lease renewal failure during runtime causing leadership loss.","commonSituations":"etcd connection problems or timeouts, split-brain protection rejecting election, clock skew affecting lease TTLs, misconfigured election keys.","solutions":["Inspect the `#[source]`/cause chain for the underlying election failure.","Check etcd (or configured meta store) health and connectivity.","Confirm only the intended meta nodes participate in election and their config matches.","Restart the meta node; if the lease is stuck, wait for TTL expiry or clear the stale leader key."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match meta_result {\n    Err(MetaError::Election(cause)) => { /* inspect cause, check etcd, retry after leader re-elected */ }\n    other => other?,\n}","preventionTips":["Run etcd (meta store) with proper quorum and monitoring.","Keep meta node clocks synced (NTP) to avoid lease issues.","Use consistent election configuration across all meta nodes.","Add alerting on leader loss events."],"tags":["meta","election","etcd","consensus"],"backgroundTag":"connection-refused","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}