astrid-runtime/astrid · error
managed install entry is redirected or not regular: {name}
Error message
managed install entry is redirected or not regular: {name} What it means
During apply_authenticated_update, before swapping in a new build, the updater verifies that every managed install entry is a regular file (checked via symlink_metadata so symlinked entries are rejected). If a managed binary name resolves to a symlink, directory, or other non-regular entry, the self-update aborts rather than overwrite something it does not own. This protects against hijacked installs (e.g. a binary replaced by a symlink to a user-managed tool like Homebrew or cargo shim).
Source
Thrown at crates/astrid-cli/src/commands/self_update/mod.rs:496
fn apply_authenticated_update<F>(
install_dir: &Path,
extract_dir: &Path,
target: &str,
install_native_assets: F,
) -> anyhow::Result<()>
where
F: FnOnce(&Path, &Path) -> anyhow::Result<()>,
{
prepare_macos_update_assets(extract_dir, target)?;
let managed = managed_binaries_for_target(target);
let previously_present = managed
.iter()
.map(
|name| match std::fs::symlink_metadata(install_dir.join(name)) {
Ok(metadata) if metadata.is_file() && !metadata.file_type().is_symlink() => {
Ok(true)
},
Ok(_) => bail!("managed install entry is redirected or not regular: {name}"),
Err(error) if error.kind() == std::io::ErrorKind::NotFound => Ok(false),
Err(error) => Err(error.into()),
},
)
.collect::<anyhow::Result<Vec<_>>>()?;
backup_and_swap(install_dir, extract_dir, &managed)?;
if target.contains("-apple-darwin")
&& let Err(native_error) = install_native_assets(extract_dir, install_dir)
{
return match restore_managed_set(install_dir, &managed, &previously_present) {
Ok(()) => Err(native_error.context(
"macOS app update failed; the prior managed Astrid set was restored",
)),
Err(rollback_error) => Err(native_error.context(format!(
"macOS app update failed and managed-set rollback also failed ({rollback_error}); restore the retained *.bak files manually"
))),
};
}View on GitHub (pinned to affd8760f4)
Solutions
- Remove the symlink and place a real (self-managed) binary there: `rm <install_dir>/<name> && cp <real-binary> <install_dir>/<name>`.
- If the install is actually package-manager-managed, do not use self-update; upgrade via the managing tool (brew upgrade / cargo install) instead.
- Reinstall Astrid via the official self-managed installer so all managed entries are regular files, then re-run self-update.
Example fix
// before (managed entry is a symlink) lrwxr-xr-x astrid -> /opt/homebrew/bin/astrid # self-update bails // after (regular file, self-managed) $ rm /usr/local/bin/astrid $ cp target/release/astrid /usr/local/bin/astrid $ astrid self update
Defensive patterns
Strategy: validation
Validate before calling
let meta = std::fs::symlink_metadata(install_dir.join(name))?;
if !meta.is_file() || meta.file_type().is_symlink() {
eprintln!("{name} is not a regular file; resolve the install before self-update");
} Type guard
fn is_regular_file(p: &std::path::Path) -> bool {
std::fs::symlink_metadata(p)
.map(|m| m.is_file() && !m.file_type().is_symlink())
.unwrap_or(false)
} Prevention
- Never symlink package-manager binaries into a directory you intend to self-update.
- Install Astrid self-managed via the official installer so managed entries are real files.
- Before updating, run `ls -la` on the install dir and replace any symlinks with copies.
When it happens
Trigger: Running `astrid self update` on an install where one of the managed binaries in the install directory is a symlink or a non-file entry. Most often: the binary at install_dir/<name> is a symlink into Homebrew, cargo, nix, or a user-local bin directory.
Common situations: User first installed via Homebrew/cargo and later copied a release build into a directory, or an admin symlinked the binary into a shared install dir; also seen when the updater's install dir was pre-populated with wrappers/symlinks from a package manager.
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
- release executable is redirected or not regular: {name}
- leftover capsule authority receipt is not a regular file: {}
- legacy capsule authority root is not a regular directory: {}
- legacy capsule authority root contains a non-regular entry:
- legacy capsule authority root is not a regular directory: {}
AI-assisted analysis of astrid-runtime/astrid@affd8760f4 (2026-09-09).
Data as JSON: /api/errors/6ec714e07af1dd82.
Report an issue: GitHub.