Skip to content

sentry-cli login Fails on macOS but Works on Windows and Ubuntu #2577

@sxsx2yzyz

Description

@sxsx2yzyz

CLI Version

sentry-cli 2.46.0

Operating System and Architecture

  • macOS (arm64)
  • macOS (x86_64)
  • Linux (i686)
  • Linux (x86_64)
  • Linux (armv7)
  • Linux (aarch64)
  • Windows (i686)
  • Windows (x86_64)

Operating System Version

14.6.1 (23G93)

Link to reproduction repository

No response

CLI Command

sentry-cli --url https:// login --auth-token [REDACTED]

Exact Reproduction Steps

  1. Use macOS device with sentry-cli version 2.46.0 installed.
  2. Ensure .sentryclirc file with the following contents exists at /Users/<REDACTED_USER>/.sentryclirc:
[defaults]
url = https://<REDACTED_DOMAIN>
[log]
level = trace
  1. Execute the following command (replace <REDACTED_TOKEN> with a valid token):
sentry-cli --url https://<REDACTED_DOMAIN> login --auth-token <REDACTED_TOKEN>
  1. Observe the output error.
  2. Repeat the same command on Windows or Ubuntu machines with the same token and verify it succeeds.
  3. Optionally, disconnect internet on macOS device and rerun the command to observe error behavior.

Expected Results

  1. The sentry-cli login command should successfully authenticate against the self-hosted Sentry server (https://<REDACTED_DOMAIN>) on macOS.
  2. The command should complete without errors and confirm a successful login.
  3. The same command and token should work consistently across all operating systems (macOS, Windows, Ubuntu).
  4. When internet is disconnected, the command should fail with a network-related error or retry, but should not immediately return an “Invalid token” error.

Actual Results

1.On macOS, running sentry-cli login with a valid token returns:

error: Invalid token: API request failed

2.The error occurs regardless of internet connection status (both connected and disconnected).
3.The same token and command succeed without issue on Windows and Ubuntu.
4.Logs show the command attempts the request, but fails locally with “Invalid token” without proper network validation.

Logs

<REDACTED_USER>@MacBook-Pro-2:led_ble_wifi_esp32_8_4zp <REDACTED_USER>$ sentry-cli --url https://<REDACTED_DOMAIN> login --auth-token <REDACTED_TOKEN>
  INFO    2025-07-06 20:39:23.701162 +08:00 Loaded config from /Users/<REDACTED_USER>/.sentryclirc
  DEBUG   2025-07-06 20:39:23.702693 +08:00 sentry-cli version: 2.46.0, platform: "darwin", architecture: "arm64"
  INFO    2025-07-06 20:39:23.709949 +08:00 sentry-cli was invoked with the following command line: "sentry-cli" "--url" "https://<REDACTED_DOMAIN>" "login" "--auth-token" "[REDACTED]"
This helps you signing in your sentry-cli with an authentication token.
If you do not yet have a token ready we can bring up a browser for you
to create a token now.

Sentry server: <REDACTED_DOMAIN>
  DEBUG   2025-07-06 20:39:23.711942 +08:00 request GET https://<REDACTED_DOMAIN>/api/0/
  DEBUG   2025-07-06 20:39:23.711976 +08:00 using token authentication
  DEBUG   2025-07-06 20:39:23.712027 +08:00 retry number 0, max retries: 5
  DEBUG   2025-07-06 20:39:23.714547 +08:00 > CONNECT <REDACTED_DOMAIN>:443 HTTP/1.1
  DEBUG   2025-07-06 20:39:23.714555 +08:00 > Host: <REDACTED_DOMAIN>:443
  DEBUG   2025-07-06 20:39:23.714557 +08:00 > Proxy-Connection: Keep-Alive
  DEBUG   2025-07-06 20:39:23.714585 +08:00 < HTTP/1.1 200 Connection established
error: Invalid token: API request failed
  INFO    2025-07-06 20:39:23.741240 +08:00 Skipping update nagger update check

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIssue typeCLIProduct area

    Projects

    Status

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions