Re: Git Parameter Plug-in does not list tags or branches

2015-02-17 Thread Amedee Van Gasse
It seems that I have stumbled upon a known bug: the Git Parameters plugin 
does not work for private repositories because it ignores the SSH 
credentials in the Jenkins setup:
https://issues.jenkins-ci.org/browse/JENKINS-23396

I made a workaround with the Extensible Choice Parameter plugin 
https://wiki.jenkins-ci.org/display/JENKINS/Extensible+Choice+Parameter+plugin
:
http://stackoverflow.com/a/28565446/766786

It's a kludge, but it works for me.

PS: I want to subscribe to bug JENKINS-23396, but I can't register due to 
spam. Halp?

On Monday, February 16, 2015 at 1:01:36 PM UTC+1, Amedee Van Gasse wrote:

 Jenkins version: 1.593
 Git Parameter Plug-In 
 http://wiki.jenkins-ci.org/display/JENKINS/Git+Parameter+Plugin: 0.4.0
 GIT client plugin 
 http://wiki.jenkins-ci.org/display/JENKINS/Git+Client+Plugin: 1.16.1


 I have a parameterized build.
 My parameter is Git Parameter.

 Name: TAG_TO_BUILD
 Description:
 Parameter type: Branch or tag
 Branch filter: *
 Tag filter: *
 Tag sort mode: DESCENDING_SMART
 Default value: master

 Source code management:
 Branches to build: origin/${TAG_TO_BUILD}


 When I Build with parameters, I always get Retrieving Git references...:

 This build requires parameters:
  TAG_TO_BUILD
 Retrieving Git references…
 You must have built the project at least once, to get entries in the list 
 above.
 If you wipe out your workspace, the plugin needs to clone the repository 
 before it can list the tags/revisions. This may take some time if you have 
 a slow connection or the repository is big.

 I always get this, the box is never filled with branches or tags, even 
 after I built the project without specifying a parameter (it was 
 successfully built with branch master).

 Is there something else that I am missing here?

 -- 
 Amedee


-- 
You received this message because you are subscribed to the Google Groups 
Jenkins Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/f21d4708-0ea4-4302-852f-4668b9fcad92%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Git Parameter Plug-in does not list tags or branches

2015-02-16 Thread Mark Waite
On Mon, Feb 16, 2015 at 6:22 AM, Amedee Van Gasse amedee.vanga...@gmail.com
 wrote:

 I have this in the logs:
 (** is just to obfuscate the url)

 I don't understand why I get permission denied. Maybe because of
 core.askpass=true? Because authentication works without password, we use
 ssh keys.


I don't think the core.askpass=true argument has anything to do with this
problem.

When I configure a similar job using a private github repository with an
ssh key, it seems like the git parameter plugin is attempting to perform a
Unix style credentials operation on the Windows slave agent which is
hosting the build.  At least I think that is why the Jenkins log file on
the master node (Ubuntu) includes an entry which says:

Caused by: hudson.plugins.git.GitException: Command git -c
core.askpass=true fetch --tags --progress g...@github.com:
MarkEWaite/git-client-plugin.git +refs/heads/*:refs/remotes/origin/*
returned status code 1:

http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=stdout%3A%20Process%20leaked%20file%20descriptors.%20See%20http%3A//wiki.jenkins-ci.org/display/JENKINS/Spawning%2Bprocesses%2Bfrom%2Bbuild%20for%20more%20information
stdout: Process leaked file descriptors. See
http://wiki.jenkins-ci.org/display/JENKINS/Spawning+processes+from+build
 for more information

http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=Process%20leaked%20file%20descriptors.%20See%20http%3A//wiki.jenkins-ci.org/display/JENKINS/Spawning%2Bprocesses%2Bfrom%2Bbuild%20for%20more%20information
Process leaked file descriptors. See
http://wiki.jenkins-ci.org/display/JENKINS/Spawning+processes+from+build
 for more information

http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=

http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=stderr%3A%20Could%20not%20create%20directory%20%27/var/lib/jenkins/.ssh%27.
stderr: Could not create directory '/var/lib/jenkins/.ssh'.

http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=


I'm not sure if the git parameter plugin is ready for the use case of a
parameter being evaluated from a workspace on a slave agent.

Unfortunately, switching to force the build on the master node did not
resolve the issue for me either.


 Feb 16, 2015 2:17:34 PM WARNING org.eclipse.jetty.util.log.JavaUtilLog warn

 Error while serving 
 **-master/descriptorByName/net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition/fillValueItems
 java.lang.reflect.InvocationTargetException
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at java.lang.Thread.run(Thread.java:745)
 Caused by: hudson.plugins.git.GitException: Command git -c core.askpass=true 
 fetch --tags --progress ** +refs/heads/*:refs/remotes/origin/* 
 returned status code 128:
 stdout:
 stderr: Permission denied, please try again.
 Permission denied, please try again.
 Permission denied (publickey,password).
 fatal: The remote end hung up unexpectedly

   at 
 org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1591)
   at 
 org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1379)
   at 
 org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:86)
   at 
 org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:324)
   at 
 net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition.generateContents(GitParameterDefinition.java:314)
   at 
 net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition$DescriptorImpl.doFillValueItems(GitParameterDefinition.java:536)
   ... 85 more


 On Monday, February 16, 2015 at 1:01:36 PM UTC+1, Amedee Van Gasse wrote:

 Jenkins version: 1.593
 Git Parameter Plug-In
 http://wiki.jenkins-ci.org/display/JENKINS/Git+Parameter+Plugin: 0.4.0
 GIT client plugin
 http://wiki.jenkins-ci.org/display/JENKINS/Git+Client+Plugin: 1.16.1


 I have a parameterized build.
 My parameter is Git Parameter.

 Name: TAG_TO_BUILD
 Description:
 Parameter type: Branch or tag
 Branch filter: *
 Tag filter: *
 Tag sort mode: DESCENDING_SMART
 Default value: master

 Source code management:
 Branches to build: origin/${TAG_TO_BUILD}


I think you want to declare Branch to build as *${TAG_TO_BUILD}* rather
than *origin/${TAG_TO_BUILD}*.  At least that was one of the changes I
had to make while exploring what you reported.

Why is that change needed?  It seems that git tags don't associate with a
remote, so on the git-client-plugin source repository, the git rev-parse
git-client-1.10.0 command works:

$ git rev-parse git-client-1.10.0

Re: Git Parameter Plug-in does not list tags or branches

2015-02-16 Thread Amedee Van Gasse
Okay, so I have established that Jenkins fails on git fetch --tags, not on 
git rev-parse.
By the way, I changed branches to build to refs/tags/${TAG_TO_BUILD}

When I build a tag with the String type parameter, git fetch works just 
fine.
When I start a parameterized build with Git Parameters, the Git Parameter 
plugin *also* runs the git fetch command.
There's one difference that I see: during a succesful build, the git fetch 
command is preceded by this line:

using GIT_SSH to set credentials key for gitlab


I have no way of telling if GIT_SSH is also used when the Git Parameters 
plugin runs. (more logging needed I guess).



On Monday, February 16, 2015 at 4:46:50 PM UTC+1, Mark Waite wrote:




 On Mon, Feb 16, 2015 at 6:22 AM, Amedee Van Gasse amedee@gmail.com 
 javascript: wrote:

 I have this in the logs:
 (** is just to obfuscate the url)

 I don't understand why I get permission denied. Maybe because of 
 core.askpass=true? Because authentication works without password, we use 
 ssh keys.


 I don't think the core.askpass=true argument has anything to do with 
 this problem.  

 When I configure a similar job using a private github repository with an 
 ssh key, it seems like the git parameter plugin is attempting to perform a 
 Unix style credentials operation on the Windows slave agent which is 
 hosting the build.  At least I think that is why the Jenkins log file on 
 the master node (Ubuntu) includes an entry which says:


 Caused by: hudson.plugins.git.GitException: Command git -c core.askpass=true 
 fetch --tags --progress g...@github.com:MarkEWaite/git-client-plugin.git 
 +refs/heads/*:refs/remotes/origin/* returned status code 1:


 http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=stdout%3A%20Process%20leaked%20file%20descriptors.%20See%20http%3A//wiki.jenkins-ci.org/display/JENKINS/Spawning%2Bprocesses%2Bfrom%2Bbuild%20for%20more%20information
 stdout: Process leaked file descriptors. See 
 http://wiki.jenkins-ci.org/display/JENKINS/Spawning+processes+from+build
  for more information


 http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=Process%20leaked%20file%20descriptors.%20See%20http%3A//wiki.jenkins-ci.org/display/JENKINS/Spawning%2Bprocesses%2Bfrom%2Bbuild%20for%20more%20information
 Process leaked file descriptors. See 
 http://wiki.jenkins-ci.org/display/JENKINS/Spawning+processes+from+build
  for more information


 http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=


 http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=stderr%3A%20Could%20not%20create%20directory%20%27/var/lib/jenkins/.ssh%27.
 stderr: Could not create directory '/var/lib/jenkins/.ssh'.


 http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=


 I'm not sure if the git parameter plugin is ready for the use case of a 
 parameter being evaluated from a workspace on a slave agent.

 Unfortunately, switching to force the build on the master node did not 
 resolve the issue for me either.
  

 Feb 16, 2015 2:17:34 PM WARNING org.eclipse.jetty.util.log.JavaUtilLog warn

 Error while serving 
 **-master/descriptorByName/net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition/fillValueItems
 java.lang.reflect.InvocationTargetException
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at java.lang.Thread.run(Thread.java:745)
 Caused by: hudson.plugins.git.GitException: Command git -c 
 core.askpass=true fetch --tags --progress ** 
 +refs/heads/*:refs/remotes/origin/* returned status code 128:
 stdout: 
 stderr: Permission denied, please try again.
 Permission denied, please try again.
 Permission denied (publickey,password).
 fatal: The remote end hung up unexpectedly

  at 
 org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1591)
  at 
 org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1379)
  at 
 org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:86)
  at 
 org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:324)
  at 
 net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition.generateContents(GitParameterDefinition.java:314)
  at 
 net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition$DescriptorImpl.doFillValueItems(GitParameterDefinition.java:536)
  ... 85 more


 On Monday, February 16, 2015 at 1:01:36 PM UTC+1, Amedee Van Gasse wrote:

 Jenkins version: 1.593
 Git Parameter Plug-In 
 http://wiki.jenkins-ci.org/display/JENKINS/Git+Parameter+Plugin: 0.4.0
 GIT client plugin 
 

Re: Git Parameter Plug-in does not list tags or branches

2015-02-16 Thread Amedee Van Gasse
I added `env | sort` as a shell script in the pre- and post build steps.

There are several GIT_* variables set, but GIT_SSH is not one of them, so 
that value is blank.
So I'm probably looking in the wrong place.


On Monday, February 16, 2015 at 5:12:24 PM UTC+1, Amedee Van Gasse wrote:

 Okay, so I have established that Jenkins fails on git fetch --tags, not on 
 git rev-parse.
 By the way, I changed branches to build to refs/tags/${TAG_TO_BUILD}

 When I build a tag with the String type parameter, git fetch works just 
 fine.
 When I start a parameterized build with Git Parameters, the Git Parameter 
 plugin *also* runs the git fetch command.
 There's one difference that I see: during a succesful build, the git fetch 
 command is preceded by this line:

 using GIT_SSH to set credentials key for gitlab


 I have no way of telling if GIT_SSH is also used when the Git Parameters 
 plugin runs. (more logging needed I guess).



 On Monday, February 16, 2015 at 4:46:50 PM UTC+1, Mark Waite wrote:




 On Mon, Feb 16, 2015 at 6:22 AM, Amedee Van Gasse amedee@gmail.com 
 wrote:

 I have this in the logs:
 (** is just to obfuscate the url)

 I don't understand why I get permission denied. Maybe because of 
 core.askpass=true? Because authentication works without password, we 
 use ssh keys.


 I don't think the core.askpass=true argument has anything to do with 
 this problem.  

 When I configure a similar job using a private github repository with an 
 ssh key, it seems like the git parameter plugin is attempting to perform a 
 Unix style credentials operation on the Windows slave agent which is 
 hosting the build.  At least I think that is why the Jenkins log file on 
 the master node (Ubuntu) includes an entry which says:


 Caused by: hudson.plugins.git.GitException: Command git -c 
 core.askpass=true fetch --tags --progress 
 g...@github.com:MarkEWaite/git-client-plugin.git 
 +refs/heads/*:refs/remotes/origin/* returned status code 1:


 http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=stdout%3A%20Process%20leaked%20file%20descriptors.%20See%20http%3A//wiki.jenkins-ci.org/display/JENKINS/Spawning%2Bprocesses%2Bfrom%2Bbuild%20for%20more%20information
 stdout: Process leaked file descriptors. See 
 http://wiki.jenkins-ci.org/display/JENKINS/Spawning+processes+from+build
  for more information


 http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=Process%20leaked%20file%20descriptors.%20See%20http%3A//wiki.jenkins-ci.org/display/JENKINS/Spawning%2Bprocesses%2Bfrom%2Bbuild%20for%20more%20information
 Process leaked file descriptors. See 
 http://wiki.jenkins-ci.org/display/JENKINS/Spawning+processes+from+build
  for more information


 http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=


 http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=stderr%3A%20Could%20not%20create%20directory%20%27/var/lib/jenkins/.ssh%27.
 stderr: Could not create directory '/var/lib/jenkins/.ssh'.


 http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=


 I'm not sure if the git parameter plugin is ready for the use case of a 
 parameter being evaluated from a workspace on a slave agent.

 Unfortunately, switching to force the build on the master node did not 
 resolve the issue for me either.
  

 Feb 16, 2015 2:17:34 PM WARNING org.eclipse.jetty.util.log.JavaUtilLog warn

 Error while serving 
 **-master/descriptorByName/net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition/fillValueItems
 java.lang.reflect.InvocationTargetException
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at java.lang.Thread.run(Thread.java:745)
 Caused by: hudson.plugins.git.GitException: Command git -c 
 core.askpass=true fetch --tags --progress ** 
 +refs/heads/*:refs/remotes/origin/* returned status code 128:
 stdout: 
 stderr: Permission denied, please try again.
 Permission denied, please try again.
 Permission denied (publickey,password).
 fatal: The remote end hung up unexpectedly

 at 
 org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1591)
 at 
 org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1379)
 at 
 org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:86)
 at 
 org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:324)
 at 
 net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition.generateContents(GitParameterDefinition.java:314)
 at 
 

Re: Git Parameter Plug-in does not list tags or branches

2015-02-16 Thread Mark Waite
On Mon, Feb 16, 2015 at 9:43 AM, Amedee Van Gasse amedee.vanga...@gmail.com
 wrote:

 I added `env | sort` as a shell script in the pre- and post build steps.

 There are several GIT_* variables set, but GIT_SSH is not one of them, so
 that value is blank.
 So I'm probably looking in the wrong place.


GIT_SSH is used inside the plugin to pass credentials information to
command line git.  It is not available to shell scripts or other build
steps.

The absence of the message about GIT_SSH being used is probably already
enough of a hint that the git parameters plugin (or the git client plugin
on which it depends) may not be using credentials with that fetch call.

Mark Waite



 On Monday, February 16, 2015 at 5:12:24 PM UTC+1, Amedee Van Gasse wrote:

 Okay, so I have established that Jenkins fails on git fetch --tags, not
 on git rev-parse.
 By the way, I changed branches to build to refs/tags/${TAG_TO_BUILD}

 When I build a tag with the String type parameter, git fetch works just
 fine.
 When I start a parameterized build with Git Parameters, the Git Parameter
 plugin *also* runs the git fetch command.
 There's one difference that I see: during a succesful build, the git
 fetch command is preceded by this line:

 using GIT_SSH to set credentials key for gitlab


 I have no way of telling if GIT_SSH is also used when the Git Parameters
 plugin runs. (more logging needed I guess).



 On Monday, February 16, 2015 at 4:46:50 PM UTC+1, Mark Waite wrote:




 On Mon, Feb 16, 2015 at 6:22 AM, Amedee Van Gasse amedee@gmail.com
 wrote:

 I have this in the logs:
 (** is just to obfuscate the url)

 I don't understand why I get permission denied. Maybe because of
 core.askpass=true? Because authentication works without password, we
 use ssh keys.


 I don't think the core.askpass=true argument has anything to do with
 this problem.

 When I configure a similar job using a private github repository with an
 ssh key, it seems like the git parameter plugin is attempting to perform a
 Unix style credentials operation on the Windows slave agent which is
 hosting the build.  At least I think that is why the Jenkins log file on
 the master node (Ubuntu) includes an entry which says:

 Caused by: hudson.plugins.git.GitException: Command git -c
 core.askpass=true fetch --tags --progress git@github.
 com:MarkEWaite/git-client-plugin.git +refs/heads/*:refs/
 remotes/origin/* returned status code 1:


 http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=stdout%3A%20Process%20leaked%20file%20descriptors.%20See%20http%3A//wiki.jenkins-ci.org/display/JENKINS/Spawning%2Bprocesses%2Bfrom%2Bbuild%20for%20more%20information
 stdout: Process leaked file descriptors. See http://wiki.
 jenkins-ci.org/display/JENKINS/Spawning+processes+from+build for more
 information


 http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=Process%20leaked%20file%20descriptors.%20See%20http%3A//wiki.jenkins-ci.org/display/JENKINS/Spawning%2Bprocesses%2Bfrom%2Bbuild%20for%20more%20information
 Process leaked file descriptors. See http://wiki.jenkins-ci.org/display/
 JENKINS/Spawning+processes+from+build for more information


 http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=


 http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=stderr%3A%20Could%20not%20create%20directory%20%27/var/lib/jenkins/.ssh%27.
 stderr: Could not create directory '/var/lib/jenkins/.ssh'.


 http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=


 I'm not sure if the git parameter plugin is ready for the use case of a
 parameter being evaluated from a workspace on a slave agent.

 Unfortunately, switching to force the build on the master node did not
 resolve the issue for me either.


 Feb 16, 2015 2:17:34 PM WARNING org.eclipse.jetty.util.log.JavaUtilLog warn

 Error while serving 
 **-master/descriptorByName/net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition/fillValueItems
 java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.lang.Thread.run(Thread.java:745)
 Caused by: hudson.plugins.git.GitException: Command git -c 
 core.askpass=true fetch --tags --progress ** 
 +refs/heads/*:refs/remotes/origin/* returned status code 128:
 stdout:
 stderr: Permission denied, please try again.
 Permission denied, please try again.
 Permission denied (publickey,password).
 fatal: The remote end hung up unexpectedly

at 
 org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1591)
at 
 

Re: Git Parameter Plug-in does not list tags or branches

2015-02-16 Thread Amedee Van Gasse
* There is no Windows involved, it's a pure Linux (Debian) setup.
* There is no slave involved, all Jenkins jobs run on the same server.
* I changed *origin/${TAG_TO_BUILD}* to *${TAG_TO_BUILD}* - but if I 
read the error right, I don't even get that far. The plugin first try to 
fetch all the tags from the remote, and it's only after that step that it 
will try to do a rev-parse on the local repo.

If I look at the console output of a parameterized build with the default 
value (master), I get this:


 
http://ci.itextsupport.com/view/Git%20Master%20and%20Release%20builds/job/itextpdf-master/3/consoleFull#L1Started
 by user admin http://ci.itextsupport.com/user/admin

 
http://ci.itextsupport.com/view/Git%20Master%20and%20Release%20builds/job/itextpdf-master/3/consoleFull#L2Building
 in workspace /var/lib/jenkins/jobs/**/workspace

 
http://ci.itextsupport.com/view/Git%20Master%20and%20Release%20builds/job/itextpdf-master/3/consoleFull#L3
  git rev-parse --is-inside-work-tree # timeout=10

 
http://ci.itextsupport.com/view/Git%20Master%20and%20Release%20builds/job/itextpdf-master/3/consoleFull#L4Fetching
 changes from the remote Git repository

 
http://ci.itextsupport.com/view/Git%20Master%20and%20Release%20builds/job/itextpdf-master/3/consoleFull#L5
  git config remote.origin.url ssh://git@**/**/**.git 
# timeout=10

 
http://ci.itextsupport.com/view/Git%20Master%20and%20Release%20builds/job/itextpdf-master/3/consoleFull#L6Fetching
 upstream changes from ssh://**/**/**.git

 
http://ci.itextsupport.com/view/Git%20Master%20and%20Release%20builds/job/itextpdf-master/3/consoleFull#L7
  git --version # timeout=10

 
http://ci.itextsupport.com/view/Git%20Master%20and%20Release%20builds/job/itextpdf-master/3/consoleFull#L8using
 GIT_SSH to set credentials key for gitlab

 
http://ci.itextsupport.com/view/Git%20Master%20and%20Release%20builds/job/itextpdf-master/3/consoleFull#L9
  git -c core.askpass=true fetch --tags --progress 
ssh://git@**/**/**.git 
+refs/heads/*:refs/remotes/origin/*

 
http://ci.itextsupport.com/view/Git%20Master%20and%20Release%20builds/job/itextpdf-master/3/consoleFull#L10
  git rev-parse origin/master^{commit} # timeout=10

 
http://ci.itextsupport.com/view/Git%20Master%20and%20Release%20builds/job/itextpdf-master/3/consoleFull#L11Checking
 out Revision 8466cba68962a5b4fbeff263b221e3e384d094c9 (origin/master)

 
http://ci.itextsupport.com/view/Git%20Master%20and%20Release%20builds/job/itextpdf-master/3/consoleFull#L12
  git config core.sparsecheckout # timeout=10

 
http://ci.itextsupport.com/view/Git%20Master%20and%20Release%20builds/job/itextpdf-master/3/consoleFull#L13
  git checkout -f 8466cba68962a5b4fbeff263b221e3e384d094c9

 
http://ci.itextsupport.com/view/Git%20Master%20and%20Release%20builds/job/itextpdf-master/3/consoleFull#L14First
 time build. Skipping changelog.



So as you can see, there the `git rev-parse` command works just fine, and `git 
fetch --tags` before that doesn't complain either.

What I'm going to do next, is replace the Git Tag parameter with a String 
parameter, and see what happens next.


On Monday, February 16, 2015 at 4:46:50 PM UTC+1, Mark Waite wrote:




 On Mon, Feb 16, 2015 at 6:22 AM, Amedee Van Gasse amedee@gmail.com 
 javascript: wrote:

 I have this in the logs:
 (** is just to obfuscate the url)

 I don't understand why I get permission denied. Maybe because of 
 core.askpass=true? Because authentication works without password, we use 
 ssh keys.


 I don't think the core.askpass=true argument has anything to do with 
 this problem.  

 When I configure a similar job using a private github repository with an 
 ssh key, it seems like the git parameter plugin is attempting to perform a 
 Unix style credentials operation on the Windows slave agent which is 
 hosting the build.  At least I think that is why the Jenkins log file on 
 the master node (Ubuntu) includes an entry which says:


 Caused by: hudson.plugins.git.GitException: Command git -c core.askpass=true 
 fetch --tags --progress g...@github.com:MarkEWaite/git-client-plugin.git 
 +refs/heads/*:refs/remotes/origin/* returned status code 1:


 http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=stdout%3A%20Process%20leaked%20file%20descriptors.%20See%20http%3A//wiki.jenkins-ci.org/display/JENKINS/Spawning%2Bprocesses%2Bfrom%2Bbuild%20for%20more%20information
 stdout: Process leaked file descriptors. See 
 http://wiki.jenkins-ci.org/display/JENKINS/Spawning+processes+from+build
  for more information


 http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=Process%20leaked%20file%20descriptors.%20See%20http%3A//wiki.jenkins-ci.org/display/JENKINS/Spawning%2Bprocesses%2Bfrom%2Bbuild%20for%20more%20information
 Process leaked file descriptors. See 
 

Re: Git Parameter Plug-in does not list tags or branches

2015-02-16 Thread Mark Waite


On Monday, February 16, 2015 at 9:12:24 AM UTC-7, Amedee Van Gasse wrote:

 Okay, so I have established that Jenkins fails on git fetch --tags, not on 
 git rev-parse.
 By the way, I changed branches to build to refs/tags/${TAG_TO_BUILD}

 When I build a tag with the String type parameter, git fetch works just 
 fine.
 When I start a parameterized build with Git Parameters, the Git Parameter 
 plugin *also* runs the git fetch command.
 There's one difference that I see: during a succesful build, the git fetch 
 command is preceded by this line:

 using GIT_SSH to set credentials key for gitlab


 I have no way of telling if GIT_SSH is also used when the Git Parameters 
 plugin runs. (more logging needed I guess).


That may indicate that the git parameters plugin is not able to use 
credentials for tag parameter use case.  You may want to explore further 
around other areas related to authentication support in the git parameter 
plugin, since there may be other areas where it does not support 
credentials.

Mark Waite
 



 On Monday, February 16, 2015 at 4:46:50 PM UTC+1, Mark Waite wrote:




 On Mon, Feb 16, 2015 at 6:22 AM, Amedee Van Gasse amedee@gmail.com 
 wrote:

 I have this in the logs:
 (** is just to obfuscate the url)

 I don't understand why I get permission denied. Maybe because of 
 core.askpass=true? Because authentication works without password, we 
 use ssh keys.


 I don't think the core.askpass=true argument has anything to do with 
 this problem.  

 When I configure a similar job using a private github repository with an 
 ssh key, it seems like the git parameter plugin is attempting to perform a 
 Unix style credentials operation on the Windows slave agent which is 
 hosting the build.  At least I think that is why the Jenkins log file on 
 the master node (Ubuntu) includes an entry which says:


 Caused by: hudson.plugins.git.GitException: Command git -c 
 core.askpass=true fetch --tags --progress 
 g...@github.com:MarkEWaite/git-client-plugin.git 
 +refs/heads/*:refs/remotes/origin/* returned status code 1:


 http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=stdout%3A%20Process%20leaked%20file%20descriptors.%20See%20http%3A//wiki.jenkins-ci.org/display/JENKINS/Spawning%2Bprocesses%2Bfrom%2Bbuild%20for%20more%20information
 stdout: Process leaked file descriptors. See 
 http://wiki.jenkins-ci.org/display/JENKINS/Spawning+processes+from+build
  for more information


 http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=Process%20leaked%20file%20descriptors.%20See%20http%3A//wiki.jenkins-ci.org/display/JENKINS/Spawning%2Bprocesses%2Bfrom%2Bbuild%20for%20more%20information
 Process leaked file descriptors. See 
 http://wiki.jenkins-ci.org/display/JENKINS/Spawning+processes+from+build
  for more information


 http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=


 http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=stderr%3A%20Could%20not%20create%20directory%20%27/var/lib/jenkins/.ssh%27.
 stderr: Could not create directory '/var/lib/jenkins/.ssh'.


 http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editorhost=mark-pc1file=/var/log/jenkins/jenkins.logmatch=


 I'm not sure if the git parameter plugin is ready for the use case of a 
 parameter being evaluated from a workspace on a slave agent.

 Unfortunately, switching to force the build on the master node did not 
 resolve the issue for me either.
  

 Feb 16, 2015 2:17:34 PM WARNING org.eclipse.jetty.util.log.JavaUtilLog warn

 Error while serving 
 **-master/descriptorByName/net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition/fillValueItems
 java.lang.reflect.InvocationTargetException
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at java.lang.Thread.run(Thread.java:745)
 Caused by: hudson.plugins.git.GitException: Command git -c 
 core.askpass=true fetch --tags --progress ** 
 +refs/heads/*:refs/remotes/origin/* returned status code 128:
 stdout: 
 stderr: Permission denied, please try again.
 Permission denied, please try again.
 Permission denied (publickey,password).
 fatal: The remote end hung up unexpectedly

 at 
 org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1591)
 at 
 org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1379)
 at 
 org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:86)
 at 
 org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:324)
 at 
 net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition.generateContents(GitParameterDefinition.java:314)
 at 
 

Re: Git Parameter Plug-in does not list tags or branches

2015-02-16 Thread Amedee Van Gasse
I have this in the logs:
(** is just to obfuscate the url)

I don't understand why I get permission denied. Maybe because of 
core.askpass=true? Because authentication works without password, we use 
ssh keys.


Feb 16, 2015 2:17:34 PM WARNING org.eclipse.jetty.util.log.JavaUtilLog warn

Error while serving 
**-master/descriptorByName/net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition/fillValueItems
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at 
org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:298)
at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:161)
at 
org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:96)
at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:121)
at 
org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:249)
at 
org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:249)
at 
org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:249)
at 
org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at 
org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)
at 
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1494)
at 
hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:96)
at 
com.smartcodeltd.jenkinsci.plugin.assetbundler.filters.LessCSS.doFilter(LessCSS.java:46)
at 
hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:99)
at 
org.jenkinsci.plugins.modernstatus.ModernStatusFilter.doFilter(ModernStatusFilter.java:52)
at 
hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:99)
at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:88)
at 
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:85)
at 
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
at 
hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
at 
hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
at 
hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at 
jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
at 
hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at 
org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
at 
hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at 
org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
at 
hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at 
org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
at 
hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at 
jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93)
at 
hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at 
org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
at 
hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
at 

Re: Git Parameter Plug-in does not list tags or branches

2015-02-16 Thread Amedee Van Gasse
I deleted the project and created it again from scratch.
I built it once, so it would build the master branch.

On the second build, I get noWorkspaceError. But there most definitely *is* 
a workspace!


This build requires parameters:
 TAG_TO_BUILD

noWorkspaceError
Retrieving Git references…
You must have built the project at least once, to get entries in the list 
above.
If you wipe out your workspace, the plugin needs to clone the repository 
before it can list the tags/revisions. This may take some time if you have 
a slow connection or the repository is big.



On Monday, February 16, 2015 at 1:01:36 PM UTC+1, Amedee Van Gasse wrote:

 Jenkins version: 1.593
 Git Parameter Plug-In 
 http://wiki.jenkins-ci.org/display/JENKINS/Git+Parameter+Plugin: 0.4.0
 GIT client plugin 
 http://wiki.jenkins-ci.org/display/JENKINS/Git+Client+Plugin: 1.16.1


 I have a parameterized build.
 My parameter is Git Parameter.

 Name: TAG_TO_BUILD
 Description:
 Parameter type: Branch or tag
 Branch filter: *
 Tag filter: *
 Tag sort mode: DESCENDING_SMART
 Default value: master

 Source code management:
 Branches to build: origin/${TAG_TO_BUILD}


 When I Build with parameters, I always get Retrieving Git references...:

 This build requires parameters:
  TAG_TO_BUILD
 Retrieving Git references…
 You must have built the project at least once, to get entries in the list 
 above.
 If you wipe out your workspace, the plugin needs to clone the repository 
 before it can list the tags/revisions. This may take some time if you have 
 a slow connection or the repository is big.

 I always get this, the box is never filled with branches or tags, even 
 after I built the project without specifying a parameter (it was 
 successfully built with branch master).

 Is there something else that I am missing here?

 -- 
 Amedee


-- 
You received this message because you are subscribed to the Google Groups 
Jenkins Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/79df3659-e56a-4817-9ccb-34072cad1500%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.