{"record":{"id":"84e0d92da5c72193","repo":"Homebrew/homebrew-cask","slug":"no-running-instances-of-trader-workstation-found","errorCode":null,"errorMessage":"No running instances of Trader Workstation found","messagePattern":"No running instances of Trader Workstation found","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"Casks/t/trader-workstation.rb","lineNumber":39,"sourceCode":"    end\n  end\n\n  auto_updates true\n  depends_on :macos\n\n  installer script: {\n    executable: \"#{staged_path}/Trader Workstation Installer.app/Contents/MacOS/JavaApplicationStub\",\n    args:       [\n      \"-dir\", \"#{appdir}/Trader Workstation\",\n      \"-q\"\n    ],\n  }\n\n  uninstall_preflight_steps do\n    terminate_process \"{{appdir}}/Trader Workstation/Trader Workstation.app\",\n                      match: :full, must_succeed: false,\n                      notices: [\"Stopping all running instances of Trader Workstation prior to uninstall\"],\n                      failure_message: \"No running instances of Trader Workstation found\"\n  end\n\n  uninstall quit:   \"com.install4j.5889-6375-8446-2021\",\n            script: {\n              executable: \"#{appdir}/Trader Workstation/Trader Workstation Uninstaller.app/Contents/MacOS/JavaApplicationStub\",\n              args:       [\"-q\"],\n            }\n\n  zap trash: [\n    \"#{appdir}/Trader Workstation\",\n    \"~/Applications/Trader Workstation\",\n    \"~/Jts\",\n    \"~/Library/Application Support/Trader Workstation\",\n  ]\nend\n","sourceCodeStart":21,"sourceCodeEnd":55,"githubUrl":"https://github.com/Homebrew/homebrew-cask/blob/8587086220f4568daf43b90d1a0baf391e930c9e/Casks/t/trader-workstation.rb#L21-L55","documentation":"Printed by the terminate_process step in trader-workstation's uninstall_preflight_steps (Casks/t/trader-workstation.rb:39). Before uninstalling, Homebrew expands the `{{appdir}}` template and runs `/usr/bin/pkill -f <appdir>/Trader Workstation/Trader Workstation.app` (attempts defaults to 1 here) to stop IBKR's Java-based Trader Workstation so the bundled uninstaller script can run cleanly. pkill exits non-zero when no running process's command line matches — i.e. the app simply is not running — and Homebrew then prints this failure_message as a `Warning:`. With `must_succeed: false` the uninstall always proceeds; despite the phrasing, this message means 'nothing had to be stopped', not an error.","triggerScenarios":"`brew uninstall --cask trader-workstation` (or zap) while Trader Workstation is not running: the single pkill attempt matches no process, exits 1, and the 'No running instances ... found' warning is printed before the quit/uninstaller steps run. It also fires if TWS runs under a command line that does not literally contain the expanded appdir path (custom --appdir, renamed bundle).","commonSituations":"Routine uninstall on a machine where TWS was already closed — the expected, harmless case; installs to a non-default appdir making the expanded path differ from the running Java process's command line; slow-starting JVM appearing after the single attempt.","solutions":["No action needed in the common case: the message states that no running instances were found, and `must_succeed: false` lets the uninstall continue — verify with `brew list --cask trader-workstation` afterwards.","If TWS actually is running, quit it first (`osascript -e 'quit app \"Trader Workstation\"'` or `pkill -f 'Trader Workstation.app'`) so the install4j uninstaller is not blocked, then re-run `brew uninstall --cask trader-workstation`.","If you use a custom appdir, confirm with `pgrep -fl 'Trader Workstation'` that the running process path matches the cask's expanded `{{appdir}}` template.","Do not retry the uninstall solely because of this warning; check exit status and `brew list --cask` instead."],"exampleFix":"# before\nbrew uninstall --cask trader-workstation\n# Warning: No running instances of Trader Workstation found\n\n# after: only stop something if it is really running, then uninstall\npgrep -fl 'Trader Workstation' && pkill -f 'Trader Workstation.app'\nbrew uninstall --cask trader-workstation","handlingStrategy":"validation","validationCode":"# Check whether anything actually needs stopping before uninstalling:\nif pgrep -fl 'Trader Workstation'; then pkill -f 'Trader Workstation.app'; sleep 1; fi\nbrew uninstall --cask trader-workstation  # the warning when idle is expected and harmless","typeGuard":null,"tryCatchPattern":"begin\n  Homebrew::SystemCommand.run!(\"/usr/bin/pkill\",\n    args: [\"-f\", \"#{appdir}/Trader Workstation/Trader Workstation.app\"])\nrescue ErrorDuringExecution\n  # Expected whenever TWS is not running: pkill exits 1 on no match.\n  warn \"No running instances of Trader Workstation found\"\nend","preventionTips":["Expect the warning on every uninstall where Trader Workstation is closed — it means pkill found nothing to stop.","If TWS is running, quit it (`osascript -e 'quit app \"Trader Workstation\"'`) before `brew uninstall` so the install4j uninstaller is not blocked.","Verify with `pgrep -fl 'Trader Workstation'` whether any Java process is alive rather than trusting the warning text.","Judge the uninstall by `brew list --cask trader-workstation` and exit code, never by this warning."],"tags":["homebrew","cask","macos","trader-workstation","pkill","process-termination","uninstall-preflight"],"backgroundTag":"pkill-no-process-matched","analyzedSha":"8587086220f4568daf43b90d1a0baf391e930c9e","analyzedAt":"2026-08-21T15:13:24.144Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}