{"record":{"id":"cb0436bfa16f18c0","repo":"quickwit-oss/quickwit","slug":"cannot-join-uri-with-absolute-path","errorCode":null,"errorMessage":"cannot join URI `{}` with absolute path `{:?}`","messagePattern":"cannot join URI `(.+?)` with absolute path `(.+?)`","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"quickwit/quickwit-common/src/uri.rs","lineNumber":226,"sourceCode":"        if self.protocol() == Protocol::Azure && path.components().count() < 3 {\n            return None;\n        }\n        if self.protocol() == Protocol::Google && path.components().count() < 2 {\n            return None;\n        }\n        path.file_name().map(Path::new)\n    }\n\n    /// Consumes the [`Uri`] struct and returns the normalized URI as a string.\n    pub fn into_string(self) -> String {\n        self.uri\n    }\n\n    /// Creates a new [`Uri`] with `path` adjoined to `self`.\n    /// Fails if `path` is absolute.\n    pub fn join<P: AsRef<Path> + std::fmt::Debug>(&self, path: P) -> anyhow::Result<Self> {\n        if path.as_ref().is_absolute() {\n            bail!(\n                \"cannot join URI `{}` with absolute path `{:?}`\",\n                self.uri,\n                path\n            );\n        }\n        let joined = match self.protocol() {\n            Protocol::File => Path::new(&self.uri)\n                .join(path)\n                .to_string_lossy()\n                .to_string(),\n            Protocol::PostgreSQL => bail!(\n                \"cannot join PostgreSQL URI `{}` with path `{:?}`\",\n                self.uri,\n                path\n            ),\n            _ => format!(\n                \"{}{}{}\",\n                self.uri,","sourceCodeStart":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/quickwit-oss/quickwit/blob/a39730c5cdcd1a4fe798403737ae293999ea21f8/quickwit/quickwit-common/src/uri.rs#L208-L244","documentation":"`Uri::join` was asked to adjoin a path to an existing URI, but the given path is absolute (starts with `/`). Joining would discard the URI's base path, so the guard rejects it before constructing the joined URI string. Callers are `default_metastore_uri`/`default_index_root_uri` building default paths.","triggerScenarios":"Thrown at quickwit/quickwit-common/src/uri.rs:226 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a relative path to `join` instead of an absolute one","Build a complete URI from scratch if an absolute location is intended"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a39730c5cdcd1a4fe798403737ae293999ea21f8","analyzedAt":"2026-09-08T13:19:37.784Z","contentChangedAt":"2026-09-08T13:19:37.784Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}