vectordotdev/vector · error

No ability to glob

Error message

No ability to glob

What it means

config::process_paths (src/config/loading/mod.rs) converts each config path to a &str for glob() with config_pattern.to_str().expect("No ability to glob"). Path::to_str() returns None when the path contains bytes that are not valid UTF-8 (possible on Unix) or invalid Unicode (Windows), so passing Vector a config path with non-UTF-8 bytes makes path processing panic during startup.

Source

Thrown at src/config/loading/mod.rs:104

        .into_iter()
        .flat_map(|(paths, format)| paths.iter().cloned().map(move |path| (path, format)))
}

/// Expand a list of paths (potentially containing glob patterns) into real
/// config paths, replacing it with the default paths when empty.
pub fn process_paths(config_paths: &[ConfigPath]) -> Option<Vec<ConfigPath>> {
    let starting_paths = if !config_paths.is_empty() {
        config_paths.to_owned()
    } else {
        default_config_paths()
    };

    let mut paths = Vec::new();

    for config_path in &starting_paths {
        let config_pattern: &PathBuf = config_path.into();

        let matches: Vec<PathBuf> = match glob(config_pattern.to_str().expect("No ability to glob"))
        {
            Ok(glob_paths) => glob_paths.filter_map(Result::ok).collect(),
            Err(err) => {
                error!(message = "Failed to read glob pattern.", path = ?config_pattern, error = ?err);
                return None;
            }
        };

        if matches.is_empty() {
            error!(message = "Config file not found in path.", path = ?config_pattern, internal_log_rate_limit = false);
            std::process::exit(exitcode::CONFIG);
        }

        match config_path {
            ConfigPath::File(_, format) => {
                for path in matches {
                    paths.push(ConfigPath::File(path, *format));
                }

View on GitHub (pinned to 3708c39b12)

Solutions

  1. Rename the config file/directory to a valid UTF-8 name: mv $'bad\xffname' bad-name && vector -c ./bad-name/vector.yaml
  2. Check the bytes of the path you are actually passing: printf '%s' "$CONFIG_PATH" | xxd — look for unexpected high bytes
  3. Ensure shell scripts and env vars (VECTOR_CONFIG) are set from UTF-8 sources and not byte-mangled by tools like ssh or containers

Example fix

# before
vector --config $'/etc/vector/conf\xff/vector.yaml'

# after
mv $'/etc/vector/conf\xff' /etc/vector/conf_fixed
vector --config /etc/vector/conf_fixed/vector.yaml
Defensive patterns

Strategy: validation

Validate before calling

// Before passing paths to Vector, confirm they are UTF-8
for p in &config_paths {
    if p.to_str().is_none() {
        return Err(format!("config path is not valid UTF-8: {:?}", p));
    }
}

Type guard

fn path_is_utf8(p: &std::path::Path) -> bool {
    p.to_str().is_some()
}

Prevention

When it happens

Trigger: Running vector -c <path> (or VECTOR_CONFIG env / default discovery) where <path> contains non-UTF-8 bytes — e.g. a directory named with Latin-1/invalid bytes from an old archive, or a shell variable carrying raw bytes ($'\xff'-style) passed as the config path. to_str() yields None and the expect panics before any config is read.

Common situations: Configs unpacked from legacy archives with mangled filenames; scripts passing byte-corrupted variables as paths; systems where filenames were created with a different locale/encoding than the current one.

Related errors


AI-assisted analysis of vectordotdev/vector@3708c39b12 (2026-08-20). Data as JSON: /api/errors/5230579a7ea54112. Report an issue: GitHub.