Search code examples
sentry

How to use sentry-cli for self hosted Sentry


I am trying to use command:

sentry-cli sourcemaps explain $EVENT --org $ORG --project $PROJECT_NAME

but response is

error: API request failed
  caused by: sentry reported an error: Invalid token (http status: 401)

My token is of course right in .sentryclirc. With adding option --log-level=debug I noticed, that sentry-cli is trying to use Host: sentry.io, what is wrong.

So I tried to add parameter --url $URL to have

sentry-cli sourcemaps explain $EVENT --url $URL --org $ORG --project $PROJECT_NAME

but response is:

error: Found argument '--url' which wasn't expected, or isn't valid in this context

        If you tried to supply `--url` as a value rather than a flag, use `-- --url`

How can I use sentry-cli sourcemaps explain command for self hosted sentry then?


Solution

  • Right command is

    sentry-cli --url $URL sourcemaps explain $EVENT  --org $ORG --project $PROJECT_NAME