Unexplained 403 error with CLI
I'm trying to use the CLI as I have been doing for the past few months, but I switched to another organisation and project.
I used sentry-cli login to generate a token for the new organisation and gave it all the required permissions.
Then upon trying to create a new release, I get:
error: http error: You do not have permission to perform this action. (403)
There's no further explanation as to why, it just fails with only this message. I've tried regenerating another token, adding all permissions, double checked that I'm logged in with the right org, etc.
The token is correctly stored in .sentryclirc and the default URL is set to Sentry's default.
Any idea what else could be going wrong and how to troubleshoot this issue? It seems like a simple authentication issue, but something must be messed up.
After more debugging I discovered that the CLI is actually still trying to access my old organisation. When I specifiy my old organisation and list projects, it actually lists them. I tried removing .sentryclirc but it still works.
Why is it still "logged in" to my old organisation? Where else can the CLI be trying to get a token from? I don't have any other .sentryclirc files, nor any sentry.properties files.
It would be really nice to be able to see what organisation you're logged in as on the API page, in case the problem lies there;

Currently this is not visible at all.
In the end the issue was that I was exporting a SENTRY_AUTH_TOKEN in my bash profile, which apparently overrides any and all .sentryclirc files.
Maybe this can be documented better, or perhaps a warning can be issued when doing sentry-cli login to inform the user that a global token override is present.
I got the same issue when upgrade react-native-sentry to 0.38. And react native 0.55
If your project on CI had some token inside, maybe old one like api-key, you don't know which or permissions were granted to it in past, so try to change it to new auth-token with all the permissions enabled and all be fine... 6 hours spend ot this error.
Thanks a lot @IgorKurkov for sharing what unblocked you for this! I'm going go ahead and close this issue as it seems stale. Anyone encountering this and not able to resolve it by @IgorKurkov's method, please use file a new issue or use the community forums to seek an answer.