{"record":{"id":"cbfb5c7cb75f8302","repo":"rustfs/rustfs","slug":"unknown-error-0","errorCode":null,"errorMessage":"Unknown error: {0}","messagePattern":"Unknown error: (.+?)","errorType":"exception","errorClass":"TargetError","httpStatus":null,"severity":"error","filePath":"crates/targets/src/error.rs","lineNumber":82,"sourceCode":"    #[error(\"Configuration error: {0}\")]\n    Configuration(String),\n\n    #[error(\"Encoding error: {0}\")]\n    Encoding(String),\n\n    #[error(\"Serialization error: {0}\")]\n    Serialization(String),\n\n    #[error(\"Target not connected\")]\n    NotConnected,\n\n    #[error(\"Target initialization failed: {0}\")]\n    Initialization(String),\n\n    #[error(\"Invalid ARN: {0}\")]\n    InvalidARN(String),\n\n    #[error(\"Unknown error: {0}\")]\n    Unknown(String),\n\n    #[error(\"Target is disabled\")]\n    Disabled,\n\n    #[error(\"Queued payload dropped: {0}\")]\n    Dropped(String),\n\n    #[error(\"Configuration parsing error: {0}\")]\n    ParseError(String),\n\n    #[error(\"Failed to save configuration: {0}\")]\n    SaveConfig(String),\n\n    #[error(\"Server not initialized: {0}\")]\n    ServerNotInitialized(String),\n}\n","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/rustfs/rustfs/blob/35af688cd9d41b4346fbe27dcf7250ba72046c1f/crates/targets/src/error.rs#L64-L100","documentation":"TargetError::Unknown is the catch-all wrapper. Live sites: the replay/IPC layer flattens any sidecar-adapter error that matches no known variant into Unknown(other.to_string()) (runtime/mod.rs:1656); QueuedPayload::decode failures during replay scans map to Unknown (runtime/mod.rs:2291-2292); Redis returns it as the last-resort after retries are exhausted (redis.rs:571); the audit registry uses it for close failures. By design the original context survives only inside the string payload, so the detail text is the only diagnostic.","triggerScenarios":"A plugin/sidecar adapter returns a custom error type not in the TargetError vocabulary during send or lifecycle; a corrupted or version-mismatched queued payload fails QueuedPayload::decode at replay time; Redis exhausts all retry attempts with a non-classified error.","commonSituations":"External target plugins with their own error enums; queue directories written by an older RustFS version being read by a newer one (or vice versa); partial writes to the store after disk-full; genuinely novel broker errors the adapter does not map.","solutions":["Read the embedded string first — it is the formatted source error and usually names the real cause.","If it wraps a decode failure, inspect the queue directory for corruption, disk-full, or version drift; move suspicious entries out and let the scan continue.","Reproduce with debug logging around the adapter to recover the original error chain.","If an external plugin produced it, extend the adapter to map its errors into specific TargetError variants instead of the fallback."],"exampleFix":"// before: adapter collapses every custom error into Unknown\nother => TargetError::Unknown(other.to_string()),\n\n// after: map the plugin's variant explicitly before falling back\nMyPluginError::Auth(e) => TargetError::Authentication(e),\nMyPluginError::Io(e) => TargetError::Network(e),\nother => TargetError::Unknown(other.to_string()),","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"fn is_unknown(e: &rustfs_targets::TargetError) -> bool {\n    matches!(e, rustfs_targets::TargetError::Unknown(_))\n}","tryCatchPattern":"match result {\n    Err(rustfs_targets::TargetError::Unknown(detail)) => {\n        // catch-all: the string is the only diagnostic — log it verbatim with context\n        tracing::error!(component = \"target\", detail, \"unclassified target error\");\n    }\n    _ => {}\n}","preventionTips":["Map plugin-specific errors to concrete TargetError variants at the adapter boundary.","Run one RustFS version per queue_dir to avoid Unknown from decode drift.","Escalate recurring Unknown to a bug report with the embedded detail."],"tags":["rust","rustfs-targets","catch-all","error-mapping","plugin","corruption"],"backgroundTag":"catch-all-error-code","analyzedSha":"35af688cd9d41b4346fbe27dcf7250ba72046c1f","analyzedAt":"2026-08-20T21:57:04.799Z","contentChangedAt":"2026-08-20T21:57:04.799Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}