{"record":{"id":"5950ffb2fc5e18a0","repo":"Homebrew/homebrew-cask","slug":"unable-to-forcibly-close-zoom-us-app","errorCode":null,"errorMessage":"Unable to forcibly close zoom.us.app","messagePattern":"Unable to forcibly close zoom\\.us\\.app","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"Casks/z/zoom.rb","lineNumber":38,"sourceCode":"  conflicts_with cask: \"zoom-for-it-admins\"\n  depends_on :macos\n\n  pkg \"zoomusInstallerFull.pkg\"\n\n  postflight_steps do\n    # Description: Ensure console variant of postinstall is non-interactive.\n    # This is because `open \"$APP_PATH\"&` is called from the postinstall\n    # script of the package and we don't want any user intervention there.\n    terminate_process(\n      \"/Applications/zoom.us.app\",\n      match:           :full,\n      attempts:        3,\n      must_succeed:    false,\n      notices:         [\n        \"The Zoom package postinstall script launches the Zoom app\",\n        \"Attempting to close zoom.us.app to avoid unwanted user intervention\",\n      ],\n      failure_message: \"Unable to forcibly close zoom.us.app\",\n    )\n  end\n\n  uninstall launchctl: [\n              \"us.zoom.updater\",\n              \"us.zoom.updater.login.check\",\n              \"us.zoom.ZoomDaemon\",\n            ],\n            signal:    [\"KILL\", \"us.zoom.xos\"],\n            pkgutil:   \"us.zoom.pkg.videomeeting\",\n            delete:    [\n              \"/Applications/zoom.us.app\",\n              \"/Library/Internet Plug-Ins/ZoomUsPlugIn.plugin\",\n              \"/Library/Logs/DiagnosticReports/zoom.us*\",\n              \"/Library/PrivilegedHelperTools/us.zoom.ZoomDaemon\",\n            ]\n\n  zap trash: [","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/Homebrew/homebrew-cask/blob/8587086220f4568daf43b90d1a0baf391e930c9e/Casks/z/zoom.rb#L20-L56","documentation":"Printed by the terminate_process step in zoom's postflight_steps (Casks/z/zoom.rb:38). Zoom's .pkg postinstall runs `open \"$APP_PATH\"&`, auto-launching zoom.us.app; Homebrew then runs `/usr/bin/pkill -f /Applications/zoom.us.app` up to 3 times, 1 second apart, to keep the install non-interactive. pkill exits non-zero when no running process's full command line contains /Applications/zoom.us.app or when the signal cannot be delivered; after the final attempt Homebrew prints this failure_message as a `Warning:` via opoo. Because `must_succeed: false` is set, the warning never aborts the install — it only means the pattern went unmatched.","triggerScenarios":"`brew install|upgrade|reinstall --cask zoom` where every pkill attempt fails: the app never launched (headless Mac, CI, no GUI login, or the pkg skipped auto-open), the launch outlasted the ~3x1s retry window, a running copy executes from a different path (renamed or moved bundle), or Zoom's daemons (us.zoom.ZoomDaemon, us.zoom.updater — see the uninstall stanza, which also KILLs us.zoom.xos) interfered with the user-level pkill.","commonSituations":"Managed fleets and CI runners installing zoom with no logged-in desktop user; user quits Zoom during the retry window; slow launch after `open &`; vendor renaming the bundle in a pkg revision; an existing manual Zoom install running from another location.","solutions":["If brew completed, treat the warning as advisory (`must_succeed: false`); quit any leftover Zoom with `pkill -f /Applications/zoom.us.app`.","Quit Zoom before the operation (`osascript -e 'quit app \"zoom.us.app\"'` or menu-bar Quit), then re-run `brew reinstall --cask zoom`.","If Zoom reopens immediately, unload the daemons first: `launchctl bootout gui/$(id -u)/us.zoom.ZoomDaemon` and `us.zoom.updater`, then retry.","Verify with `pgrep -fl zoom.us.app` the real running path; if it differs from the cask's literal path, the cask is stale — `brew edit --cask zoom` and open a PR.","Confirm success with `brew list --cask --versions zoom` instead of re-running blindly."],"exampleFix":"# before\nbrew upgrade --cask zoom\n# Warning: Unable to forcibly close zoom.us.app\n\n# after: quit Zoom and its daemon, then upgrade\nosascript -e 'quit app \"zoom.us.app\"' || pkill -f '/Applications/zoom.us.app'\nlaunchctl bootout gui/$(id -u)/us.zoom.ZoomDaemon 2>/dev/null || true\nbrew upgrade --cask zoom","handlingStrategy":"validation","validationCode":"# Quit Zoom and its daemon before brew install/upgrade:\nosascript -e 'quit app \"zoom.us.app\"' 2>/dev/null || pkill -f '/Applications/zoom.us.app' 2>/dev/null || true\nlaunchctl bootout gui/$(id -u)/us.zoom.ZoomDaemon 2>/dev/null || true\nbrew reinstall --cask zoom","typeGuard":null,"tryCatchPattern":"begin\n  Homebrew::SystemCommand.run!(\"/usr/bin/pkill\", args: [\"-f\", \"/Applications/zoom.us.app\"])\nrescue ErrorDuringExecution\n  # Nothing matched: Zoom never launched (headless install) or the launch\n  # outran the 3x1s retry window. Non-fatal by design.\n  warn \"Unable to forcibly close zoom.us.app\"\nend","preventionTips":["Quit Zoom (us.zoom.xos) before `brew install/upgrade --cask zoom`.","Stop daemons that can relaunch it: `launchctl bootout gui/$(id -u)/us.zoom.ZoomDaemon` and `us.zoom.updater`.","On CI or GUI-less macs the warning is the norm — verify success with `brew list --cask zoom` instead of re-running.","Maintainers: keep the literal path /Applications/zoom.us.app in sync if the vendor ever renames the bundle, and validate with `pgrep -fl zoom.us.app` after a test install."],"tags":["homebrew","cask","macos","zoom","pkill","process-termination","postflight","daemon"],"backgroundTag":"pkill-no-process-matched","analyzedSha":"8587086220f4568daf43b90d1a0baf391e930c9e","analyzedAt":"2026-08-21T15:13:24.144Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}