[sentry.io] No commits associated with a release

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.

3 Likes

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

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

1 Like

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

  • 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)

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.

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.

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

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

Just to confirm,

In our current setup, we’re using a personal GH account (read: not an org), the repository was linked to Sentry from this account, on an ‘admin’ Sentry account I do not have access to. I’m of course added as a contributor to this repository on GH.

Does this mean I’m out of luck, and that my personal Sentry token will never be able to add commits to a release?

EDIT: I also tried to “authorize” the repo again in the org settings (I’m a Manager), but i’m getting a 404 from GH apparently:
Screenshot%20from%202018-07-05%2015-32-19

@saveman71 can you try disconnecting GitHub in Account Settings -> Identities, and then re-adding/re-authorizing the repository?

I did that, I have the exact same error on the screenshot above. Note that the repo is already connected, and that I cannot disconnect it to try to connect it again because of a permission error on Sentry’s side.

Is this on Sentry.io? If so can you email support and reference this post. Otherwise I can come up with more debug steps.

It did worked for me in sentry 8.x release. But after upgrading to 9.x it does not work anymore. Its too buggy atm.