Repository navigation
fix(cli): Stop the installer early on old glibc and name exact musl packages - #2926
Merged
Merged
Conversation
…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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
BYK
approved these changes
Dec 5, 2026
| # `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 |
Contributor
Author
| 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" |
Member
There was a problem hiding this comment.
Let's fallback to V3 instead of erroring unless people asked for v4 in this case?
Contributor
Author
14 of 16 tasks
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
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.
Fixes the installer for three kinds of host:
libstdc++,libgcc_sandlibatomicbefore downloading. Builds from 4.1.0 no longer linklibatomic, and arm64 builds need onlylibgcc_s. After the download, the installer now askslddwhich libraries are missing and prints the exactapk addline.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 runapk add bashfirst.Installer error reports now include the tags
registry.status,registry.curl_exitandlibc.version.Before and after, on CentOS 7:
This touches the same files as #2925, and the two merge cleanly. The
run_setupand TTY handoff lines are unchanged.via @BYK.
--
View Session [Sentry]