Skip to content

fix(cli): Stop the installer early on old glibc and name exact musl packages - #2926

Merged
BYK merged 1 commit into
mainfrom
fix/installer-old-glibc-musl-libs
Dec 5, 2026
Merged

BYK merged 1 commit into
mainfrom
fix/installer-old-glibc-musl-libs

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Fixes the installer for three kinds of host:

  • glibc older than 2.28 (CentOS 7, Amazon Linux 2, Ubuntu 18.04). The v4 binary can't run there. The installer now stops before any download and points to the 3.8.2 pin. Node 20, which the npm fallback needs, has the same glibc requirement, so the old npm hint didn't help these hosts either.
  • musl. The installer used to require libstdc++, libgcc_s and libatomic before downloading. Builds from 4.1.0 no longer link libatomic, and arm64 builds need only libgcc_s. After the download, the installer now asks ldd which libraries are missing and prints the exact apk add line.
  • Piped to sh. This used to fail with a syntax error. A POSIX guard at the top now says to pipe the installer to bash, or to run apk add bash first.

Installer error reports now include the tags registry.status, registry.curl_exit and libc.version.

Before and after, on CentOS 7:

before: Failed to fetch latest stable version from Sentry's release registry. Retry or install a specific version with --version <version>.
after:  Sentry CLI v4 needs glibc 2.28 or later, and this system has glibc 2.17. To install the last v3 release (sentry-cli) instead, run: curl -sL https://sentry.io/get-cli/ | SENTRY_CLI_VERSION=3.8.2 sh

This touches the same files as #2925, and the two merge cleanly. The run_setup and TTY handoff lines are unchanged.

via @BYK.

--

View Session [Sentry]

…ackages

The v4 binary needs glibc 2.28 or later. On older glibc, stop before any
download and point to the sentry-cli 3.8.2 install instead.

On musl, ask ldd which libraries the downloaded binary is missing and
print the exact apk add line, instead of requiring libatomic up front,
which musl builds from 4.1.0 no longer link.

Print how to run the installer with bash when it is piped to sh, and
send the registry status, curl exit code, and glibc version with
installer error reports.

Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
@sentry-junior
sentry-junior Bot requested a review from BYK December 5, 2026 02:50
@vercel

vercel Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cli Ready Ready Preview Dec 5, 2026 2:50am UTC
sentry-local Ready Ready Preview Dec 5, 2026 2:50am UTC

Request Review

Comment thread packages/cli/install
# `curl ... | sh` runs this with sh, which cannot parse the rest. Say how to
# run it instead of failing with a syntax error. Keep this block POSIX sh.
if [ -z "${BASH_VERSION:-}" ]; then
if command -v bash >/dev/null 2>&1; then

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we not make it run with sh?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It now reruns itself with bash when bash and curl are installed, in #2927. A full POSIX port of the installer would be a rewrite, so without bash it still prints apk add bash curl.

via @BYK.

Comment thread packages/cli/install
glibc_version="${glibc_version#glibc }"
[[ "$glibc_version" =~ ^([0-9]+)\.([0-9]+) ]] || return 0
if (( BASH_REMATCH[1] * 1000 + BASH_REMATCH[2] < 2028 )); then
die "Sentry CLI v4 needs glibc 2.28 or later, and this system has glibc ${glibc_version}. To install the last v3 release (sentry-cli) instead, run: curl -sL https://sentry.io/get-cli/ | SENTRY_CLI_VERSION=3.8.2 sh" "detect-glibc"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's fallback to V3 instead of erroring unless people asked for v4 in this case?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in #2927: on glibc < 2.28 it installs sentry-cli 3.8.2 through get-cli's v3 steps, unless a v4 version or nightly was asked for.

via @BYK.

@BYK
BYK added this pull request to the merge queue Dec 5, 2026
Merged via the queue into main with commit a4aad65 Dec 5, 2026
53 checks passed
@sentry-junior sentry-junior Bot changed the title fix(cli): Stop the installer early on old glibc and name exact musl packages fix(cli): Install v3 on old glibc, name exact musl packages, and run with bash from sh Dec 5, 2026
@sentry-junior sentry-junior Bot changed the title fix(cli): Install v3 on old glibc, name exact musl packages, and run with bash from sh fix(cli): Stop the installer early on old glibc and name exact musl packages Dec 5, 2026
github-actions Bot pushed a commit to Fields-Education/sentry-mcp that referenced this pull request Dec 5, 2026
…tsentry#2927)

Follow-up to getsentry#2926.

- **Old glibc (below 2.28).** The installer now installs v3 instead of
stopping, unless a v4 version or nightly was asked for. A pinned version
or nightly still stops with the 3.8.2 pin message. The v3 install hands
off to the v3 steps of `sentry.io/get-cli` (`SENTRY_CLI_VERSION=3.8.2`),
which install to `SENTRY_INSTALL_DIR` when it is set and to
`/usr/local/bin` otherwise.
- **POSIX sh.** `packages/cli/install` now runs under dash, BusyBox ash,
and bash, so `curl ... | sh` works without bash. Bare Alpine needs only
curl, and the installer prints `apk add curl` when it is missing.
- Bash keeps the ERR trap, so its error reports still name the failing
command, line, and function. Other shells report "Unexpected failure
(exit N)" from the EXIT trap.
- `local` stays: it is not POSIX, but dash, ash, bash, and zsh have it.
- The `/dev/tty` handoff is tried in a subshell first, because a failed
`exec 3</dev/tty` exits dash and ash.
  - `pipefail` is dropped.

Side effects of the v3 fallback:

- Users get the `sentry-cli` command, not `sentry`.
- get-cli's v3 steps exit with "sentry-cli is already installed" when
`sentry-cli` is already at the install path.

The planned `sentry-cli` error shim for v4 installs must not be
installed on this path, which installs the real `sentry-cli` 3.8.2.

Before and after, on CentOS 7:

```
before: Sentry CLI v4 needs glibc 2.28 or later, and this system has glibc 2.17. To install the last v3 release (sentry-cli) instead, run: curl -sL https://sentry.io/get-cli/ | SENTRY_CLI_VERSION=3.8.2 sh
after:  Sentry CLI v4 needs glibc 2.28 or later, and this system has glibc 2.17. Installing the last v3 release, which runs as sentry-cli, not sentry.
        ...
        Successfully installed sentry-cli 3.8.2
```

And on Debian, where `sh` is dash:

```
before: curl -fsSL https://cli.sentry.dev/install | sh   # syntax error
after:  curl -fsSL https://cli.sentry.dev/install | sh   # installs sentry
```

<!-- junior-request-attribution:start -->
via @BYK.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3Acefa2ca64f280f1e22c4160633ae292c -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent%3Acefa2ca64f280f1e22c4160633ae292c)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3Acefa2ca64f280f1e22c4160633ae292c/?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

2 active deployments
Preview – cli — 3d923ace Deployed Dec 5, 2026 by vercel[bot]
Preview – sentry-local — 3d923ace Deployed Dec 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant