[JIRA] (JENKINS-45480) GIT Build with Parameters is not listing branches

2 views
Skip to first unread message

joel.wilson@castingnetworks.com (JIRA)

unread,
Feb 23, 2018, 12:24:03 PM2/23/18
to jenkinsc...@googlegroups.com
Joel Wilson commented on Bug JENKINS-45480
 
Re: GIT Build with Parameters is not listing branches

I'm having the same issue but noticed there is no activity since last November. Did everyone figure out a workaround for this?

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

brodlic.edin@nsoft.com (JIRA)

unread,
Mar 15, 2018, 8:29:03 PM3/15/18
to jenkinsc...@googlegroups.com

Can also confirm, having an identical issue. Seems to revolve around Git parameter plugin.

Weirdly enough I've tracked the git ls-remote process as well as temporary sh file that triggers the ssh, and it's all executed on the Jenkins main, not sure why it happens only when the actual build is supposed to take place on a Windows agent (we have two, with different configurations and both suddenly started having the issue).

Also not sure why there is an ssh command executing `git-upload-pack` right after the ls-remote action only when it's being executed via parameter plugin.

Git Plugin -->3.3.0
Git Parameter Plugin-->0.8.0

marcel.dutt@kaufland.com (JIRA)

unread,
Mar 16, 2018, 5:09:02 AM3/16/18
to jenkinsc...@googlegroups.com

Boguslaw Klimas

We have a Bitbucket Server as git server instead of using github. But in order to reproduce the issue I requested to grant our build machines access to github.com so I can try to reproduce the issue with your configuration. Hopefully this will help us find the culprit.

klimas7@gmail.com (JIRA)

unread,
Mar 17, 2018, 9:17:03 AM3/17/18
to jenkinsc...@googlegroups.com

Most likely, change made in the JENKINS-40232, caused that the plugin does not behave deterministically. 

Befor version 0.8.0 plugin use repository which featch in job workspace (when the repository not existsed in workspace, plugin did clone to workspace).

After version 0.8.0 plugin uses git ls-remote to download branch or tag.

Currently  I have a little more time and I will try investigate deeper this issue. 

klimas7@gmail.com (JIRA)

unread,
Mar 17, 2018, 9:22:32 AM3/17/18
to jenkinsc...@googlegroups.com
Boguslaw Klimas edited a comment on Bug JENKINS-45480
Most likely, change made in the - JENKINS-40232 - , caused that the plugin does not behave deterministically. 


Befor version 0.8.0 plugin use repository which featch in job workspace (when the repository not existsed in workspace, plugin did clone to workspace).
  After version 0.8.0 plugin uses git ls-remote to download branch or tag.

Currently  I have a little more time and I will try investigate deeper this issue. 

klimas7@gmail.com (JIRA)

unread,
Mar 21, 2018, 3:33:03 PM3/21/18
to jenkinsc...@googlegroups.com

Hi all,

To get a list of branches or tags, the plugin creates a GitClient object and sets the workspace as null,
in this case, the GitUtils.workspaceToNode method returns the Jenkins active instance (master).
Due to this, all operations that the plugin performs while downloading branch / tags
are performed on the main jenkins node. Finally, to got list branch / tag the plugin used method GitClient.getRemoteReferences nothing else.
With the above in mind, I am inclined to the fact that it is a configuration problem.
I understand that each of these jobs works correctly on the master node?

 

marcel.dutt@kaufland.com (JIRA)

unread,
Mar 22, 2018, 3:41:02 AM3/22/18
to jenkinsc...@googlegroups.com

Building of our project on the master is not possible due to the fact that it is a .NET 3.5 application which is only functional on a windows slave. However there is a rather ugly workaround that makes use of the multi configuration job type. It is configured to check out the branch on the master first and then hands the build action down to the windows slave. In this scenario it is working.

If a configuration error causes this it would be good to know what the error is supposed to be so we can check and verify it.

klimas7@gmail.com (JIRA)

unread,
Mar 22, 2018, 3:23:03 PM3/22/18
to jenkinsc...@googlegroups.com

Maybe I didn't express myself precisely, I meant it:

I understand that each of these jobs (SCM) works fetch/clone correctly on the master node? (the plugin does not need to build a project)

marcel.dutt@kaufland.com (JIRA)

unread,
Mar 23, 2018, 3:40:02 AM3/23/18
to jenkinsc...@googlegroups.com

To point this part of my previous answer out: yes they do fetch/clone correctly on the master.

klimas7@gmail.com (JIRA)

unread,
Apr 16, 2018, 3:12:02 PM4/16/18
to jenkinsc...@googlegroups.com

klimas7@gmail.com (JIRA)

unread,
Feb 18, 2019, 5:01:04 PM2/18/19
to jenkinsc...@googlegroups.com
Boguslaw Klimas commented on Bug JENKINS-45480
 
Re: GIT Build with Parameters is not listing branches

Hi,

I can't reproduce this issue, but I found code smells, which can provide to unexpected behavior. commit: f85678c3 I changed  it in release 0.9.10.

Additional I changed error handling, please look on wiki page

If this issue steal occurred in your environment after update the plugin. Please add more information which I can use to reproduce this issue and reopen this issue. 

This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

klimas7@gmail.com (JIRA)

unread,
Feb 18, 2019, 5:01:04 PM2/18/19
to jenkinsc...@googlegroups.com
Boguslaw Klimas resolved as Cannot Reproduce
 

Release 0.9.10

Change By: Boguslaw Klimas
Status: In Progress Resolved
Resolution: Cannot Reproduce

delovan@gmail.com (JIRA)

unread,
Feb 20, 2019, 12:39:02 PM2/20/19
to jenkinsc...@googlegroups.com
delo delo updated an issue
Change By: delo delo
Attachment: chrome_2019-02-20_18-34-30.png

delovan@gmail.com (JIRA)

unread,
Feb 20, 2019, 12:44:02 PM2/20/19
to jenkinsc...@googlegroups.com

delovan@gmail.com (JIRA)

unread,
Feb 20, 2019, 12:45:02 PM2/20/19
to jenkinsc...@googlegroups.com
delo delo updated an issue
Change By: delo delo
Attachment: chrome_2019-02-20_18-41-40.png

delovan@gmail.com (JIRA)

unread,
Feb 20, 2019, 12:45:03 PM2/20/19
to jenkinsc...@googlegroups.com
delo delo commented on Bug JENKINS-45480
 
Re: GIT Build with Parameters is not listing branches

I still have the bug.

 

However, the error message id not displayed the same way.

 

Remember that the first time you create a build in a job, this does work. It's only from the second build that the issue occurs.

 

Prior 0.9.10:

 

 

After 0.9.10:

 

delovan@gmail.com (JIRA)

unread,
Feb 20, 2019, 12:53:03 PM2/20/19
to jenkinsc...@googlegroups.com

Please also note that the bug is present only when using SSH Git. When I use HTTPS connection, it works flawlessly.

mark.earl.waite@gmail.com (JIRA)

unread,
Feb 20, 2019, 1:54:03 PM2/20/19
to jenkinsc...@googlegroups.com

delo delo the git plugin uses command line git to clone the repository. Command line git requires a script file that provides the private key for authentication to ssh repositories. That script file invokes the command ssh to provide authenticated transport between command line git and your git repository. That script can't find the ssh command on the path.

That could be because the /tmp directory on the master is mounted with the noexec option. Refer to stackexchange for instructions to check the file system mount options.

That could be because the PATH environment variable has been damaged or altered so that ssh is not on the PATH when running from the Jenkins master. The Jenkins "System Information" page will show you the value of the PATH environment variable on that Jenkins server.

That could be because the ssh command has been removed from the master. Seems unlikely, but possible. Check for /usr/bin/ssh or /bin/ssh to confirm that you have an ssh command installed in the environment where Jenkins is running.

The git plugin uses command line git to clone https repositories as well, but cloning an https repository uses a username / password instead of a private key. Cloning an https repository does not use ssh, while cloning an ssh based repository does use the ssh command.

delovan@gmail.com (JIRA)

unread,
Feb 21, 2019, 6:10:02 AM2/21/19
to jenkinsc...@googlegroups.com

Hello Mark Waite and thank you for your response. 

I also forget to mention that I run Jenkins under it's docker version.

Therefore, the /tmp directory with noexec is not affected by that

I did check the PATH variable, it's configured with _/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin_ so ssh is in it.

When I docker exec into the docker container, I can launch ssh commands without issues.

 

Is there a way to preserve the temporary bash scripts in _/_tmp that are used to launch the git commands? That way, it would be far easier to troubleshoot the issue.

mark.earl.waite@gmail.com (JIRA)

unread,
Feb 21, 2019, 2:31:03 PM2/21/19
to jenkinsc...@googlegroups.com

There isn't a way to preserve the temporary bash scripts. That's intentional, since they contain credentials. We want the credential information to be removed from the disc as soon as possible.

You could build a local copy of the git client plugin and remove the code in the finally block that deletes those temporary files.

robsonhermes@gmail.com (JIRA)

unread,
Mar 6, 2019, 3:42:02 AM3/6/19
to jenkinsc...@googlegroups.com
Robson Hermes updated an issue
 
Change By: Robson Hermes
Attachment: image-2019-03-06-09-41-20-264.png

robsonhermes@gmail.com (JIRA)

unread,
Mar 6, 2019, 3:44:01 AM3/6/19
to jenkinsc...@googlegroups.com
Robson Hermes commented on Bug JENKINS-45480
 
Re: GIT Build with Parameters is not listing branches

I had the same problem, and changing from SSH to HTTP did not work. I got the error below when trying HTTP:

 

I managed to "fix" the problem by creating a new project cloning the existing one. The new one worked fine. I did not change any config at all. Thus I suppose this is really some sort of problem in the Git plugin. Not a user config problem.

delovan@gmail.com (JIRA)

unread,
Mar 6, 2019, 4:58:02 AM3/6/19
to jenkinsc...@googlegroups.com

Robson Hermes Are you sure it's durable ?

 

With SSH, cloning the project was a workaround but only works for the very first build. Starting the 2nd build, it failed.

robsonhermes@gmail.com (JIRA)

unread,
Mar 6, 2019, 5:04:04 AM3/6/19
to jenkinsc...@googlegroups.com
Robson Hermes updated an issue
Change By: Robson Hermes
Attachment: image-2019-03-06-11-03-41-468.png

robsonhermes@gmail.com (JIRA)

unread,
Mar 6, 2019, 5:04:05 AM3/6/19
to jenkinsc...@googlegroups.com
Robson Hermes commented on Bug JENKINS-45480
 
Re: GIT Build with Parameters is not listing branches

Oh damn it. You are right, now I have failure starting from the 2nd attempt.

delovan@gmail.com (JIRA)

unread,
Mar 6, 2019, 10:04:02 AM3/6/19
to jenkinsc...@googlegroups.com

Robson Hermes, I suggest you do as Mark Waite suggested for keeping tmp files. I've done it and surprisingly I can't reproduce the bug anymore, even though I switch back to the original plugin.

For info, after you build the plugin, just copy the plugin files over the original plugin (keep a backup) and restart jenkins.

With theses files, you will be able to run them directly in bash and have more debug info.

hason.amos@gmail.com (JIRA)

unread,
Apr 30, 2019, 11:02:06 AM4/30/19
to jenkinsc...@googlegroups.com

hason.amos@gmail.com (JIRA)

unread,
Apr 30, 2019, 12:17:02 PM4/30/19
to jenkinsc...@googlegroups.com

In our case "/tmp" is not mounted with "noexec".

I don't understand why it even tries to execute it on the master machine instead of the slave machine. It clearly should run on the slave machine.

vazhnov@yandex.ru (JIRA)

unread,
Aug 19, 2019, 3:45:03 PM8/19/19
to jenkinsc...@googlegroups.com
Alexey Vazhnov updated an issue
 
Change By: Alexey Vazhnov
Hi,
We  have a job and it is configured as "Build with Parameters"
.
We have chosen "GIT Parameter" when we try to list "Branches/tags" while click build option it is not listing instead showing error message.

But when we try build job able to clone with SSH keys . :

{
code:java noformat }
Command "git ls-remote -h ssh://server.de.xyz.com:7999/xdk/xdk110.git" returned status code 128:
stdout:
stderr: error: cannot run ssh: No such file or directory
fatal: unable to fork

{ code noformat }

We were using
:
*
Jenkins LTS version "2.46.2"
* Git plugin -->3.3.1
* Git client plugin --->2.4.6
* Git Parameter Plug-In--->0.8.0

Thanks
Senthil
Reply all
Reply to author
Forward
0 new messages