{"record":{"id":"eb9cc7d0b4f8ce1d","repo":"AdguardTeam/AdGuardHome","slug":"evaluating-executable-symlinks-v","errorCode":null,"errorMessage":"evaluating executable symlinks: %v","messagePattern":"evaluating executable symlinks: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/aghos/service_darwin.go","lineNumber":24,"sourceCode":"\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/AdguardTeam/golibs/log\"\n)\n\n// preCheckActionStart performs the service start action pre-check.  It warns\n// user that the service should be installed into Applications directory.\nfunc preCheckActionStart() (err error) {\n\texe, err := os.Executable()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"getting executable path: %v\", err)\n\t}\n\n\texe, err = filepath.EvalSymlinks(exe)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"evaluating executable symlinks: %v\", err)\n\t}\n\n\tif !strings.HasPrefix(exe, \"/Applications/\") {\n\t\tlog.Info(\"warning: service must be started from within the /Applications directory\")\n\t}\n\n\treturn err\n}\n","sourceCodeStart":6,"sourceCodeEnd":33,"githubUrl":"https://github.com/AdguardTeam/AdGuardHome/blob/b41aefbe51c8dde65e2c50f093996afa0502edf9/internal/aghos/service_darwin.go#L6-L33","documentation":"During the macOS pre-start check, filepath.EvalSymlinks on the executable path failed, so the code can't resolve the real location of the binary to compare against /Applications. Wrapped with %v, so the cause is embedded as text only.","triggerScenarios":"Starting the service on macOS when the executable path contains a symlink whose target no longer exists, or a path component is unreadable/permission-denied, causing EvalSymlinks to error (e.g. ENOENT on a dangling symlink).","commonSituations":"Launching via a symlink in ~/bin pointing to a moved/deleted AdGuardHome.app; translocated/quarantined app bundles; permission-restricted directories in the path.","solutions":["Point your launcher at the real binary inside /Applications/AdGuardHome.app (or copy it there)","Remove or fix dangling symlinks in the launch path: ls -l to inspect each component","Clear quarantine attributes if Gatekeeper translocation is involved: xattr -dr com.apple.quarantine /Applications/AdGuardHome.app"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"exe, err := os.Executable()\nif err == nil {\n    if _, err := filepath.EvalSymlinks(exe); err != nil { /* fix symlinks before starting */ }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Launch from real paths inside /Applications rather than symlinks","Remove dangling symlinks from launch chains","Clear quarantine attributes on downloaded app bundles"],"tags":["macos","symlink","evalsymlinks","service-start"],"backgroundTag":"symlink-resolution-failed","analyzedSha":"b41aefbe51c8dde65e2c50f093996afa0502edf9","analyzedAt":"2026-08-27T04:57:55.097Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}