{"record":{"id":"1f86b568dcb17de5","repo":"GitoxideLabs/gitoxide","slug":"valid-url","errorCode":null,"errorMessage":"valid url","messagePattern":"valid url","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gix-transport/src/client/blocking_io/file.rs","lineNumber":83,"sourceCode":"        trace: bool,\n    ) -> SpawnProcessOnDemand {\n        SpawnProcessOnDemand {\n            url,\n            path,\n            ssh_cmd: Some((program.into(), ssh_kind)),\n            envs: Default::default(),\n            ssh_disallow_shell,\n            child: None,\n            connection: None,\n            desired_version: version,\n            trace,\n        }\n    }\n\n    fn new_local(path: BString, version: Protocol, trace: bool) -> SpawnProcessOnDemand {\n        SpawnProcessOnDemand {\n            url: gix_url::Url::from_parts(gix_url::Scheme::File, None, None, None, None, path.clone(), true)\n                .expect(\"valid url\"),\n            path,\n            ssh_cmd: None,\n            envs: if version != Protocol::V1 {\n                vec![(\"GIT_PROTOCOL\", format!(\"version={}\", version as usize))]\n            } else {\n                Default::default()\n            },\n            ssh_disallow_shell: false,\n            child: None,\n            connection: None,\n            desired_version: version,\n            trace,\n        }\n    }\n\n    fn prepare_command(\n        &self,\n        service: Service,","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix-transport/src/client/blocking_io/file.rs#L65-L101","documentation":"Panic from `Url::from_parts(...).expect(\"valid url\")` inside `SpawnProcessOnDemand::new_local` in gix-transport's file protocol. The library constructs a `file://` URL from validated parts (Scheme::File, no host/user/port, a path, accept_ipv6=true) and asserts assembly cannot fail. Only a defect in those invariants — or a fork changing `from_parts` validation — triggers it; user input has normally been sanitized before this point.","triggerScenarios":"Any local (file/path-based) remote connection, including subprocess spawns of `git upload-pack` for local repos; panic occurs only if `Url::from_parts` rejects the parts, which stock code never does.","commonSituations":"Forked/patched builds with stricter URL validation; path forms newly rejected by an updated `gix-url` version.","solutions":["Upgrade or align `gix-url` and `gix-transport` versions so `from_parts` accepts the file scheme with the given parts.","Check that the local path passed in is a valid non-empty byte path.","Report upstream with the exact path if a stock build panics."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"let t = std::panic::catch_unwind(AssertUnwindSafe(|| new_local(path, version, trace)));\nif t.is_err() { anyhow::bail!(\"local transport construction panicked; check gix-url version compatibility\"); }","preventionTips":["Keep gix-url and gix-transport versions aligned from the same release","Pass valid, non-empty local paths","Avoid patching from_parts validation in forks"],"tags":["rust","panic","internal-invariant","url","local-transport"],"backgroundTag":"internal-invariant-violation","analyzedSha":"e73179060badf27222d790981fac3f84c1830a7e","analyzedAt":"2026-09-08T11:26:50.865Z","contentChangedAt":"2026-09-08T11:26:50.865Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}