{"record":{"id":"ba060c366022d7f4","repo":"astrid-runtime/astrid","slug":"unsupported-provider-protocol-ba060c","errorCode":null,"errorMessage":"unsupported provider protocol {}","messagePattern":"unsupported provider protocol (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-storage-provider-fuse/src/main.rs","lineNumber":166,"sourceCode":"    if let Err(error) = result {\n        eprintln!(\"{PROVIDER_NAME}: {error:#}\");\n        return ExitCode::from(2);\n    }\n    ExitCode::SUCCESS\n}\n\nasync fn run_stdio() -> Result<()> {\n    let mut bytes = Vec::new();\n    std::io::stdin()\n        .lock()\n        .take(MAX_REQUEST_BYTES + 1)\n        .read_to_end(&mut bytes)?;\n    if bytes.len() as u64 > MAX_REQUEST_BYTES {\n        bail!(\"provider request exceeds limit\");\n    }\n    let request: StorageProviderRequestV1 = serde_json::from_slice(&bytes)?;\n    if request.protocol_version != STORAGE_PROVIDER_PROTOCOL_V1 {\n        bail!(\"unsupported provider protocol {}\", request.protocol_version);\n    }\n    let request_id = request.request_id;\n    let outcome = match execute(request).await {\n        Ok(success) => StorageProviderOutcomeV1::Success(success),\n        Err(error) => StorageProviderOutcomeV1::Failure(StorageProviderFailureV1 {\n            code: \"provider-operation\".to_owned(),\n            message: bounded_failure_message(&error.to_string()),\n        }),\n    };\n    let response = StorageProviderResponseV1 {\n        protocol_version: STORAGE_PROVIDER_PROTOCOL_V1,\n        request_id,\n        provider: StorageProviderIdentityV1 {\n            name: PROVIDER_NAME.to_owned(),\n            version: env!(\"CARGO_PKG_VERSION\").to_owned(),\n            capabilities: vec![\n                StorageProviderCapabilityV1::PrincipalView,\n                StorageProviderCapabilityV1::FleetView,","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-storage-provider-fuse/src/main.rs#L148-L184","documentation":"This error means the provider received a valid JSON `StorageProviderRequestV1` from stdin whose `protocol_version` field does not equal `STORAGE_PROVIDER_PROTOCOL_V1`. The provider speaks exactly one protocol version and rejects anything else rather than guessing semantics. It is thrown in main.rs:166 immediately after deserialization.","triggerScenarios":"Sending a request with protocol_version set to 0, 2, a string, or any value other than the crate's STORAGE_PROVIDER_PROTOCOL_V1 constant into the provider's stdin.","commonSituations":"Host process and provider binary built from different crate versions (one upgraded, one stale); hand-written test requests with a placeholder version; a serialization format change that altered the version constant type or value.","solutions":["Rebuild/redeploy the host and provider from the same crate version so protocol versions match.","Set request.protocol_version to the STORAGE_PROVIDER_PROTOCOL_V1 constant imported from the crate, not a literal.","Inspect the provider's constant (e.g. via its version output or source) and align the caller.","If multiple versions must coexist, route to the matching provider binary per version."],"exampleFix":"// before\nlet req = StorageProviderRequestV1 { protocol_version: 2, .. };\n// after\nlet req = StorageProviderRequestV1 { protocol_version: STORAGE_PROVIDER_PROTOCOL_V1, .. };","handlingStrategy":"validation","validationCode":"if request.protocol_version != STORAGE_PROVIDER_PROTOCOL_V1 {\n    return Err(anyhow!(\"version mismatch: {}\", request.protocol_version));\n}","typeGuard":null,"tryCatchPattern":"match run_provider(&bytes) {\n    Err(e) if e.to_string().starts_with(\"unsupported provider protocol\") => {\n        // rebuild/redeploy caller and provider from same version\n    }\n    r => r?,\n}","preventionTips":["Always set protocol_version from the crate constant, never a literal","Build host and provider binaries from the same revision","Add a startup version handshake check before sending requests"],"tags":["versioning","protocol","ipc"],"backgroundTag":"incompatible-source-type","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}