{"record":{"id":"d279dabbc3d820cf","repo":"diem/diem","slug":"invalid-faucet-url-specified","errorCode":null,"errorMessage":"Invalid faucet URL specified","messagePattern":"Invalid faucet URL specified","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/diem/src/client_proxy.rs","lineNumber":134,"sourceCode":"        };\n\n        let dd_account = if testnet_designated_dealer_account_file.is_empty() {\n            None\n        } else {\n            let dd_account_key = generate_key::load_key(testnet_designated_dealer_account_file);\n            let dd_account_data = Self::get_account_data_from_address(\n                &client,\n                testnet_dd_account_address(),\n                true,\n                Some(KeyPair::from(dd_account_key)),\n                None,\n            )\n            .await?;\n            Some(dd_account_data)\n        };\n\n        let faucet_url = if let Some(faucet_url) = &faucet_url {\n            Url::parse(faucet_url).expect(\"Invalid faucet URL specified\")\n        } else {\n            url.join(\"/mint\")\n                .expect(\"Failed to construct faucet URL from JSON-RPC URL\")\n        };\n\n        Ok(ClientProxy {\n            chain_id,\n            client,\n            faucet_url,\n            diem_root_account,\n            tc_account,\n            testnet_designated_dealer_account: dd_account,\n            quiet_wait,\n            url,\n        })\n    }\n\n    /// Get account using specific address.","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/diem/diem/blob/fc4714a8ea273b6efe8b13dbce72ea60aad9a16c/crates/diem/src/client_proxy.rs#L116-L152","documentation":"ClientProxy::new parses the explicitly provided faucet_url via Url::parse and unwraps with expect('Invalid faucet URL specified'). Since Url::parse errors don't fit CliError nicely here, a malformed faucet URL aborts construction with this panic — the supplied URL is not a valid absolute URL.","triggerScenarios":"Caller passes a faucet_url string that fails Url::parse (missing scheme like 'localhost:8080' without http://, illegal characters, typos) when constructing ClientProxy.","commonSituations":"Config file or CLI flag supplies faucet URL without the http(s):// scheme; trailing garbage or spaces in the configured URL; using 'localhost:8000' style shorthand; environment-specific override pointing at a bad value.","solutions":["Fix the faucet_url to a fully qualified URL including scheme, e.g. http://localhost:8000 or https://faucet.example.test","Trim whitespace and stray characters from the configured value","Omit faucet_url entirely so the proxy derives it from the JSON-RPC URL (url.join(\"/mint\"))","Validate the URL with a quick parse (curl or url parser) before wiring it into config","Check documentation for the expected faucet endpoint format of your network"],"exampleFix":"// before\n// faucet_url = \"localhost:8080\"          // no scheme -> panic\n// after\n// faucet_url = \"http://localhost:8080\"  // valid absolute URL","handlingStrategy":"validation","validationCode":"import { URL } from 'url';\nexport function isValidFaucetUrl(u: string): boolean {\n  try { const p = new URL(u); return p.protocol === 'http:' || p.protocol === 'https:'; } catch { return false; }\n}","typeGuard":"function isHttpUrl(value: unknown): value is string {\n  if (typeof value !== 'string') return false;\n  try { const u = new URL(value); return u.protocol === 'http:' || u.protocol === 'https:'; } catch { return false; }\n}","tryCatchPattern":null,"preventionTips":["Always include the http(s):// scheme in faucet URLs","Trim whitespace from config values","Prefer omitting faucet_url and deriving it from the JSON-RPC URL","Validate URLs in config at startup"],"tags":["cli","url","configuration","panic"],"backgroundTag":"invalid-url-config","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"}