jdx/mise · error
glob pattern is not valid UTF-8
Error message
glob pattern is not valid UTF-8: {} What it means
glob_walk builds the final glob pattern as a string via pattern_from_path; if the base/pattern path components are not valid UTF-8, the pattern cannot be converted into the string-based glob walker and mise bails. Non-UTF-8 filesystem paths (common on some Unix systems) are unsupported for glob matching.
Solutions
- Rename the offending file/directory to a UTF-8-safe name
- Set a UTF-8 locale and re-create the files so names are encoded as UTF-8
- Move the task's sources/outputs out of the non-UTF-8 path
- Convmv or equivalent tool to convert filenames to UTF-8 in place
Example fix
// before (filenames in Latin-1) ./src/café-old-bytes/main.rs // after convmv -f latin1 -t utf-8 -r --notest ./src mise run build
Defensive patterns
Strategy: validation
Validate before calling
find . -print0 | grep -qzP '[^\x00-\x7F]|(?s)^(?=[\x00-\xff]*$).*' && python3 -c "import os,sys
[sys.exit(f'non-UTF8 name: {p!r}') for root,_,fs in os.walk(b'.') for p in [root]+fs if not _try(p)]" 2>/dev/null || true; LC_ALL=C python3 -c "import os,sys
for root,dirs,files in os.walk(b'.'):
for n in dirs+files:
try: n.decode('utf-8')
except UnicodeDecodeError: sys.exit(f'non-UTF-8 path: {n!r}')" Try / catch
python3 check_utf8.py || { convmv -f latin1 -t utf-8 -r --notest . ; } ; mise run build Prevention
- Use UTF-8 locales when creating files
- Rename non-UTF-8 filenames at repo boundaries
- Check archive extraction encoding settings
- Run filename-encoding checks in CI
When it happens
Trigger: Calling task hashing/output machinery (save_checksum, get_file_metadatas, glob_walk) where the base directory or glob pattern path contains bytes that are not valid UTF-8, so pattern_from_path returns None.
Common situations: Project directories with legacy Latin-1 filenames; files created by scripts with raw bytes in names; archives extracted preserving non-UTF-8 names; mounts with unusual encodings.
Understand the failure class
Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.
Related errors
- history cannot represent a non-UTF-8 filename; refusing to…
- tracking does not support non-UTF-8 filenames
- truncated text: bytes is not a whole number of code units
- a glob is required
- a parent directory is now a symlink; left untouched
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/b5d05a1092033bbe.
Report an issue: GitHub.
Appendix: source
Thrown at src/task/task_source_checker.rs:527
if !globbing && let Some(file_name) = base.file_name().map(|name| name.to_os_string()) {
base.pop();
glob_pattern.push(file_name);
pattern_depth = 1;
}
while !base.as_os_str().is_empty() && !base.exists() {
let Some(file_name) = base.file_name().map(|name| name.to_os_string()) else {
break;
};
base.pop();
let mut prefixed_pattern = PathBuf::from(file_name);
prefixed_pattern.push(glob_pattern);
glob_pattern = prefixed_pattern;
pattern_depth += 1;
}
let Some(mut glob_pattern) = pattern_from_path(&glob_pattern) else {
bail!("glob pattern is not valid UTF-8: {}", pattern.display());
};
if glob_pattern.starts_with('!') {
glob_pattern.insert(0, '\\');
}
let mut builder = GlobWalkerBuilder::new(&base, glob_pattern)
.follow_links(true)
.sort_by(|a, b| a.file_name().cmp(b.file_name()))
.case_insensitive(case_insensitive);
if !recursive {
builder = builder.max_depth(pattern_depth);
}
Ok(builder.build()?)
}
/// Return a successful walk entry, pruning expected errors from following
/// symlinks that loop or point to a missing target.
pub(crate) fn prune_symlink_walk_error(View on GitHub (pinned to 533346cc37)