{"record":{"id":"20ee521839ec09a4","repo":"nautechsystems/nautilus_trader","slug":"provider-id-is-required","errorCode":null,"errorMessage":"Provider ID is required","messagePattern":"Provider ID is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/rpc/verification.rs","lineNumber":1434,"sourceCode":"            )),\n            \"Deployment manifest contains a duplicate call edge\"\n        );\n    }\n\n    for purpose in [\"swap_sell\", \"swap_buy\"] {\n        anyhow::ensure!(\n            manifest\n                .call_edges\n                .iter()\n                .any(|edge| edge.purpose == purpose),\n            \"Deployment manifest is missing a swap call graph\"\n        );\n    }\n    Ok(())\n}\n\nfn validate_identity(identity: &BlockchainProviderIdentity) -> anyhow::Result<()> {\n    anyhow::ensure!(\n        !identity.provider_id.trim().is_empty(),\n        \"Provider ID is required\"\n    );\n    anyhow::ensure!(\n        !identity.operator_id.trim().is_empty(),\n        \"Provider operator ID is required\"\n    );\n    anyhow::ensure!(\n        !identity.failure_domain_ids.is_empty()\n            && identity\n                .failure_domain_ids\n                .iter()\n                .all(|domain| !domain.trim().is_empty()),\n        \"Provider failure domains must contain nonempty opaque IDs\"\n    );\n    ensure_distinct(\n        identity.failure_domain_ids.iter().map(String::as_str),\n        \"failure-domain IDs within one provider\",","sourceCodeStart":1416,"sourceCodeEnd":1452,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/rpc/verification.rs#L1416-L1452","documentation":"A blockchain provider identity must include a nonempty provider_id; whitespace-only strings are also rejected because the field is trimmed before the emptiness check. The provider_id is the primary key that ties a provider configuration to its identity, so a missing value makes the deployment unusable.","triggerScenarios":"Validating a BlockchainProviderIdentity whose provider_id is \"\" or contains only spaces — e.g. an identity struct constructed without the field, or one deserialized from a config file where provider_id was absent or blank.","commonSituations":"Omitting provider_id in a provider config file or environment template; an unset environment variable interpolating to an empty string; a tool generating identity stubs with placeholder empty values; scripts that accidentally blank the field while trimming.","solutions":["Set provider_id to a nonempty unique identifier for the provider in the identity/config","Check that the environment variable or template value feeding provider_id is actually set at runtime","If identities are generated, fix the generator to always populate provider_id","Re-run validation after setting the field to catch any further missing identity fields"],"exampleFix":"// before\n{\"provider_id\": \"   \", \"operator_id\": \"op-1\"}\n// after\n{\"provider_id\": \"alchemy-mainnet\", \"operator_id\": \"op-1\"}","handlingStrategy":"validation","validationCode":"if identity.provider_id.trim().is_empty() {\n    return Err(\"provider_id must be a nonempty identifier\".into());\n}","typeGuard":"fn has_provider_id(identity: &BlockchainProviderIdentity) -> bool {\n    !identity.provider_id.trim().is_empty()\n}","tryCatchPattern":"match validate_identity(&identity) {\n    Err(e) if e.to_string().contains(\"Provider ID is required\") => {\n        eprintln!(\"Set provider_id in the provider config/environment before starting\");\n    }\n    Err(e) => return Err(e),\n    Ok(()) => {}\n}","preventionTips":["Validate identity structs at startup before any provider use","Make provider_id a required field in config schemas with a nonempty constraint","Check that env vars feeding provider_id are set and nonblank"],"tags":["blockchain","identity","config"],"backgroundTag":"empty-required-field","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}