{"record":{"id":"f67e37b969ae8c99","repo":"risingwavelabs/risingwave","slug":"i-o-error-0","errorCode":null,"errorMessage":"I/O error: {0}","messagePattern":"I/O error: (.+?)","errorType":"exception","errorClass":"SecretError","httpStatus":null,"severity":"error","filePath":"src/common/secret/src/error.rs","lineNumber":31,"sourceCode":"// limitations under the License.\n\npub use anyhow::anyhow;\nuse thiserror::Error;\nuse thiserror_ext::Construct;\n\nuse super::SecretId;\n\npub type SecretResult<T> = Result<T, SecretError>;\n\n#[derive(Error, Debug, Construct)]\npub enum SecretError {\n    #[error(\"secret not found: {0}\")]\n    ItemNotFound(SecretId),\n\n    #[error(\"decode utf8 error: {0}\")]\n    DecodeUtf8Error(#[from] std::string::FromUtf8Error),\n\n    #[error(\"I/O error: {0}\")]\n    IoError(#[from] std::io::Error),\n\n    #[error(\"unspecified secret ref type: {0}\")]\n    UnspecifiedRefType(SecretId),\n\n    #[error(\"failed to encrypt or decrypt the secret\")]\n    AesError,\n\n    #[error(\"ser/de proto message error: {0}\")]\n    ProtoError(#[from] bincode::Error),\n\n    #[error(transparent)]\n    Internal(#[from] anyhow::Error),\n}\n","sourceCodeStart":13,"sourceCodeEnd":46,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/common/secret/src/error.rs#L13-L46","documentation":"SecretError::IoError wraps std::io::Error (via #[from]) and is raised when an I/O operation performed while reading or writing secrets fails — e.g. reading secret material from a local file or interacting with a file-backed secret store.","triggerScenarios":"Reading a secret from a local file path that does not exist, lacks permissions, or hits a device error during secret creation/fetch; any std::io operation in the secret code path that returns Err is auto-converted into this variant.","commonSituations":"Configured secret file path is wrong or the file was deleted; running the process as a user without read permission on the secret file; disk/network (NFS) failures while accessing the secret store; container mounts missing the secret volume.","solutions":["Check the underlying io::Error (it is Displayed via 'I/O error: ...') and fix the path/permissions it reports.","Verify the secret file exists and is readable by the RisingWave process user.","Mount/copy the secret file into the container or host correctly.","If transient (network FS), retry the operation after restoring access."],"exampleFix":"// before\nlet secret = std::fs::read_to_string(\"/secrets/kafka_pass\")?; // No such file\n\n// after\n// ensure the file is mounted, then verify before use\nlet path = std::path::Path::new(\"/secrets/kafka_pass\");\nassert!(path.exists(), \"secret file missing\");\nlet secret = std::fs::read_to_string(path)?;","handlingStrategy":"try-catch","validationCode":"// Check file-backed secret availability before use:\nfn secret_file_readable(path: &str) -> bool {\n    std::fs::File::open(path).is_ok()\n}","typeGuard":null,"tryCatchPattern":"match manager.get(id).await {\n    Ok(s) => s,\n    Err(SecretError::IoError(e)) if e.kind() == std::io::ErrorKind::NotFound => {\n        return Err(anyhow!(\"secret file missing: {e}; check volume mount\"));\n    }\n    Err(SecretError::IoError(e)) if e.kind() == std::io::ErrorKind::PermissionDenied => {\n        return Err(anyhow!(\"secret file unreadable: {e}; fix file permissions\"));\n    }\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Verify secret file paths exist and are mounted (especially in containers) before startup.","Run the process as a user with read permission on the secret files.","Distinguish permanent (NotFound/PermissionDenied) from transient IO errors; retry only transient ones.","Keep secret files on reliable storage; avoid unstable network mounts."],"tags":["secret","io","filesystem"],"backgroundTag":"file-read-failed","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}