matryer/xbar · error

find app path

Error message

find app path

What it means

appPathFromExecutable failed to derive the application directory from the executable path; the error is wrapped as 'find app path'. This usually means the executable is not located where the updater expects an app bundle to live (e.g. not inside a .app bundle on macOS).

Source

Thrown at pkg/update/update.go:210

	defer resp.Body.Close()
	const defaultTempDir = ""
	f, err := os.CreateTemp(defaultTempDir, "*-"+filename)
	if err != nil {
		return errors.Wrap(err, "create temp file")
	}
	_, err = io.Copy(f, io.LimitReader(resp.Body, u.DownloadBytesLimit))
	if err != nil {
		f.Close()
		return errors.Wrap(err, "download asset")
	}
	f.Close()
	executable, err := u.GetExecutable()
	if err != nil {
		return errors.Wrap(err, "get executable")
	}
	appPath, err := appPathFromExecutable(executable)
	if err != nil {
		return errors.Wrap(err, "find app path")
	}
	appPathDir := filepath.Dir(appPath)
	appPreviousPath := appPath + ".previous"
	err = os.Rename(appPath, appPreviousPath)
	if err != nil {
		_, statErr := os.Stat(appPath)
		// not exist is ok, just ignore it
		if !os.IsNotExist(statErr) {
			return errors.Wrap(err, "rename existing app")
		}
	}
	err = archiver.Unarchive(f.Name(), appPathDir)
	if err != nil {
		return errors.Wrap(err, "unarchive")
	}
	err = os.RemoveAll(appPreviousPath)
	if err != nil {
		return errors.Wrap(err, "remove previous")

View on GitHub (pinned to d624239058)

Solutions

  1. Run the app from its properly installed location (e.g. inside the .app bundle on macOS).
  2. Check appPathFromExecutable's expected path layout and confirm your install matches it.
  3. If developing, stub or bypass the updater when running from a build directory.
  4. Update appPathFromExecutable to handle your install layout if it's a supported one.
Defensive patterns

Strategy: validation

Validate before calling

exe, _ := os.Executable()
exePath, _ := filepath.EvalSymlinks(exe)
if !strings.Contains(exePath, ".app/Contents/") && runtime.GOOS == "darwin" {
	return errors.New("not running from an installed .app bundle; self-update disabled")
}

Try / catch

err := u.Update()
if err != nil && strings.Contains(err.Error(), "find app path") {
	log.Printf("self-update unavailable for this install layout: %v", err)
	return nil
}

Prevention

When it happens

Trigger: Calling Update() when the running executable's path doesn't match the layout appPathFromExecutable expects — e.g. running the raw binary outside an application bundle, or from an unexpected directory.

Common situations: Running the binary directly from a terminal instead of the installed app (macOS .app bundle missing); running via `go run` or from a build dir; non-standard install locations.

Related errors


AI-assisted analysis of matryer/xbar@d624239058 (2026-09-02). Data as JSON: /api/errors/cba548f141ae067f. Report an issue: GitHub.