Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-45480

GIT Build with Parameters is not listing branches

      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:

      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
      

      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

        1. image-2019-03-06-11-03-41-468.png
          image-2019-03-06-11-03-41-468.png
          39 kB
        2. image-2019-03-06-09-41-20-264.png
          image-2019-03-06-09-41-20-264.png
          370 kB
        3. chrome_2019-02-20_18-41-40.png
          chrome_2019-02-20_18-41-40.png
          37 kB
        4. chrome_2019-02-20_18-34-30.png
          chrome_2019-02-20_18-34-30.png
          123 kB
        5. chrome_2019-02-20_18-34-30.png
          chrome_2019-02-20_18-34-30.png
          308 kB
        6. image-2017-11-20-08-59-44-472.png
          2.33 MB
        7. config-no-flyweight.xml
          6 kB
        8. config-windows-flyweight.xml
          6 kB
        9. few_builds.png
          few_builds.png
          76 kB
        10. Job_Test_2B_out.png
          Job_Test_2B_out.png
          68 kB
        11. Job_Test_2B.png
          Job_Test_2B.png
          143 kB
        12. Job_Test_B.png
          Job_Test_B.png
          132 kB
        13. Job_test_B_output.png
          Job_test_B_output.png
          220 kB
        14. github_key_add.png
          github_key_add.png
          22 kB
        15. Credentional_configuration.png
          Credentional_configuration.png
          46 kB
        16. Windows_slave_configuration.png
          Windows_slave_configuration.png
          71 kB

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

          Senthilkumar Palanisamy created issue -
          Mark Waite made changes -
          Assignee Original: Mark Waite [ markewaite ]
          Mark Waite made changes -
          Component/s Original: git-client-plugin [ 17423 ]

          Mark Waite added a comment -

          This is most likely not a bug in the git plugin or the git client plugin, but a configuration error on either the agent or the master.

          That message usually happens when a Windows agent has defined the git location incorrectly. The preferred way to define the location of git (for Windows and for Linux) is "git" and then allow the operating system path configuration on the agent to find command line git using the operating system path.

          Do not define the path to the Windows git executable as "C:\Program Files\GIt\git-cmd.exe" or "C:\Program Files\Git\git-bash.exe", since those are two Windows specific programs which don't work with the git plugin. If you're Windows specific, use either "git" (preferred) or "git.exe" or "git.cmd".

          If this is not windows, then you may have exhausted open files or some other system level resource limit on your agent.

          Another possible cause on Linux might be that the file system is mounted with "noexec". That seems quite unlikely, but might cause that symptom.

          Mark Waite added a comment - This is most likely not a bug in the git plugin or the git client plugin, but a configuration error on either the agent or the master. That message usually happens when a Windows agent has defined the git location incorrectly. The preferred way to define the location of git (for Windows and for Linux) is "git" and then allow the operating system path configuration on the agent to find command line git using the operating system path. Do not define the path to the Windows git executable as "C:\Program Files\GIt\git-cmd.exe" or "C:\Program Files\Git\git-bash.exe", since those are two Windows specific programs which don't work with the git plugin. If you're Windows specific, use either "git" (preferred) or "git.exe" or "git.cmd". If this is not windows, then you may have exhausted open files or some other system level resource limit on your agent. Another possible cause on Linux might be that the file system is mounted with "noexec". That seems quite unlikely, but might cause that symptom.
          Mark Waite made changes -
          Resolution New: Not A Defect [ 7 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          Mark Waite made changes -
          Component/s Original: git-parameter-plugin [ 16113 ]

          Hi Mark,

          Thanks for your inputs.

          Here the scenario is when we create new job i am able to see the list of branches and tags when using GIT parameter after the build completes and if i again try to Build With Parameter i am getting above error.

          Any advice ?

          Thanks
          Senthil.

          Senthilkumar Palanisamy added a comment - Hi Mark, Thanks for your inputs. Here the scenario is when we create new job i am able to see the list of branches and tags when using GIT parameter after the build completes and if i again try to Build With Parameter i am getting above error. Any advice ? Thanks Senthil.

          Mark Waite added a comment -

          spalani I think I've been able to duplicate the problem, with some further guessing.

          The list of tags and branches in the parameterized plugin pick list includes "ssh not found" if I attempt my git parameter plugin based job on a Windows agent and run it twice. So long as I run the job on a Linux agent (any Linux agent, not just limited to the master agent), then it is well behaved. Once I've executed on a Windows agent, it reports "ssh not found" and refuses to show the list of branches/tags.

          In my case, I used a URL of the form ssh://hostname:port/path/to/repo.git, though it fails the same way when I use a URL of the form user@hostname:/path/to/repo.git.

          Note that all those failures require a Windows machine. They don't seem to happen until a Windows machine is involved. I have a multi-configuration job which uses the same technique to copy files to all my machines (Windows and Linux) and it works correctly. I assume it works correctly because the initial evaluation of the git parameters happens on a Linux machine. When I switch and force that initial evaluation of git parameters to a Windows machine, then the multi-configuration job shows the same failure.

          I believe this will need further investigation by the maintainer of the git parameter plugin. The issue may ultimately be in the git client plugin, but I would rather have the git parameter plugin maintainer (or you) perform that investigation.

          Alternatives to avoid the problem include:

          • Use a string or a list of choices rather than a git parameter to select the branch name
          • Run the job on a Linux machine
          • Make the job a multi-configuration job that starts on a linux machine, then defines the name of the windows agent to execute the job

          Mark Waite added a comment - spalani I think I've been able to duplicate the problem, with some further guessing. The list of tags and branches in the parameterized plugin pick list includes "ssh not found" if I attempt my git parameter plugin based job on a Windows agent and run it twice. So long as I run the job on a Linux agent (any Linux agent, not just limited to the master agent), then it is well behaved. Once I've executed on a Windows agent, it reports "ssh not found" and refuses to show the list of branches/tags. In my case, I used a URL of the form ssh://hostname:port/path/to/repo.git , though it fails the same way when I use a URL of the form user@hostname:/path/to/repo.git . Note that all those failures require a Windows machine. They don't seem to happen until a Windows machine is involved. I have a multi-configuration job which uses the same technique to copy files to all my machines (Windows and Linux) and it works correctly. I assume it works correctly because the initial evaluation of the git parameters happens on a Linux machine. When I switch and force that initial evaluation of git parameters to a Windows machine, then the multi-configuration job shows the same failure. I believe this will need further investigation by the maintainer of the git parameter plugin. The issue may ultimately be in the git client plugin, but I would rather have the git parameter plugin maintainer (or you) perform that investigation. Alternatives to avoid the problem include: Use a string or a list of choices rather than a git parameter to select the branch name Run the job on a Linux machine Make the job a multi-configuration job that starts on a linux machine, then defines the name of the windows agent to execute the job
          Mark Waite made changes -
          Assignee New: Mark Waite [ markewaite ]
          Resolution Original: Not A Defect [ 7 ]
          Status Original: Resolved [ 5 ] New: Reopened [ 4 ]
          Mark Waite made changes -
          Component/s New: git-parameter-plugin [ 16113 ]
          Component/s Original: git-plugin [ 15543 ]

            klimas7 Boguslaw Klimas
            spalani Senthilkumar Palanisamy
            Votes:
            3 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved: