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_editor&host=mark-pc1&file=/var/log/jenkins/jenkins.log&match=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_editor&host=mark-pc1&file=/var/log/jenkins/jenkins.log&match=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_editor&host=mark-pc1&file=/var/log/jenkins/jenkins.log&match=>
>
>
> <http://mark-pc1.markwaite.net/markwaite/check_mk/wato.py?mode=pattern_editor&host=mark-pc1&file=/var/log/jenkins/jenkins.log&match=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_editor&host=mark-pc1&file=/var/log/jenkins/jenkins.log&match=>
>
>
> 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
> 2b8dd77821fc95a73b309b440e745b3e146c1e74
>
> While the "git rev-parse origin/git-client-1.10.0" command fails:
>
> $ git rev-parse origin/git-client-1.10.0
> origin/git-client-1.10.0
> fatal: ambiguous argument 'origin/git-client-1.10.0': unknown revision or 
> path not in the working tree.
> Use '--' to separate paths from revisions, like this:
> 'git <command> [<revision>...] -- [<file>...]'
>
> I still don't see all the correct behaviors from the git parameter plugin, 
> but at least that one change to your job definition will allow you to 
> continue exploring.
>
>  
>
>>
>>> 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-use...@googlegroups.com <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/625b2f19-d0c4-4729-bf3b-467854840b1d%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/625b2f19-d0c4-4729-bf3b-467854840b1d%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Thanks!
> Mark Waite
>  

-- 
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/db30bc67-72d5-4e12-b56a-46b2118a3d7c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to