Non-lightweight git checkout of Jenkinsfile fails if node parameter is provided

280 views
Skip to first unread message

Martin Schmude

unread,
Feb 24, 2021, 11:25:10 AM2/24/21
to Jenkins Users
Hello all,
I am experiencing the following issue.
I have a pipeline job (not multibranch). In the job configuration the Jenkinsfile is checked out from git. The checkout is not lightweight (there is a tick "Lightweight checkout", which is not set).
A node job parameter is configured.
When starting the job the git checkout of the Jenkinsfile fails with

Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress -- https://gitlab.XXX.com/project.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
...
fatal: could not read Username for 'https://gitlab.XXX.com': terminal prompts disabled

Note that the Jenkinsfile has not started to be executed at that moment, since Jenkins failed to check it out.
The error does not occur if
  • if the selected node is master, or
  • if the "Lightweight checkout" is selected.
It does also not occur if no node parameter is configured at all.

Is this expected behaviour or an bug? Should I file a ticket in https://issues.jenkins.io? I haven't found a ticket there that exactly matches my issue.
This https://groups.google.com/g/jenkinsci-users/c/hg4OUmlS9T8/m/Lg8UYopCBAAJ
looks related. But the root cause there was a file permissions issue, which is surely not the case in my setup.

My Jenkins instance is 2.222.4, running in a container derived from the Jenkins base image jenkins/jenkins:2.222.4.
Message has been deleted

Martin Schmude

unread,
Mar 3, 2021, 7:03:11 AM3/3/21
to Jenkins Users
Anybody able to answer my question?

Mark Waite

unread,
Mar 16, 2021, 2:52:55 PM3/16/21
to Jenkins Users
You don't mention the operating system on the agent or the version of command line git on the agent.  CentOS 6, Oracle Linux 6, Red Hat Enterprise Linux 6, and Scientific Linux 6 all ship a 1.7 version of command line git that is so old that it is not officially supported by the Jenkins git plugin.  The plugin has made reasonable attempts to not break things that happily work with that old version of command line git, but no longer applies any effort to test it or to adapt to failures with it.

You could enable JGit on your installation and try the same checkout with JGit.  If it works with JGit, that may be another indicator that the issue is with the version of command line git on the agent.

You could install the most recent version of command line git on the agent (currently 2.31.0) and see if that resolves the issue.

Mark Waite
Message has been deleted

Martin Schmude

unread,
Mar 19, 2021, 6:33:20 AM3/19/21
to Jenkins Users
Our Jenkins connects to Linux nodes by SSH with RHEL 7. The git version is 1.8.3.1.
So the hint about an overaged git version is presumably right. Thank you, Mark!
The node systems are managed by the companies IT infrastructure team and only partially under my control.
So the JGit way looks promising and we will give it a try.
Reply all
Reply to author
Forward
0 new messages