Sentry-cli on heroku

I’m developing an Node.js + Angular app running on Heroku.

I have a script working fine locally with the sentry-cli to create releases, sync source-maps and associate commits. But it does not work in Heroku, fails with:

error: could not find repository from '.'; class=Repository (6); code=NotFound (-3)

I run the script in a post-install hook, but obviously I don’t have access to git from here (since it deleted by heroku according to this doc).

So what do people do if they wan’t to integrate Sentry and Heroku - is it event possible?

Can you run sentry-cli with --log-level=debug and paste what it spits out?

So I ended up adopting my Sentry-cli commands, to utilize the Heroku env variable: HEROKU_TEST_RUN_COMMIT_VERSION.

Something like this

VERSION="${HEROKU_TEST_RUN_COMMIT_VERSION}"

echo "The Sentry release-tasks script will now create release with id: '${VERSION}'"
sentry-cli releases new "$VERSION" -p <project>

sentry-cli releases set-commits --commit "owner/repo@${VERSION}" $VERSION

echo "Uploading sourcemaps"
sentry-cli releases -p <project> files $VERSION upload-sourcemaps ./path-to-sourcemaps/build --no-rewrite

And I actually think it works :slight_smile:

Hi @mitsuhiko,

I’m having this same issue.
Running
sentry-cli releases set-commits 99e7be975c2776769e74af9bac09dde948e2db06 --auto --log-level=debug
Gives me:
INFO 2020-06-10 22:11:49.112361589 +00:00 Loaded config from /root/.sentryclirc DEBUG 2020-06-10 22:11:49.112547560 +00:00 sentry-cli version: 1.54.0, platform: "linux", architecture: "x86_64" INFO 2020-06-10 22:11:49.112657874 +00:00 sentry-cli was invoked with the following command line: "sentry-cli" "releases" "set-commits" "99e7be975c2776769e74af9bac09dde948e2db06" "--auto" "--log-level=debug" DEBUG 2020-06-10 22:11:49.114686833 +00:00 request GET https://sentry.io/api/0/organizations/fleetwire-llc/repos/?cursor= DEBUG 2020-06-10 22:11:49.114836303 +00:00 using token authentication DEBUG 2020-06-10 22:11:49.114932148 +00:00 retry number 0, max retries: 0 DEBUG 2020-06-10 22:11:49.243431107 +00:00 > GET /api/0/organizations/fleetwire-llc/repos/?cursor= HTTP/1.1 DEBUG 2020-06-10 22:11:49.243623368 +00:00 > Host: sentry.io DEBUG 2020-06-10 22:11:49.243727390 +00:00 > Accept: */* DEBUG 2020-06-10 22:11:49.243866976 +00:00 > Connection: TE DEBUG 2020-06-10 22:11:49.243972965 +00:00 > TE: gzip DEBUG 2020-06-10 22:11:49.244074100 +00:00 > User-Agent: sentry-cli/1.54.0 DEBUG 2020-06-10 22:11:49.244770778 +00:00 > Authorization: Bearer 4260996d*** DEBUG 2020-06-10 22:11:49.334301189 +00:00 < HTTP/1.1 200 OK DEBUG 2020-06-10 22:11:49.334524864 +00:00 < Server: nginx DEBUG 2020-06-10 22:11:49.334636729 +00:00 < Date: Wed, 10 Jun 2020 22:11:49 GMT DEBUG 2020-06-10 22:11:49.334749869 +00:00 < Content-Type: application/json DEBUG 2020-06-10 22:11:49.334851445 +00:00 < Content-Length: 292 DEBUG 2020-06-10 22:11:49.334992265 +00:00 < Connection: keep-alive DEBUG 2020-06-10 22:11:49.335098868 +00:00 < Access-Control-Allow-Headers: X-Sentry-Auth, X-Requested-With, Origin, Accept, Content-Type, Authentication, Authorization, Content-Encoding DEBUG 2020-06-10 22:11:49.335166221 +00:00 < X-Content-Type-Options: nosniff DEBUG 2020-06-10 22:11:49.335228484 +00:00 < Content-Language: en DEBUG 2020-06-10 22:11:49.335289569 +00:00 < Access-Control-Expose-Headers: X-Sentry-Error, Retry-After DEBUG 2020-06-10 22:11:49.335351821 +00:00 < Vary: Accept-Language, Cookie DEBUG 2020-06-10 22:11:49.335412821 +00:00 < X-XSS-Protection: 1; mode=block DEBUG 2020-06-10 22:11:49.335473647 +00:00 < Link: <https://sentry.io/api/0/organizations/fleetwire-llc/repos/?&cursor=100:-1:1>; rel="previous"; results="false"; cursor="100:-1:1", <https://sentry.io/api/0/organizations/fleetwire-llc/repos/?&cursor=100:1:0>; rel="next"; results="false"; cursor="100:1:0" DEBUG 2020-06-10 22:11:49.335541854 +00:00 < Allow: GET, POST, HEAD, OPTIONS DEBUG 2020-06-10 22:11:49.335602903 +00:00 < Access-Control-Allow-Origin: * DEBUG 2020-06-10 22:11:49.335663199 +00:00 < Access-Control-Allow-Methods: GET, POST, HEAD, OPTIONS DEBUG 2020-06-10 22:11:49.335723900 +00:00 < X-Frame-Options: deny DEBUG 2020-06-10 22:11:49.335815014 +00:00 < X-Served-By: web-0df6213e DEBUG 2020-06-10 22:11:49.335878020 +00:00 < Strict-Transport-Security: max-age=31536000; includeSubDomains; preload DEBUG 2020-06-10 22:11:49.335960286 +00:00 response status: 200 DEBUG 2020-06-10 22:11:49.336588908 +00:00 body: [{"status":"active","integrationId":"28093","externalSlug":"chadhurin/fleetwire.io2","name":"chadhurin/fleetwire.io2","provider":{"id":"integrations:bitbucket","name":"Bitbucket"},"url":"https://bitbucket.org/chadhurin/fleetwire.io2","id":"54674","dateCreated":"2020-02-01T18:25:14.974942Z"}] INFO 2020-06-10 22:11:49.336787290 +00:00 Resolving HEAD (chadhurin/fleetwire.io2@HEAD) DEBUG 2020-06-10 22:11:49.337010092 +00:00 error: running update nagger INFO 2020-06-10 22:11:49.337168823 +00:00 Skipping update nagger update check error: could not find repository from '.'; class=Repository (6); code=NotFound (-3) DEBUG 2020-06-10 22:11:49.338177451 +00:00 client close; no transport to shut down (from sentry)