hasura/graphql-engine · error
find executable: %w
Error message
find executable: %w
What it means
ApplyUpdate starts by resolving the path of the currently running executable via getExecutablePath(); this error means that lookup failed (cli/update/update.go:134). On Go this is os.Executable()/os.LookupEnv based, so it fails when the binary was launched in a way the OS cannot map back to a file path.
Source
Thrown at cli/update/update.go:134
latestVersion, preReleaseVersion, err := getLatestVersion()
if err != nil {
return false, nil, false, nil, errors.E(op, fmt.Errorf("get latest version: %w", err))
}
return latestVersion.GreaterThan(
currentVersion,
), latestVersion, preReleaseVersion.GreaterThan(
currentVersion,
), preReleaseVersion, nil
}
// ApplyUpdate downloads and applies the update indicated by version v.
func ApplyUpdate(v *semver.Version) error {
var op errors.Op = "update.ApplyUpdate"
// get the current executable
exe, err := getExecutablePath()
if err != nil {
return errors.E(op, fmt.Errorf("find executable: %w", err))
}
// extract the filename and path
exePath := filepath.Dir(exe)
exeName := filepath.Base(exe)
// download the new binary
asset, err := downloadAsset(
buildAssetURL(v.String()), "."+exeName+".new", exePath,
)
if err != nil {
return errors.E(op, fmt.Errorf("download asset: %w", err))
}
// get the downloaded binary name and build the absolute path
newExe := asset.Name()
// build name and absolute path for saving old binaryView on GitHub (pinned to 724551b9ae)
Solutions
- Confirm the binary still exists at its original path (ls -l /proc/<pid>/exe).
- Run the CLI from a normal installed location rather than a temp/pipe-launched file.
- If in a container, ensure /proc is mounted and the binary is on a persistent path.
- Reinstall the CLI via your usual package method so the executable path is stable.
Defensive patterns
Strategy: validation
Validate before calling
exe, err := os.Executable()
if err != nil || exe == "" {
return fmt.Errorf("cannot resolve executable path; reinstall the CLI")
}
if _, err := os.Stat(exe); err != nil {
return fmt.Errorf("executable missing at %s", exe)
} Prevention
- Install the CLI at a stable filesystem path.
- Don't run the updater from a deleted or temp binary.
- In containers, keep /proc mounted and the binary on disk.
When it happens
Trigger: Calling ApplyUpdate when os.Executable() fails: the executable was deleted while running, /proc is not mounted, or the process was started via a pipe/fd instead of a file path.
Common situations: Running the binary through a wrapper that execs from a deleted temp file; minimal containers without /proc; the binary being replaced/deleted mid-run by another updater.
Related errors
- saving downloaded file: %w
- get latest version: %w
- download asset: %w
- rename exe to old: %w
- rename old to exe: inconsistent state, re-install cli: %w
AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28).
Data as JSON: /api/errors/b6a869fade1fa0c8.
Report an issue: GitHub.