{"record":{"id":"74ae8a2ed1224dcf","repo":"tirth8205/code-review-graph","slug":"raise-systemexit-1","errorCode":null,"errorMessage":"raise SystemExit(1)","messagePattern":"raise SystemExit\\(1\\)","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"code_review_graph/cli.py","lineNumber":1538,"sourceCode":"        def _print_report(report: UninstallReport) -> None:\n            for action in report.removed_paths:\n                print(f\"  delete  {action}\")\n            for action in report.edited_paths:\n                print(f\"  edit    {action}\")\n            for action in report.skipped_paths:\n                print(f\"  skip    {action}\")\n            for error in report.errors:\n                print(f\"  error   {error}\")\n\n        preview = run_uninstall(**options, dry_run=True)\n        if scoped_platforms:\n            print(f\"code-review-graph unbind ({platform_target}) — planned actions:\")\n        else:\n            print(\"code-review-graph uninstall — planned actions:\")\n        _print_report(preview)\n        if preview.total_actions == 0:\n            if preview.errors:\n                raise SystemExit(1)\n            if scoped_platforms:\n                print(\n                    f\"  (nothing to do — {platform_target} has no \"\n                    \"code-review-graph MCP registration)\"\n                )\n            else:\n                print(\"  (nothing to do — no code-review-graph artifacts found)\")\n            return\n        if args.dry_run:\n            print(\"\\n[dry-run] No changes made.\")\n            if preview.errors:\n                raise SystemExit(1)\n            return\n        action_word = \"unbind\" if scoped_platforms else \"uninstall\"\n        if not args.yes and not _confirm_yes_no(\n            f\"\\nProceed with {action_word}?\", default_yes=False\n        ):\n            print(\"Aborted.\")","sourceCodeStart":1520,"sourceCodeEnd":1556,"githubUrl":"https://github.com/tirth8205/code-review-graph/blob/b58668751ab0c7670c078cf7cbd4d1f5b8e54f81/code_review_graph/cli.py#L1520-L1556","documentation":"During uninstall/unbind, the CLI computes a preview of planned actions. If nothing needs removing but the preview collected errors, the CLI treats this as a failed state and exits with code 1 instead of a clean no-op. This distinguishes 'nothing installed' (success, informational message) from 'could not determine what is installed' (failure).","triggerScenarios":"Running `code-review-graph uninstall` (or a platform-scoped unbind) in an environment where scanning registrations produced errors — e.g. unreadable config files, permission problems on MCP registration locations — with zero actionable results.","commonSituations":"Partial or corrupted MCP client configurations, files locked by another process, permission-restricted home directory entries, or half-completed prior uninstalls leaving malformed config.","solutions":["Re-run with elevated permissions or fix ownership/permissions on the paths named in the preview errors","Inspect the printed report (_print_report output) to see which files failed to scan and repair or delete them manually","Re-run uninstall afterwards to confirm a clean exit"],"exampleFix":"# before\n$ code-review-graph uninstall\n(uninstall — planned actions: 0, errors present)\n$ echo $?\n1\n\n# after\n# fix the unreadable config reported in the preview, then:\n$ code-review-graph uninstall\n$ echo $?\n0","handlingStrategy":"try-catch","validationCode":"import subprocess, sys\nrc = subprocess.run([sys.executable, \"-m\", \"code_review_graph\", \"uninstall\", \"--dry-run\"]).returncode\nif rc != 0:\n    # preview may have errors; inspect config files before proceeding\n    ...","typeGuard":null,"tryCatchPattern":"In shell/Python scripts invoking the CLI, capture the exit code and treat 1 after a zero-action preview as 'inspect errors', printing the report for the offending paths instead of aborting the whole pipeline.","preventionTips":["Keep MCP registration files readable and well-formed","Avoid mixing sudo-installed and user-installed registrations","Run dry-run first and resolve reported errors before the real uninstall"],"tags":["cli","uninstall","permissions","exit-code-1"],"backgroundTag":"uninstall-cleanup-failed","analyzedSha":"b58668751ab0c7670c078cf7cbd4d1f5b8e54f81","analyzedAt":"2026-08-28T13:19:08.966Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}