Issue
Sync Failed with Error - Cancelling sync because 0 accounts discovered.
Cause
This error occurs when the response for the API call below returns an empty result.
GET 'https://sentry.io/api/0/organizations/<OrganizationSlug>/users/'
Resolution
Run the curl comment below and replace the <OrganizationSlug> and <AuthToken> with the values from the Sentry app configs to check the response of the API call:
curl --request GET 'https://sentry.io/api/0/organizations/<OrganizationSlug>/users/' --header 'Authorization: Bearer <AuthToken>'
You can retrieve the <AuthToken> from the app ID in AWS secret manager. This value is masked in the Sentry UI.
If the response is an empty array, there are no users present.