[sentry.io] No commits associated with a release


#1

For the past couple of months, I’ve been unable to get commits from a private GH repo tied to releases.

I’ve configured the repository under the organization and verified that the webhook is functioning properly. It’s been sending payloads successfully since mid-May and receiving HTTP 204 responses.

I’ve used the API via curl:

curl -X POST https://sentry.io/api/0/organizations/<org>/releases/ -H 'Authorization: Bearer <token>' -H 'Content-Type: application/json' -d'
{
  "version": "<numeric version>",
  "refs": [{
      "repository":"<repo>",
      "commit": "<toHash>",
      "previousCommit": "<fromHash>"
  }],
  "projects":["<project slug>"]
}
'

as well as the sentry-cli using both --commit and --auto switches:

sentry-cli releases new -p <project slug> <numeric version>
sentry-cli releases set-commits --auto <numeric version>

or

sentry-cli releases set-commits --commit "<repo>@<fromHash>..<toHash>"

In all cases I’m running sentry-cli from within a local git repository. Consistently from when I first began attempting to configure commits for releases, no attempt actually produces a release with any commit information:

curl -X GET https://sentry.io/api/0/organizations/<org>/releases/<numeric release>/ -H 'Authorization: Bearer <token>'
{"lastDeploy": {"name": "", "url": "", "environment": "<environment>", "dateStarted": null, "dateFinished": "2017-06-26T21:28:08.743Z", "id": "<id>"}, "dateCreated": "2017-06-26T21:28:08.029Z", "lastEvent": null, "shortVersion": "<numeric version>", "authors": [], "owner": null, "newGroups": 0, "data": {}, "projects": [{"slug": "<project slug>", "name": "<project name>"}], "dateReleased": null, "url": null, "deployCount": null, "commitCount": null, "version": "<numeric version>", "firstEvent": null, "lastCommit": null, "ref": null}

In the case of using sentry-cli, I do receive some manner of confirmation(?):

+------------------------------------+--------------+
| Repository                         | Revision     |
+------------------------------------+--------------+
| <repo>                             | <toHash>     |
+------------------------------------+--------------+

The token used for both curl and sentry-cli has the project:releases permission. If it’s significant, this project was creating releases long before the commit integration and deploy features were made available.

I’m hopeful that I can draw feedback on what I’m missing, here, in order to have functional commit integration.


#2

Having the exact same issue. The cli gives me the “confirmation” too.

However, a brief minute after I get an email containing:
Unable to Fetch Commits

We were unable to fetch the commit log for your release (xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx) due to the following error:

Unauthorized: either your access token was invalid or you do not have access

#3

@blitzz you dont have a valid (e.g. github) identity associated with the user who’s access token you’re using.


#4

Running into exact the same issue and I believe I have the Github identity setup correctly with the the token I’m using.

That’s what I’m seeing in my account settings: https://www.dropbox.com/s/8azhyjdofnowew7/Screenshot%202018-05-24%2009.58.30.png?dl=0


#5
  • Ensure you’re using an API token associated with the same account that has the GitHub identity
  • Ensure the GitHub access covers the repository (though it should if you’ve already added it into Sentry)

#6

From my end it looks like everything is in place. My account has the Github identity and I issued the token that I’m using.


#7

If you’re getting that error all I can really say is GitHub is returning a 404 for the repository, which means you dont have access via the token (and its privacy), or the token is no longer valid.

We’re working to improve these processes with a new GitHub integration (coming in the next couple of months), but unfortunately I dont have any other advice on this issue in the short term.


#8

Thanks, will keep poking around for a little bit. Could it be that github repo names/orgs are case sensitive?


#9

I found a workaroud for this issue. I hope it might be same. You need to have atleast Manager role in sentry. Then try to add a repository. It will ask for adding an identity. If you are using github SSO it will add the identity automatically. And then everything works