{"record":{"id":"eb501d3fa77988b0","repo":"sigoden/dufs","slug":"invalid-bind-address","errorCode":null,"errorMessage":"Invalid bind address `{}`","messagePattern":"Invalid bind address `(.+?)`","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/args.rs","lineNumber":509,"sourceCode":"        let mut bind_addrs = vec![];\n        #[cfg(not(unix))]\n        let mut invalid_addrs = vec![];\n        for addr in addrs {\n            match addr.parse::<IpAddr>() {\n                Ok(v) => {\n                    bind_addrs.push(BindAddr::IpAddr(v));\n                }\n                Err(_) => {\n                    #[cfg(unix)]\n                    bind_addrs.push(BindAddr::SocketPath(addr.to_string()));\n                    #[cfg(not(unix))]\n                    invalid_addrs.push(*addr);\n                }\n            }\n        }\n        #[cfg(not(unix))]\n        if !invalid_addrs.is_empty() {\n            bail!(\"Invalid bind address `{}`\", invalid_addrs.join(\",\"));\n        }\n        Ok(bind_addrs)\n    }\n}\n\n#[derive(Debug, Clone, Copy, PartialEq, Deserialize, Default)]\n#[serde(rename_all = \"lowercase\")]\npub enum Compress {\n    None,\n    #[default]\n    Low,\n    Medium,\n    High,\n}\n\nimpl ValueEnum for Compress {\n    fn value_variants<'a>() -> &'a [Self] {\n        &[Self::None, Self::Low, Self::Medium, Self::High]","sourceCodeStart":491,"sourceCodeEnd":527,"githubUrl":"https://github.com/sigoden/dufs/blob/fe7fd564f80dfbac361c8e0589c3845638149d38/src/args.rs#L491-L527","documentation":"parse_addrs in src/args.rs collects the bind addresses from -b/--bind. On non-unix platforms (no Unix domain socket support), any address that failed to parse (e.g. a path-looking value or malformed host:port) is collected and the parser bails listing them: \"Invalid bind address `<addr>`\". Unix platforms instead ignore invalid entries (they may be intended as unix socket paths).","triggerScenarios":"Running dufs on Windows (non-unix) with -b values that are not valid SocketAddr strings — e.g. a unix socket path like /tmp/dufs.sock, missing port (\"127.0.0.1\" without :port), or bad host syntax.","commonSituations":"Reusing a Unix-specific config/script on Windows; forgetting the port in the bind spec; typos like \"localhost:808\" won't fail here but \"/tmp/x\" or \"127.0.0.1:\" style inputs will.","solutions":["Use valid host:port bind values, e.g. -b 127.0.0.1:5000 or -b 0.0.0.0:5000","Remove unix-socket-style bind paths when running on non-unix platforms","Include the port explicitly for every --bind value"],"exampleFix":"# before (on Windows)\ndufs -b /tmp/dufs.sock\n# after\ndufs -b 0.0.0.0:5000","handlingStrategy":"validation","validationCode":"# validate bind addresses before launch (non-unix)\nfor a in $BIND_ADDRS; do\n  case \"$a\" in *:*) ;; *) echo \"invalid bind (needs host:port): $a\"; exit 1;; esac\ndone","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always specify host:port, never bare paths, on Windows","Keep platform-specific (unix socket) configs out of cross-platform scripts","Test bind addresses with a quick parser or curl before production"],"tags":["cli","network","bind-address","rust","windows"],"backgroundTag":"invalid-argument-format","analyzedSha":"fe7fd564f80dfbac361c8e0589c3845638149d38","analyzedAt":"2026-09-09T13:01:22.843Z","contentChangedAt":"2026-09-09T13:01:22.843Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}