mj app remove/enable/disable print a second failure line and exit 2 (EEXIT: 1) on any failure
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- nodejs, typescript
Research direction
Read the three command files named in the issue and compare their failure handling with install.ts and upgrade.ts. Extend packages/MJCLI/src/tests/app-command-exit.test.ts for remove, enable, and disable, mocking the engine to return Success: false. Run those tests and the three repro commands; done means each prints one failure line and exits 1.
Written by the indexing model from the issue text.
Description
Found by the PR gauntlet on #4522 (fix/4505-private-repo-auth), 2026-10-20. Not caused by that PR: verified pre-existing at 426af00876. #4522 fixed the same defect in install.ts and upgrade.ts only.
Where
packages/MJCLI/src/commands/app/remove.ts:89packages/MJCLI/src/commands/app/enable.ts:43packages/MJCLI/src/commands/app/disable.ts:43
What happens
When the engine returns Success: false, each command calls this.exit(1) inside its try. oclif implements exit() by throwing ExitError (message EEXIT: 1). The command's own generic catch catches it, prints a second failure line, and calls this.error('EEXIT: 1'). That raises a new CLIError with the default exit code 2.
The output is:
✖ Remove failed: App 'x' is not installed
✖ Remove failed
› Error: EEXIT: 1
The process exits 2, not 1.
Why it matters
Scripts and CI that read the exit code get 2 for an ordinary failure. Users see a duplicate failure line and the internal string EEXIT: 1. After #4522, mj app install and mj app upgrade exit 1 once for the same kind of failure, so the mj app command family is now inconsistent.
Repro
node packages/MJCLI/bin/run.js app remove gauntlet-no-such-app --force; echo "exit=$?"
node packages/MJCLI/bin/run.js app disable gauntlet-no-such-app; echo "exit=$?"
node packages/MJCLI/bin/run.js app enable gauntlet-no-such-app; echo "exit=$?"
Each fails before any database write (the app lookup returns no row).
Evidence
The same mechanism on mj app install at 426af00876: a double "✖ Install failed" line, then › Error: EEXIT: 1, then exit 2. The #4522 fix and its test are packages/MJCLI/src/commands/app/install.ts (exit after the try/catch) and packages/MJCLI/src/__tests__/app-command-exit.test.ts.
Suggested fix
Do what #4522 did for install and upgrade. Set a failed flag in the else branch, and call this.exit(1) after the try/catch, not inside it. Extend app-command-exit.test.ts with remove, enable and disable cases (mock the engine to return Success: false, then assert error.oclif.exit === 1).
Definition of done
- A failing test for each of the three commands, then green
- Each repro command prints one failure line and exits 1
- Existing MJCLI suite and repo gates green; no changed expectation in an existing test
Verify by
Run the three repro commands. Each prints exactly one ✖ … failed: line and exit=1.
- Dominant language
- TSQL
- Stars
- 32
- Forks
- 7
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 714
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MemberJunction/MJ
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
MemberJunction/MJ#6024 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
MemberJunction/MJ#6018 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
MemberJunction/MJ#6012 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
MemberJunction/MJ#5952 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
MemberJunction/MJ#5864 ·
Maintainers usually reply within 1 day
All issues in MemberJunction/MJ
Similar issues
-
bug CLI documentation
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
openai/codex#56630 · 3 comments · 3 reactions ·
Maintainers usually reply within 1 day
-
bug:wrong-behaviour domain:cli source:agent status:ready
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug effort:s impact:low raised-by:verifier risk:low
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
medici-finance/assay#4246 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
Add CLI help commandOpenenhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
dominikgobel/kern#5 ·