{"record":{"id":"b6a869fade1fa0c8","repo":"hasura/graphql-engine","slug":"find-executable-w","errorCode":null,"errorMessage":"find executable: %w","messagePattern":"find executable: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/update/update.go","lineNumber":134,"sourceCode":"\tlatestVersion, preReleaseVersion, err := getLatestVersion()\n\tif err != nil {\n\t\treturn false, nil, false, nil, errors.E(op, fmt.Errorf(\"get latest version: %w\", err))\n\t}\n\n\treturn latestVersion.GreaterThan(\n\t\t\tcurrentVersion,\n\t\t), latestVersion, preReleaseVersion.GreaterThan(\n\t\t\tcurrentVersion,\n\t\t), preReleaseVersion, nil\n}\n\n// ApplyUpdate downloads and applies the update indicated by version v.\nfunc ApplyUpdate(v *semver.Version) error {\n\tvar op errors.Op = \"update.ApplyUpdate\"\n\t// get the current executable\n\texe, err := getExecutablePath()\n\tif err != nil {\n\t\treturn errors.E(op, fmt.Errorf(\"find executable: %w\", err))\n\t}\n\n\t// extract the filename and path\n\texePath := filepath.Dir(exe)\n\texeName := filepath.Base(exe)\n\n\t// download the new binary\n\tasset, err := downloadAsset(\n\t\tbuildAssetURL(v.String()), \".\"+exeName+\".new\", exePath,\n\t)\n\tif err != nil {\n\t\treturn errors.E(op, fmt.Errorf(\"download asset: %w\", err))\n\t}\n\n\t// get the downloaded binary name and build the absolute path\n\tnewExe := asset.Name()\n\n\t// build name and absolute path for saving old binary","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/update/update.go#L116-L152","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"exe, err := os.Executable()\nif err != nil || exe == \"\" {\n    return fmt.Errorf(\"cannot resolve executable path; reinstall the CLI\")\n}\nif _, err := os.Stat(exe); err != nil {\n    return fmt.Errorf(\"executable missing at %s\", exe)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["go","self-update","executable-path","os"],"backgroundTag":"executable-path-resolution-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}