stash-jenkins-postreceive-webhook
stash-jenkins-postreceive-webhook copied to clipboard
There were no SSH clone links generated for repository
I have stash-jenkins-postreceive-webhook version 2.7.1 installed on a Stash v3.11.2. I've configured the plugin to trigger builds for all branches for a stash repository.
Clicking on both buttons, in a pull request and the configuration check (*), do trigger a build. But just pushing to the repository does not. I can see this in the stash logs when pushing, but not when clicking the trigger buttons:
2015-08-20 09:37:11,744 ERROR [JenkinsWebhook:thread-13] <username-redacted> @1S8BCWFx577x4538x0 vxh5cp <IP-redacted> SSH - git-receive-pack '/lib/python-libs.git' com.nerdwin15.stash.webhook.Notifier Error getting Jenkins URL
java.lang.IllegalStateException: There were no SSH clone links generated for repository LIB/python-libs
at com.atlassian.stash.internal.ssh.service.DefaultSshCloneUrlResolver.getCloneUrl(DefaultSshCloneUrlResolver.java:37) ~[na:na]
at com.nerdwin15.stash.webhook.Notifier$2.perform(Notifier.java:258) ~[plugin.4376730644630445005.stash-webhook-jenkins-2.7.1_1439970478000.jar:na]
at com.nerdwin15.stash.webhook.Notifier$2.perform(Notifier.java:255) ~[plugin.4376730644630445005.stash-webhook-jenkins-2.7.1_1439970478000.jar:na]
at com.atlassian.stash.internal.user.DefaultEscalatedSecurityContext.call(DefaultEscalatedSecurityContext.java:51) ~[stash-service-impl-3.11.2.jar:na]
at com.atlassian.stash.internal.user.DefaultSecurityService.doWithPermission(DefaultSecurityService.java:77) ~[stash-service-impl-3.11.2.jar:na]
at com.nerdwin15.stash.webhook.Notifier.getUrl(Notifier.java:255) [plugin.4376730644630445005.stash-webhook-jenkins-2.7.1_1439970478000.jar:na]
at com.nerdwin15.stash.webhook.Notifier.notify(Notifier.java:196) [plugin.4376730644630445005.stash-webhook-jenkins-2.7.1_1439970478000.jar:na]
at com.nerdwin15.stash.webhook.Notifier.notify(Notifier.java:165) [plugin.4376730644630445005.stash-webhook-jenkins-2.7.1_1439970478000.jar:na]
at com.nerdwin15.stash.webhook.Notifier$1.call(Notifier.java:144) [plugin.4376730644630445005.stash-webhook-jenkins-2.7.1_1439970478000.jar:na]
at com.nerdwin15.stash.webhook.Notifier$1.call(Notifier.java:141) [plugin.4376730644630445005.stash-webhook-jenkins-2.7.1_1439970478000.jar:na]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_40]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_40]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_40]
... 43 frames trimmed
This lead me to believe that there is some bug with the plugin. After all, it is not doing the one thing it is supposed to do.
For the record, the stash repository is working via HTTP and SSH and they are both displayed in the clone section.
(*) Clicking on the configuration check button does trigger a build, but is a strange one which does not pass because of a git error involving null.
> git -c core.askpass=true fetch --tags --progress ssh://git@<Address-redacted>/lib/python-libs.git +refs/heads/*:refs/remotes/origin/*
> git rev-parse null^{commit} # timeout=10
FATAL: Command "git rev-parse null^{commit}" returned status code 128:
stdout: null^{commit}
stderr: fatal: ambiguous argument 'null^{commit}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
hudson.plugins.git.GitException: Command "git rev-parse null^{commit}" returned status code 128:
stdout: null^{commit}
stderr: fatal: ambiguous argument 'null^{commit}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
This may be because of the jenkins configuration, though!
I found a way around the problem. When the HTTP(S) URL for the repository is used everything works as expected. Just make sure your Jenkins is set to pull using the same scheme.
Interesting. There's a few others that have seen the same exception thrown, in regards to no clone URLs generated.
When you changed the repository URL, did you change it in Jenkins? And after you did that, you didn't see the exception thrown anymore?
Yes, I did change it in Jenkins too. And the exception is no more.
We are having this same issue with the same error message. I'm really not excited about going around and changing everything to HTTPS. Does anyone have any other workarounds?
We are also have the same issue, though at the moment it seems to only be affecting 1 repository. However, if this cascades to all repos, this will cause significant problems. using a custom version of 2.7.1 (pdodds fork rebased to 2.7.1) on Stash 3.11
We eventually worked around this by using the plugins config API to set a "custom" clone link for each repository. This custom link was just a regular SSH link created by concatenating the tag and slug and such onto our base-URL. The problem with this hack is that every time someone goes into the plugin GUI it defaults back to "SSH" instead of "custom". So, keeping these working is an ongoing project.
Hi folks,
This error is caused by a change in the implementation of the SSH protocol in Stash itself in 3.11.0, and will be fixed in Stash 3.11.4. More details can be found on this ticket: https://jira.atlassian.com/browse/BSERV-7827
Apologies for the trouble this has caused everyone.
Thanks, Norman Ma [Atlassian]