Repository navigation
fix(cli): Install v3 on old glibc and make the installer POSIX sh - #2927
Merged
Merged
Conversation
…rom sh On glibc older than 2.28, install sentry-cli 3.8.2 through the v3 steps of sentry.io/get-cli, unless a v4 version or nightly was asked for. When run with sh and bash is available, rerun the installer with bash: the local file when sh ran one, otherwise a fresh download, since sh may already have read ahead in a piped script.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Linux builds from 4.1.0 no longer link libatomic.
BYK
requested changes
Dec 5, 2026
BYK
left a comment
Member
There was a problem hiding this comment.
Ideally we shouldn't try to redownload the installer. And if there's no blocker making this compatible with sh, we should just with that path
The installer now runs under dash, BusyBox ash, and bash, so `curl ... | sh` works without bash and the installer no longer reruns itself with bash or downloads itself again. Bash keeps the ERR trap, which names the failing command, line, and function. Other shells report an unexpected failure from the EXIT trap with its exit status. `local` stays, since dash, ash, bash, and zsh have it, with every assignment quoted. pipefail is dropped. The /dev/tty handoff is probed in a subshell first, because a failed `exec 3<` exits dash and ash. Without curl, the installer says to install it, naming `apk add curl` on Alpine. check-installer-libc.sh runs the installer with the image's sh. Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
Contributor
Author
|
Done in 3473989d1: the installer is POSIX sh now, so there's no rerun with bash and no second download. It runs under dash, BusyBox ash and bash; bare Alpine needs only Tradeoffs:
via @BYK. |
BYK
approved these changes
Dec 5, 2026
14 of 16 tasks
github-actions Bot
pushed a commit
to Fields-Education/sentry-mcp
that referenced
this pull request
Dec 5, 2026
v4 installs only `sentry`. A v3 script that calls `sentry-cli` gets "command not found". If the script saved a v4 binary as `sentry-cli`, it runs v4 commands it wasn't written for. Both cases now fail the same way: a message that says what changed, then exit code 1. It never runs `sentry`. Before: ``` $ sentry-cli releases new 1.0 sh: 1: sentry-cli: not found # exit 127 ``` After: ``` $ sentry-cli --version Error: sentry-cli is now sentry. Sentry CLI v4 renamed the command and changed some commands and flags. Update your scripts: https://cli.sentry.dev/migrating-from-v3/ Or stay on v3: npm: npm install @sentry/cli@3 pip: pip install "sentry-cli<4" get-cli: curl -sL https://sentry.io/get-cli/ | SENTRY_CLI_VERSION=3.8.2 sh # exit 1 ``` - **Binary:** `bin.ts` shows the message when the process runs as `sentry-cli` or `sentry-cli.exe`. It checks `argv0` (the name the binary was invoked as, which keeps a symlink's name) and the binary's own file name. Run as `sentry`, nothing changes, and the hidden v3 aliases still work. The npm package runs under `node`, so the check never fires there. - **PyPI `sentry-cli`:** the wheels add a `sentry-cli` console script. pip writes a launcher for it on every platform, `sentry-cli.exe` on Windows. - **npm `@sentry/cli` is left out on purpose.** A second bin would break `npx @sentry/cli …` (npm: "could not determine executable to run") and `pnpm dlx @sentry/cli …`, which run v4 `sentry` today. - **get-cli (`install`)** comes in a follow-up, after getsentry#2927. The message and exit code live in `src/lib/sentry-cli-rename.ts`. <!-- junior-request-attribution:start --> via @BYK. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3Af43004685b81a1275821d14a033373dd --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3Af43004685b81a1275821d14a033373dd) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3Af43004685b81a1275821d14a033373dd/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: BYK <126780+BYK@users.noreply.github.com>
BYK
added a commit
to getsentry/sentry
that referenced
this pull request
Dec 5, 2026
> [!NOTE] > getsentry/toolkit#2927 is merged and live: https://cli.sentry.dev/install serves the POSIX sh installer as of CLI 4.2.0, so this is safe to merge. Before that, the bash installer it served could not run under dash. getsentry/toolkit#2927 ports the v4 installer to POSIX sh, so get-cli no longer needs bash for v4. This runs the installer with `sh` and drops the bash check. `curl -sL https://sentry.io/get-cli/ | sh` then works on hosts without bash, such as Alpine and slim Debian images. Pinned v3 installs (`SENTRY_CLI_VERSION` below 4) never needed bash and are unchanged. Before, on a host without bash: ``` $ curl -sL https://sentry.io/get-cli/ | sh error: the Sentry CLI installer needs bash. Install bash, or run: npm install -g sentry ``` After: ``` $ curl -sL https://sentry.io/get-cli/ | sh ... The Sentry CLI now runs as 'sentry' and replaces 'sentry-cli'. $ sentry --version 4.2.0 ``` <!-- junior-request-attribution:start --> via @BYK. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3Ab28bded1d64c2a093622ba9be2f2d0ea --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3Ab28bded1d64c2a093622ba9be2f2d0ea) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3Ab28bded1d64c2a093622ba9be2f2d0ea/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: BYK <126780+BYK@users.noreply.github.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #2926.
sentry.io/get-cli(SENTRY_CLI_VERSION=3.8.2), which install toSENTRY_INSTALL_DIRwhen it is set and to/usr/local/binotherwise.packages/cli/installnow runs under dash, BusyBox ash, and bash, socurl ... | shworks without bash. Bare Alpine needs only curl, and the installer printsapk add curlwhen it is missing.localstays: it is not POSIX, but dash, ash, bash, and zsh have it./dev/ttyhandoff is tried in a subshell first, because a failedexec 3</dev/ttyexits dash and ash.pipefailis dropped.Side effects of the v3 fallback:
sentry-clicommand, notsentry.sentry-cliis already at the install path.The planned
sentry-clierror shim for v4 installs must not be installed on this path, which installs the realsentry-cli3.8.2.Before and after, on CentOS 7:
And on Debian, where
shis dash:via @BYK.
--
View Session [Sentry]