windmill-labs/windmill · error

Internal error: path should not end with '/'

Error message

Internal error: path should not end with '/'

What it means

Before checking which dependencies are missing, `filter_to_missing` dedupes RequiredDependency entries and asserts an internal invariant: each dependency's install path must not end with '/'. A trailing slash would corrupt the `<path>.valid.windmill` marker lookup, so it fails fast as an internal construction bug rather than a user-facing problem.

Source

Thrown at backend/windmill-worker/src/universal_pkg_installer.rs:531

            let layers = graph.layers();
            (layers, Some((deps_map, nodes_display)))
        }
    };

    let mut name_ml = 0;
    let mut missing_keys: HashSet<String> = HashSet::new();
    let mut total_missing = 0;

    for layer in layers.iter_mut() {
        *layer = std::mem::take(layer)
            .into_iter()
            .unique_by(|rd| rd.path.clone())
            .collect();

        let mut missing = vec![];
        for rd in std::mem::take(layer) {
            if rd.path.ends_with("/") {
                anyhow::bail!("Internal error: path should not end with '/'")
            }
            if rd.display_name.len() > name_ml {
                name_ml = rd.display_name.len();
            }
            if tokio::fs::metadata(rd.path.clone() + ".valid.windmill")
                .await
                .is_err()
            {
                if let Some(key) = rd.path.rsplit('/').next() {
                    missing_keys.insert(key.to_string());
                }
                missing.push(rd);
            }
        }
        total_missing += missing.len();
        *layer = missing;
    }

View on GitHub (pinned to e474e8803c)

Solutions

  1. Fix the code that builds RequiredDependency.path so it never appends a trailing '/' (e.g. `trim_end_matches('/')` when composing from URLs or directory joins)
  2. Audit custom/patched executor or extension code that constructs dependency paths
  3. If caused by a configured repository URL ending in '/', remove the trailing slash from the configuration

Example fix

// before
let path = format!("{repo_url}/{group}/{artifact}/{version}/");
// after
let path = format!("{}/{}/{artifact}/{version}", repo_url.trim_end_matches('/'));
Defensive patterns

Strategy: validation

Validate before calling

// guard before constructing/installing in custom code
assert!(!dep.path.ends_with('/'), "dependency path must not end with '/': {}", dep.path);

Type guard

fn valid_dep_path(rd: &RequiredDependency) -> bool {
    !rd.path.ends_with('/')
}

Prevention

When it happens

Trigger: Any dependency install path reaching par_install_language_dependencies_all_at_once or _seq whose RequiredDependency.path was built with a trailing slash — a path-building bug in a language executor's dependency construction (e.g. `format!("{dir}/")`) or a trailing-slash URL leaking into the composed path.

Common situations: After customizing or extending a language executor's path-building code; a registry/mirror URL with a trailing slash used in path composition; hand-edited or plugin-generated dependency entries.

Related errors


AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03). Data as JSON: /api/errors/77dd064f22f43c33. Report an issue: GitHub.