quickwit-oss/quickwit · error

cannot join PostgreSQL URI

Error message

cannot join PostgreSQL URI `{}` with path `{:?}`

What it means

`Uri::join` was called on a `postgresql://` URI. PostgreSQL connection URIs encode a database name, not a hierarchical path, so path joining is not meaningful for this protocol and the match arm for Protocol::Postgres refuses the operation.

Solutions

  1. Specify the full PostgreSQL URI (including database name) instead of joining a path onto it
  2. Use a file-based or supported protocol URI when path joining is needed
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at quickwit/quickwit-common/src/uri.rs:237 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of quickwit-oss/quickwit@a39730c5cd (2026-09-08). Data as JSON: /api/errors/57eb1f058ec5e5f0. Report an issue: GitHub.

Appendix: source

Thrown at quickwit/quickwit-common/src/uri.rs:237

        self.uri
    }

    /// Creates a new [`Uri`] with `path` adjoined to `self`.
    /// Fails if `path` is absolute.
    pub fn join<P: AsRef<Path> + std::fmt::Debug>(&self, path: P) -> anyhow::Result<Self> {
        if path.as_ref().is_absolute() {
            bail!(
                "cannot join URI `{}` with absolute path `{:?}`",
                self.uri,
                path
            );
        }
        let joined = match self.protocol() {
            Protocol::File => Path::new(&self.uri)
                .join(path)
                .to_string_lossy()
                .to_string(),
            Protocol::PostgreSQL => bail!(
                "cannot join PostgreSQL URI `{}` with path `{:?}`",
                self.uri,
                path
            ),
            _ => format!(
                "{}{}{}",
                self.uri,
                if self.uri.ends_with('/') { "" } else { "/" },
                path.as_ref().display(),
            ),
        };
        Ok(Self {
            uri: joined,
            protocol: self.protocol,
        })
    }

    /// Attempts to construct a [`Uri`] from a string.

View on GitHub (pinned to a39730c5cd)