Skip to content

Commit 2326243

Browse files
fix(install): Send error envelopes with Sentry CLI v4 (#4643)
From 4.0.0 on, getsentry/sentry-cli:latest is the v4 CLI. It has no send-envelope command, so the install error reporter would stop sending reports. send_envelope now checks the image's --version and uses `event send --raw` on v4, keeping send-envelope for the v3 image that latest still points to until 4.0.0 is published. Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: BYK <126780+BYK@users.noreply.github.com>
1 parent bdcac99 commit 2326243

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎install/error-handling.sh‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,16 @@ sentry_cli="$CONTAINER_ENGINE run --rm -v /tmp:/work -e SENTRY_DSN=$SENTRY_DSN g
99
DEFAULT_BREADCRUMB_LINE_LIMIT=200
1010

1111
send_envelope() {
12-
# Send envelope
13-
$sentry_cli send-envelope "$envelope_file"
12+
# getsentry/sentry-cli:latest is Sentry CLI v4 from 4.0.0 on. v4 replaced
13+
# send-envelope with `event send --raw`, and reads a bare file name as a
14+
# project slug, so the path starts with ./ there.
15+
local version
16+
version=$($sentry_cli --version)
17+
if [[ "$version" == "sentry-cli "* ]]; then
18+
$sentry_cli send-envelope "$envelope_file"
19+
else
20+
$sentry_cli event send --raw "./$envelope_file"
21+
fi
1422
}
1523

1624
generate_breadcrumb_json() {

0 commit comments

Comments
 (0)