Trying to setup releases as described in docs docs: https://docs.sentry.io/learn/releases/
Following the steps:
# Assumes you're in a git repository
export SENTRY_AUTH_TOKEN=...
export SENTRY_ORG=my-org
VERSION=$(sentry-cli releases propose-version)
# Create a release
sentry-cli releases new -p project1 -p project2 $VERSION
# Associate commits with the release
sentry-cli releases set-commits --auto $VERSION
All works well except for the last command sentry-cli releases set-commits --auto $VERSION which returns:
error: For non git repositories explicit revisions are required
sentry-cli --version
sentry-cli 1.35.4
This issue seems to be similar to https://github.com/getsentry/sentry-cli/issues/115 and https://github.com/getsentry/sentry-cli/issues/300, but unlike both of those issues, my repo is a Github repo:
sentry-cli repos list
+----------------------------------+----------+-----------------------------------------------------+
| Name | Provider | URL |
+----------------------------------+----------+-----------------------------------------------------+
| getslideapp/slide-django-adaptor | GitHub | https://github.com/getslideapp/slide-django-adaptor |
+----------------------------------+----------+-----------------------------------------------------+
One additional piece of information is that since I have multiple Github accounts on my machine, I use a configuration as described in this gist: https://gist.github.com/jexchan/2351996. As such, my github hostname is github.com-tjg37 instead of github.com. I'm not sure if this is the source of the issue, but if it is, would it be possible to allow for hostnames of this form?
git config --get remote.origin.url
[email protected]:getslideapp/slide-django-adaptor.git
Also, as suggested in https://github.com/getsentry/sentry-cli/issues/115 and https://github.com/getsentry/sentry-cli/issues/300, if I manually add the previous commits sentry-cli releases set-commits $VERSION --commit "$REPO@$VERSION" it works.
same problem, i'm using Bitbucket Pipelines and V2 connector
- step:
name: Sentry Release
image: getsentry/sentry-cli
script:
- sentry-cli releases -o abc -p xyz new "$BITBUCKET_COMMIT"
- sentry-cli releases -o abc -p xyz set-commits --auto "$BITBUCKET_COMMIT"
| Name | Provider | URL |
+-------------------------------+--------------+-----------------------------------------------------+
| abc/xyz | Bitbucket v2 | https://bitbucket.org/abc/xyz |
+-------------------------------+--------------+-----------------------------------------------------+
I'm also getting the same problem. Seems to have started yesterday for us since GitHub had some issues. Still not working this morning and GH is working fine.
We're running the commands:
sentry-cli releases new -p $SENTRY_PROJECT $VERSION
sentry-cli releases set-commits --auto $VERSION
Strarted to happen today to me as well. I've tried to upgrade sentry-cli to latest 1.35.5, but that made no difference.
Without knowing rust, I think the problem is here:
As sentry since https://github.com/getsentry/sentry/commit/efcac0a82c364ffe1df09453efaada9910eab0c8#diff-0a897e12089601a38ba4d1841135961d uses integrations: prefix in the provider id while listing the repositories:
[
{
"dateCreated": "2018-08-26T07:26:22.579Z",
"id": "13618",
"integrationId": "5604",
"name": "WeblateOrg/weblate",
"provider": {
"id": "integrations:github",
"name": "GitHub"
},
"status": "active",
"url": "https://github.com/WeblateOrg/weblate"
}
]
A fix has been released in version 1.35.6. Thank you all for your patience and sharing this information!
@jan-auer Thanks for pushing such a quick fix!
However, the issue is not yet resolved for me. I am now getting a different error when running the command sentry-cli releases set-commits --auto $VERSION:
error: Could not determine any commits to be associated automatically. You will have to explicitly provide commits on the command line.
Is this the expected behaviour in my case?
sentry-cli --version
sentry-cli 1.35.6
Bitbucket Pipelines and image getsentry/sentry-cli give me an OK
The Command
- step:
name: Sentry Release
image: getsentry/sentry-cli
script:
- sentry-cli -V
- sentry-cli releases -o "$SENTRY_ORG" -p "$SENTRY_PROJECT" new "$BITBUCKET_COMMIT"
- sentry-cli releases -o "$SENTRY_ORG" -p "$SENTRY_PROJECT" set-commits "$BITBUCKET_COMMIT" --auto
Result
+ umask 000
+ GIT_LFS_SKIP_SMUDGE=1 git clone --branch="master" --depth 50 https://x-token-auth:[email protected]/hidden-org/hidden-proj.git $BUILD_DIR ; git reset --hard 6c5c5d67a400cee8f73eafa1f17dd3bc77bf23a0 ; git remote set-url origin [email protected]:hidden-org/hidden-proj.git
Cloning into '/opt/atlassian/pipelines/agent/build'...
HEAD is now at 6c5c5d6 move snyk to testing parallel
+ chmod 777 $BUILD_DIR
+ sentry-cli -V
sentry-cli 1.35.6
+ sentry-cli releases -o "$SENTRY_ORG" -p "$SENTRY_PROJECT" new "$BITBUCKET_COMMIT"
Created release 6c5c5d67a400cee8f73eafa1f17dd3bc77bf23a0.
+ sentry-cli releases -o "$SENTRY_ORG" -p "$SENTRY_PROJECT" set-commits "$BITBUCKET_COMMIT" --auto
+-------------------------------+--------------+
| Repository | Revision |
+-------------------------------+--------------+
| hidden-org/hidden-proj | 6c5c5d67a400 |
+-------------------------------+--------------+
Searching for test report files in directories named [test-results, failsafe-reports, test-reports, surefire-reports] down to a depth of 4
Finished scanning for test reports. Found 0 test report files.
Merged test suites, total number tests is 0, with 0 failures and 0 errors.
If the auto discovery does not work it's likely that you are running it from a non git checkout. That issue however would be unrelated to this one here. I will close this issue as resolved. If you have that issue still please open another issue for it.
I'm still getting the error : error: For non git repositories explicit revisions are required
I've updated to the latest version of the Sentry CLI:
[user@ip-X-X-X-X ~]$ sentry-cli --version
sentry-cli 1.35.6
My repositories are present also:
| Name | Provider | URL |
+---------------------------------------------------+----------+----------------------------------------------------------------------+
| EvaluAgent/REPONAME | GitHub | https://github.com/EvaluAgent/REPONAME |
+---------------------------------------------------+----------+----------------------------------------------------------------------+
We just started seeing this issue pop up again on CLI v1.36.2
Edit: also happening for latest CLI v1.36.4
Some further notes: debugging the tool suggests that it's bailing out because it found a repository that was misconfigured which is preventing it from being able to continue iterating over the other (correctly configured) git repos.
@nickpresta is working on a patch for Sentry-Cli
I thought I could land a quick patch for this but I don't know enough about Rust to make a change with confidence.
I suspect there is a "hacky" fix in this block where the found_non_git is reset to false on every loop iteration to prevent using that value set by a previous iteration. However, I suspect something else is happening where the check against the url may be throwing unexpectedly due to the null value, because we see the following logging:
INFO 2018-11-01 11:16:24.270095 -04:00 Resolving HEAD (waveaccounting/cb-account-connection-form@HEAD)
DEBUG 2018-11-01 11:16:24.270280 -04:00 unknown repository unknown:17184 skipped
INFO 2018-11-01 11:16:24.270497 -04:00 Skipping update nagger update check
error: For non git repositories explicit revisions are required
DEBUG 2018-11-01 11:16:24.271604 -04:00 client close; no transport to shut down (from sentry)
for the given payload (from the organizations API list):
{
"dateCreated": "2018-11-01T14:47:09.328Z",
"id": "17184",
"integrationId": null,
"name": "waveaccounting/cb-account-connection-form",
"provider": {
"id": "unknown",
"name": "Unknown Provider"
},
"status": "active",
"url": null
}
The project we're trying to create a release for, publicsite is listed after the cb-account-connection-form so it bails out early and never gets to the publicsite project.
Any luck @ryanwilsonperkin? It works for me on localhost, but fails in Bitbucket Pipeline.
@Elijen we took a crack at this in a patch but couldn't get it working quite right, we "solved" it for ourselves by updating the repositories in our account. That unfortunately means we don't have an easy way to test our patch anymore and can't follow up.
@ryanwilsonperkin Thanks for the info. Do you at least know what was causing it and what could be a workaround? How could I update the repositories to make it work for us to for example?
@Elijen yeah in our case it was happening because one of the GitHub repositories we'd previously linked had been renamed and wasn't being fetched properly. This had the effect of breaking a loop over available repositories (returned by an API call) and making it seem as though the repository wasn't available. I'd suggest running sentry-cli in debug/verbose mode to see the additional logging output. It could be that you just need to delete your linked repositories and re-add them.
@ryanwilsonperkin That's strange. We didn't rename repos for sure. I've checked the debug output of sentry-cli and it returns the repo in question correctly and with "provider": { "id": "integrations:bitbucket", "name": "Bitbucket" }, git status confirms we are in a git checkout.
@mitsuhiko Would it make sense to reopen this issue?
@Elijen can you paste the contents of your .git/config? Also more importantly can you run in debug mode and paste the output.
@mitsuhiko Sure, here is the .git/config:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = [email protected]:sidelinesports/xps-client.git
fetch = +refs/heads/feature/more-sentry-debugging:refs/remotes/origin/feature/more-sentry-debugging
[branch "feature/more-sentry-debugging"]
remote = origin
merge = refs/heads/feature/more-sentry-debugging
And here the DEBUG output:
[15:24:32] Running postPublish hook: ./scripts/sentry-set-commits
[15:24:32] Hook: /opt/atlassian/pipelines/agent/build/node_modules/@sentry/cli/sentry-cli --log-level DEBUG releases set-commits --auto 2.2.0-r.OMZWKXXjyq
[15:24:32] Error setting commits for Sentry: [INFO] sentry_cli::api request GET https://sentry.io/api/0/organizations/sidelinesports/repos/
[INFO] sentry_cli::api using token authentication
[INFO] sentry_cli::api > GET /api/0/organizations/sidelinesports/repos/ HTTP/1.1
[INFO] sentry_cli::api > Host: sentry.io
[INFO] sentry_cli::api > Accept: */*
[INFO] sentry_cli::api > Connection: TE
[INFO] sentry_cli::api > TE: gzip
[INFO] sentry_cli::api > User-Agent: sentry-cli/1.32.3
[INFO] sentry_cli::api > Authorization: REDACTED
[INFO] sentry_cli::api < HTTP/1.1 200 OK
[INFO] sentry_cli::api < Server: nginx
[INFO] sentry_cli::api < Date: Sun, 25 Nov 2018 15:24:32 GMT
[INFO] sentry_cli::api < Content-Type: application/json
[INFO] sentry_cli::api < Content-Length: 948
[INFO] sentry_cli::api < Connection: keep-alive
[INFO] sentry_cli::api < X-XSS-Protection: 1; mode=block
[INFO] sentry_cli::api < X-Content-Type-Options: nosniff
[INFO] sentry_cli::api < Content-Language: en
[INFO] sentry_cli::api < Vary: Accept-Language, Cookie
[INFO] sentry_cli::api < Link: <https://sentry.io/api/0/organizations/sidelinesports/repos/?&cursor=100:-1:1>; rel="previous"; results="false"; cursor="100:-1:1", <https://sentry.io/api/0/organizations/sidelinesports/repos/?&cursor=100:1:0>; rel="next"; results="false"; cursor="100:1:0"
[INFO] sentry_cli::api < Allow: GET, POST, HEAD, OPTIONS
[INFO] sentry_cli::api < X-Frame-Options: deny
[INFO] sentry_cli::api < X-Served-By: web-c401c6a4
[INFO] sentry_cli::api < Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
[INFO] sentry_cli::api response: 200
[INFO] sentry_cli::api body: [{"status": "active", "integrationId": "9420", "externalSlug": "sidelinesports/xps-client", "name": "sidelinesports/xps-client", "provider": {"id": "integrations:bitbucket", "name": "Bitbucket"}, "url": "https://bitbucket.org/sidelinesports/xps-client", "id": "17176", "dateCreated": "2018-11-01T11:36:55.810Z"}, {"status": "active", "integrationId": "9420", "externalSlug": "sidelinesports/xps-questionnaire", "name": "sidelinesports/xps-questionnaire", "provider": {"id": "integrations:bitbucket", "name": "Bitbucket"}, "url": "https://bitbucket.org/sidelinesports/xps-questionnaire", "id": "17177", "dateCreated": "2018-11-01T11:37:10.693Z"}, {"status": "active", "integrationId": "9420", "externalSlug": "sidelinesports/xps-web", "name": "sidelinesports/xps-web", "provider": {"id": "integrations:bitbucket", "name": "Bitbucket"}, "url": "https://bitbucket.org/sidelinesports/xps-web", "id": "17178", "dateCreated": "2018-11-01T11:37:32.357Z"}]
error: For non git repositories explicit revisions are required
@Elijen can you re-run this on the latest version of sentry-cli? This does not have the correct debug outputs.
@mitsuhiko That's weird. We are using [email protected] which is using [email protected] and [email protected]. Not sure what's happening here.
I'm assuming you have another sentry-cli on your path that is being picked up or something similar. Not sure which version you have but that log format is very old. New sentry-cli looks very different.
@mitsuhiko Turned out we had misconfigured node cache in the Bitbucket Pipeline so old dependencies were overwriting the new ones. The latest version of sentry-cli works as expected. Thanks for your help!
Closing this as resolved then.
I've just randomly started getting this error using "@sentry/webpack-plugin": "^1.11.1"
Error: Command failed: /home/circleci/repo-name/node_modules/@sentry/cli/sentry-cli releases set-commits 1.26.1 --auto
error: For non git repositories explicit revisions are required
Most helpful comment
I'm also getting the same problem. Seems to have started yesterday for us since GitHub had some issues. Still not working this morning and GH is working fine.
We're running the commands: