{"record":{"id":"534fde9793f7292c","repo":"diem/diem","slug":"should-have-generated-a-trusted-peer-set","errorCode":null,"errorMessage":"Should have generated a trusted peer set","messagePattern":"Should have generated a trusted peer set","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"config/seed-peer-generator/src/main.rs","lineNumber":33,"sourceCode":"    /// The output directory\n    output_dir: PathBuf,\n    #[structopt(short = \"e\", long)]\n    /// JSON RPC endpoint\n    endpoint: String,\n    #[structopt(short = \"r\", long)]\n    role: RoleType,\n}\n\nfn main() {\n    let args = Args::from_args();\n\n    let seed_peers_config = match args.role {\n        RoleType::FullNode => {\n            seed_peer_generator::utils::gen_validator_full_node_seed_peer_config(args.endpoint)\n        }\n        _ => panic!(\"{} not yet supported\", args.role),\n    }\n    .expect(\"Should have generated a trusted peer set\");\n\n    // Save to a file for loading later\n    seed_peers_config\n        .save_config(args.output_dir.join(\"seed_peers.yaml\"))\n        .expect(\"Unable to save seed peers config\");\n}\n","sourceCodeStart":15,"sourceCodeEnd":40,"githubUrl":"https://github.com/diem/diem/blob/fc4714a8ea273b6efe8b13dbce72ea60aad9a16c/config/seed-peer-generator/src/main.rs#L15-L40","documentation":"Immediately after role dispatch, main() unwraps the config-generation result with .expect(\"Should have generated a trusted peer set\"). If gen_validator_full_node_seed_peer_config returns Err (it could not fetch/build a trusted peer set from the endpoint), the process panics with this message.","triggerScenarios":"Running seed-peer-generator where the endpoint (args.endpoint) is unreachable, returns invalid data, or otherwise fails config generation, causing the Option/Result to be None/Err.","commonSituations":"Wrong or unreachable --endpoint URL, remote validator not up yet, network/firewall blocking the call, endpoint returning malformed response.","solutions":["Verify the --endpoint URL is correct and reachable (curl it)","Ensure the target validator/node is running and fully synced","Check network/firewall connectivity from the generator host","Fix the underlying cause surfaced before the expect (e.g. response parse error)"],"exampleFix":"# before\nseed-peer-generator --role fullnode --endpoint http://wrong-host:8080\n# after\nseed-peer-generator --role fullnode --endpoint http://valid-node:8080","handlingStrategy":"try-catch","validationCode":"// probe endpoint before generating\nif ! curl -fsS --max-time 5 \"$ENDPOINT\" > /dev/null; then\n  echo \"endpoint $ENDPOINT unreachable\"; exit 1;\nfi","typeGuard":null,"tryCatchPattern":"// main() panics via expect; wrap generation logic when reusing it\nlet peer = gen_validator_full_node_seed_peer_config(endpoint)\n    .map_err(|e| { eprintln!(\"generation failed: {}\", e); e })?;","preventionTips":["Verify the --endpoint URL with curl before running","Ensure the target validator is running and synced","Open firewall/network paths to the endpoint first","Fail fast with a clear pre-flight check instead of relying on expect panics"],"tags":["panic","network","seed-peer"],"backgroundTag":"config-generation-failed","analyzedSha":"fc4714a8ea273b6efe8b13dbce72ea60aad9a16c","analyzedAt":"2026-09-04T21:07:05.890Z","contentChangedAt":"2026-09-04T21:07:05.890Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}