{"record":{"id":"6a8fb3f922472f28","repo":"diem/diem","slug":"failed-to-load-node-config","errorCode":null,"errorMessage":"Failed to load node config","messagePattern":"Failed to load node config","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"diem-node/src/main.rs","lineNumber":64,"sourceCode":"static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;\n\nfn main() {\n    let args = Args::from_args();\n\n    if args.test {\n        println!(\"Entering test mode, this should never be used in production!\");\n        let rng = args\n            .seed\n            .map(StdRng::from_seed)\n            .unwrap_or_else(StdRng::from_entropy);\n        let publishing_option = if args.open_publishing {\n            Some(VMPublishingOption::open())\n        } else {\n            None\n        };\n        diem_node::load_test_environment(args.config, args.random_ports, publishing_option, rng);\n    } else {\n        let config = NodeConfig::load(args.config.unwrap()).expect(\"Failed to load node config\");\n        println!(\"Using node config {:?}\", &config);\n        diem_node::start(&config, None);\n    };\n}\n","sourceCodeStart":46,"sourceCodeEnd":69,"githubUrl":"https://github.com/diem/diem/blob/fc4714a8ea273b6efe8b13dbce72ea60aad9a16c/diem-node/src/main.rs#L46-L69","documentation":"NodeConfig::load deserializes the node's TOML configuration file into a NodeConfig. The .expect(\"Failed to load node config\") panics when the file cannot be read or fails to deserialize against the NodeConfig schema. The node refuses to start because almost every subsystem depends on valid config values.","triggerScenarios":"Running `diem-node` (without --test) with a path that does not exist, is unreadable (permissions), contains invalid TOML syntax, or has fields with wrong types/unknown keys that fail NodeConfig deserialization.","commonSituations":"Operator passes a typo'd or relative --config path from the wrong working directory; a config generated by an older Diem version lacks newly required fields; hand-edited TOML introduces a syntax or type error.","solutions":["Verify the config file path exists and is readable by the process user.","Validate the TOML parses (e.g. with any TOML linter) and fix syntax/type errors.","Regenerate the config with the matching diem-node version (config builder / config-gen) instead of reusing an old file.","Run with an out-of-tree test setup (`--test`) only for local testing, never in production."],"exampleFix":"// before\ndiem-node --config /etc/diem/node.toml   # file missing\n// after\ndiem-node --config /etc/diem/node.yaml   # correct, existing NodeConfig file path","handlingStrategy":"validation","validationCode":"let path = args.config.unwrap_or_default();\nif !std::path::Path::new(&path).is_file() {\n    panic!(\"node config file not found: {}\", path);\n}\n// Optionally pre-parse TOML to surface schema errors before NodeConfig::load\nlet raw = std::fs::read_to_string(&path)?;\ntoml::from_str::<toml::Value>(&raw)?;","typeGuard":"fn config_exists(p: &str) -> bool { std::path::Path::new(p).is_file() }","tryCatchPattern":"match NodeConfig::load(path.clone()) {\n    Ok(config) => diem_node::start(&config, None),\n    Err(e) => eprintln!(\"Failed to load node config {:?}: {}\", path, e),\n}","preventionTips":["Always generate configs with the config builder of the matching diem-node version.","Check file existence and permissions before launching.","Keep configs in version control and lint TOML in CI."],"tags":["config","toml","startup"],"backgroundTag":"config-load-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"}