Skip to content

Report a CLI that cannot start instead of asking for an update - #23

Merged
vladimir-tikhonov-nutrient merged 1 commit into
mainfrom
vtikhonov/cli-start-failure-reporting
Sep 28, 2026
Merged

vladimir-tikhonov-nutrient merged 1 commit into
mainfrom
vtikhonov/cli-start-failure-reporting

Conversation

@vladimir-tikhonov-nutrient

Copy link
Copy Markdown
Contributor

Problem

On Linux hosts without the ICU libraries (stock ubuntu:24.04 and most slim container images), every nutrient command failed with:

The installed Nutrient CLI does not support account commands. Connect to the internet and retry so it can be updated.

The binary wasn't outdated. The wrapper probes auth --help with its errors discarded, and the .NET runtime aborts on that probe (exit 134) because it can't load ICU. Conversions crashed with a raw stack trace, and the install check never noticed because it runs only --version, which doesn't start the runtime.

The underlying crash is in the native build (ICU is linked statically but not used by the runtime) and needs a GdPicture fix. This PR only makes the failure understandable.

Change

  • Account commands. When the probe exits with 126 or higher, the wrapper prints the binary's own first error lines, without managed stack frames or the shell's "Aborted" notice, and exits with the binary's status. A binary that runs but predates account commands keeps the existing message.
  • Install on Linux. After the existing --version smoke test, the wrapper probes auth --help once and prints the same diagnosis if the runtime can't start. The install still completes, so --version, --help, and --license keep working.
  • ICU hint. When the error names ICU, the wrapper names the package: apt-get install libicu-dev, apk add icu-libs, or dnf install libicu.
  • Docs. The README's Platform Support section notes the Linux ICU requirement, and the unpublished 0.6.0 changelog notes the change.

The install logic stays byte-identical across the three entry points.

Verification

  • npm test: 10 of 10 pass, including two new cases, a cached binary that crashes on the probe and a freshly installed one that does.
  • npm run check and shellcheck -s sh on all scripts: clean.
  • The sed filter was checked on BSD sed (macOS) and GNU sed.
  • Against the real 1.4.2 binary in ubuntu:24.04 without ICU, nutrient --version now prints:
The Nutrient CLI could not start (exit status 134):
Process terminated. Couldn't find a valid ICU package installed on the system. …
Install the ICU libraries, then retry. Debian or Ubuntu: apt-get install libicu-dev. Alpine: apk add icu-libs. Fedora or RHEL: dnf install libicu.

🤖 Generated with Claude Code

The nutrient entry point probed `auth --help` with its errors discarded and
reported any failure as a missing-account-commands update problem. On Linux
hosts without ICU, the .NET runtime aborts on that probe, so users were told to
connect to the internet when the fix was installing a system library.

Crashes (exit status 126 or higher) now show the binary's own first error
lines without managed stack frames, plus the ICU package to install when the
error names ICU. A binary that runs but predates account commands keeps the
existing message. On Linux, a new install also probes a command that starts
the runtime and warns once; the install still completes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vladimir-tikhonov-nutrient
vladimir-tikhonov-nutrient marked this pull request as ready for review September 28, 2026 10:52
@vladimir-tikhonov-nutrient
vladimir-tikhonov-nutrient merged commit e31f822 into main Sep 28, 2026
2 checks passed
@vladimir-tikhonov-nutrient
vladimir-tikhonov-nutrient deleted the vtikhonov/cli-start-failure-reporting branch September 28, 2026 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant