{"record":{"id":"cba548f141ae067f","repo":"matryer/xbar","slug":"find-app-path","errorCode":null,"errorMessage":"find app path","messagePattern":"find app path","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/update/update.go","lineNumber":210,"sourceCode":"\tdefer resp.Body.Close()\n\tconst defaultTempDir = \"\"\n\tf, err := os.CreateTemp(defaultTempDir, \"*-\"+filename)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"create temp file\")\n\t}\n\t_, err = io.Copy(f, io.LimitReader(resp.Body, u.DownloadBytesLimit))\n\tif err != nil {\n\t\tf.Close()\n\t\treturn errors.Wrap(err, \"download asset\")\n\t}\n\tf.Close()\n\texecutable, err := u.GetExecutable()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"get executable\")\n\t}\n\tappPath, err := appPathFromExecutable(executable)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"find app path\")\n\t}\n\tappPathDir := filepath.Dir(appPath)\n\tappPreviousPath := appPath + \".previous\"\n\terr = os.Rename(appPath, appPreviousPath)\n\tif err != nil {\n\t\t_, statErr := os.Stat(appPath)\n\t\t// not exist is ok, just ignore it\n\t\tif !os.IsNotExist(statErr) {\n\t\t\treturn errors.Wrap(err, \"rename existing app\")\n\t\t}\n\t}\n\terr = archiver.Unarchive(f.Name(), appPathDir)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"unarchive\")\n\t}\n\terr = os.RemoveAll(appPreviousPath)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"remove previous\")","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/matryer/xbar/blob/d624239058997c80118eaebe2e7f8331b3c765e0/pkg/update/update.go#L192-L228","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","solutions":["Run the app from its properly installed location (e.g. inside the .app bundle on macOS).","Check appPathFromExecutable's expected path layout and confirm your install matches it.","If developing, stub or bypass the updater when running from a build directory.","Update appPathFromExecutable to handle your install layout if it's a supported one."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"exe, _ := os.Executable()\nexePath, _ := filepath.EvalSymlinks(exe)\nif !strings.Contains(exePath, \".app/Contents/\") && runtime.GOOS == \"darwin\" {\n\treturn errors.New(\"not running from an installed .app bundle; self-update disabled\")\n}","typeGuard":null,"tryCatchPattern":"err := u.Update()\nif err != nil && strings.Contains(err.Error(), \"find app path\") {\n\tlog.Printf(\"self-update unavailable for this install layout: %v\", err)\n\treturn nil\n}","preventionTips":["Install the app in the layout the updater expects (e.g. .app bundle on macOS)","Disable self-update in dev/build-directory runs","Document supported install locations for users"],"tags":["filesystem","paths","update"],"backgroundTag":"invalid-app-path-layout","analyzedSha":"d624239058997c80118eaebe2e7f8331b3c765e0","analyzedAt":"2026-09-02T22:38:22.007Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}