sxyazi/yazi · error

Hub URL parent depth does not match its path

Error message

Hub URL parent depth does not match its path

What it means

Error "Hub URL parent depth does not match its path" thrown in sxyazi/yazi.

Source

Thrown at yazi-shared/src/url/cow.rs:216

	where
		D: Deserializer<'de>,
	{
		UrlBuf::deserialize(deserializer).map(UrlCow::from)
	}
}

fn validate_auth_path(auth: &AuthArc, path: PathDyn) -> Result<()> {
	auth.validate()?;
	ensure!(auth.path_kind()? == path.kind(), "URL path kind does not match Auth kind");

	if auth.kind.is_hub() {
		ensure!(
			auth.parent_depth() == path.components().auth_depth(),
			"Hub URL parent depth does not match its path"
		);
	}
	Ok(())
}

#[cfg(test)]
mod tests {
	use super::*;
	use crate::url::UrlLike;

	#[test]
	fn test_parse() -> Result<()> {
		crate::init_tests();

		struct Case {
			url:   &'static str,
			urn:   &'static str,
			uri:   &'static str,
			trail: &'static str,
			base:  &'static str,
		}

View on GitHub (pinned to 8ebf930f17)

Solutions

  1. Fix the hub URL construction so the parent count matches the path segments; this is internal, so report with the URL that triggered it.

When it happens

Trigger: Thrown at yazi-shared/src/url/cow.rs:244 when the library encounters an invalid state.

Common situations: Resolving `..` segments in a hub URL so that the number of parent traversals exceeds the path's actual depth.


AI-assisted analysis of sxyazi/yazi@8ebf930f17 (2026-08-19). Data as JSON: /api/errors/deeaaab65eb6f06d. Report an issue: GitHub.