{"record":{"id":"337b8a8fb81c9b3e","repo":"astrid-runtime/astrid","slug":"unsupported-provider-protocol-337b8a","errorCode":null,"errorMessage":"unsupported provider protocol {}","messagePattern":"unsupported provider protocol (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-storage-provider-winfsp/src/main.rs","lineNumber":102,"sourceCode":"\nasync fn run() -> Result<StorageProviderResponseV1> {\n    let arguments = std::env::args_os().skip(1).collect::<Vec<_>>();\n    if arguments.as_slice() != [std::ffi::OsStr::new(\"--astrid-provider-stdio-v1\")] {\n        bail!(\"this executable is an Astrid WinFsp provider, not an interactive command\");\n    }\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        .context(\"read provider request\")?;\n    if bytes.len() as u64 > MAX_REQUEST_BYTES {\n        bail!(\"provider request exceeds limit\");\n    }\n    let request: StorageProviderRequestV1 =\n        serde_json::from_slice(&bytes).context(\"decode provider request\")?;\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: error.to_string().chars().take(4096).collect(),\n        }),\n    };\n    Ok(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":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-storage-provider-winfsp/src/main.rs#L84-L120","documentation":"After decoding the stdin JSON into a StorageProviderRequestV1, run() checks protocol_version against STORAGE_PROVIDER_PROTOCOL_V1. A request stamped with any other version is rejected, since the v1 wire semantics are the only ones this provider implements.","triggerScenarios":"A host sends a StorageProviderRequestV1 whose protocol_version field is not STORAGE_PROVIDER_PROTOCOL_V1 — a newer host against an older provider, an old host against a provider that dropped legacy versions, or a handcrafted test request with the wrong constant.","commonSituations":"Partial upgrade: host package updated to a v2 protocol while the provider binary on the machine is still v1; vendored providers built from different branches; scripts with a hardcoded wrong version number.","solutions":["Set protocol_version to STORAGE_PROVIDER_PROTOCOL_V1 in the request.","Upgrade the provider binary to match the host's protocol version (or vice versa) so both agree on v1.","Read the actual version printed in the error message and compare against the host SDK's constant.","Update launch scripts/tests that hardcode the protocol version number."],"exampleFix":"// before\nlet request = StorageProviderRequestV1 { protocol_version: 2, .. };\n// after\nlet request = StorageProviderRequestV1 { protocol_version: STORAGE_PROVIDER_PROTOCOL_V1, .. };","handlingStrategy":"type-guard","validationCode":"// Before sending:\nif request.protocol_version != STORAGE_PROVIDER_PROTOCOL_V1 {\n    return Err(anyhow!(\"host speaks protocol {}, provider requires v1\", request.protocol_version));\n}","typeGuard":"// Rust\nfn is_provider_v1(r: &StorageProviderRequestV1) -> bool {\n    r.protocol_version == STORAGE_PROVIDER_PROTOCOL_V1\n}","tryCatchPattern":"// Host side\nmatch run_provider(request).await {\n    Err(e) if e.to_string().starts_with(\"unsupported provider protocol\") => {\n        // upgrade the provider binary or downgrade the request version, then retry\n    }\n    other => other?,\n}","preventionTips":["Always build requests with the STORAGE_PROVIDER_PROTOCOL_V1 constant, not literals","Upgrade host and provider packages together","Read the reported version in the error to diagnose version drift quickly"],"tags":["winfsp","protocol-version","version-mismatch","stdio"],"backgroundTag":"unsupported-enum-value","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"}