[JIRA] (JENKINS-59897) Git Client plugin: No such file or directory

1 view
Skip to first unread message

stefan.eicher@gmail.com (JIRA)

unread,
Oct 23, 2019, 2:22:03 AM10/23/19
to jenkinsc...@googlegroups.com
Stefan Eicher created an issue
 
Jenkins / Bug JENKINS-59897
Git Client plugin: No such file or directory
Issue Type: Bug Bug
Assignee: Mark Waite
Attachments: image-2019-10-23-08-09-24-085.png
Components: git-client-plugin
Created: 2019-10-23 06:21
Environment: Git Client plugin: No such file or directory
Priority: Minor Minor
Reporter: Stefan Eicher

Hi,

I let Windows cleanup some files includeing the tmp files.

Then I hit the following Problem described later.

I am aware of:

"The Git Client plugin uses GIT_ASKPASS and creates a temporary script to execute when git prompts for credentials. "  https://wiki.jenkins.io/display/JENKINS/Git+Client+Plugin.

Can I somehow force the plugin to regenerate those temp files like

pass485608812120386475.bat?

Or do you have a other solution on how to fix this problem on my installation?

 

Regards Stefan

 

Problem :

Failed to connect to repository : Command "git.exe ls-remote -h https://****Firmware HEAD" returned status code 128:
stdout:
stderr: error: cannot run C:\Users\SVCBUI~1\AppData\Local\Temp\pass485608812120386475.bat: No such file or directory
fatal: could not read Username for 'https://****.com': terminal prompts disabled

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

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

unread,
Oct 23, 2019, 10:04:03 AM10/23/19
to jenkinsc...@googlegroups.com
Mark Waite assigned an issue to Unassigned
Change By: Mark Waite
Assignee: Mark Waite

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

unread,
Oct 23, 2019, 10:06:03 AM10/23/19
to jenkinsc...@googlegroups.com
Mark Waite resolved as Not A Defect
Change By: Mark Waite
Status: Open Resolved
Resolution: Not A Defect

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

unread,
Oct 23, 2019, 10:06:03 AM10/23/19
to jenkinsc...@googlegroups.com
Mark Waite commented on Bug JENKINS-59897
 
Re: Git Client plugin: No such file or directory

The plugin assumes that the temporary directory exists and can be written. Double check that C:\Users\SVCBUI~1\AppData\Local\Temp exists and can be written by the user running the agent.

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

unread,
Oct 23, 2019, 10:07:02 AM10/23/19
to jenkinsc...@googlegroups.com
Mark Waite edited a comment on Bug JENKINS-59897
The plugin assumes that the temporary directory exists and can be written.  Double check that {{C:\Users\SVCBUI~1\AppData\Local\Temp}} exists and can be written by the user running the agent (or in this case with {{git ls-remote}}, the user running the master) .

stefan.eicher@gmail.com (JIRA)

unread,
Oct 28, 2019, 9:44:02 AM10/28/19
to jenkinsc...@googlegroups.com

Hi, 

The folder C:\Users\SVCBUI~1\AppData\Local\Temp exists and can be written.
The problem was that I ran a file cleanup in windows to free some space and this has deleted the temp file which the job does not find anymore.

Therefore I wanted to know if I can somehow force the plugin to regenerate those temp files if they do not exist

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

unread,
Oct 28, 2019, 10:21:03 AM10/28/19
to jenkinsc...@googlegroups.com

Those temporary files are only used for the duration of a single command line git call which is run by the git client plugin and the git plugin. After each call, they are deleted.

The plugins give their best effort to remove those temporary files when they are no longer needed. There should be no need to regenerate temp files if they do not exist. Can you explain why you believe that you need to regenerate those temporary files?

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

unread,
Oct 28, 2019, 10:23:04 AM10/28/19
to jenkinsc...@googlegroups.com
Mark Waite edited a comment on Bug JENKINS-59897
Are you certain that the user running the Jenkins process on the master computer can write to that temporary directory?  The message is an indication that the user can't write to the directory or can't read from the directory.

Those temporary files are only used for the duration of a single command line git call which is run by the git client plugin and the git plugin.  After each call, they are deleted.

The plugins give their best effort to remove those temporary files when they are no longer needed.  There should be no need to regenerate temp files if they do not exist.  Can you explain why you believe that you need to regenerate those temporary files?

r0maikx02b@gmail.com (JIRA)

unread,
Mar 21, 2020, 6:59:03 AM3/21/20
to jenkinsc...@googlegroups.com
Andras Kucsma edited a comment on Bug JENKINS-59897
I tracked down the source of this bug. It seems to affect newer git versions, from around version 2.19.2.

The problem is, that if git doesn't find a forward slash in the askpass executable path, it thinks it has to look for the binary somewhere in the PATH environment variable: See prepare_cmd() here:
[https://github.com/git/git/blob/98cedd0233e/run-command.c#L429-L439]

The "error: cannot run" part is printed here, after prepare_cmd returns -1, and this is the only case when this happens.
[https://github.com/git/git/blob/98cedd0233e/run-command.c#L749-L753]

It is possible to reproduce this issue without the git jenkins plugin as well. From CMD, assume C:\askpass.bat exists:
This will result in the same error:
{code:java}
set GIT_ASKPASS=C:\askpass.bat
git clone https://<some_private_repo>.git{code}
This will work (notice the forward slash after C:)
:
{code:java}
set GIT_ASKPASS=C:/askpass.bat
git clone https://<some_private_repo>.git{code}

It seems like this logic was introduced in this commit in git:

[https://github.com/git/git/commit/321fd823897#diff-7577a5178f8cdc0f719e580577889f04R401-R415

]This is arguably a bug in git, but still, a possible workaround would be to change one of the path separators in the temporary path from a '\' to a '/'
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

r0maikx02b@gmail.com (JIRA)

unread,
Mar 21, 2020, 6:59:04 AM3/21/20
to jenkinsc...@googlegroups.com

I tracked down the source of this bug. It seems to affect newer git versions, from around version 2.19.2.

The problem is, that if git doesn't find a forward slash in the askpass executable path, it thinks it has to look for the binary somewhere in the PATH environment variable: See prepare_cmd() here:
https://github.com/git/git/blob/98cedd0233e/run-command.c#L429-L439

The "error: cannot run" part is printed here, after prepare_cmd returns -1, and this is the only case when this happens.
https://github.com/git/git/blob/98cedd0233e/run-command.c#L749-L753

It is possible to reproduce this issue without the git jenkins plugin as well. From CMD, assume C:\askpass.bat exists:
This will result in the same error:

set GIT_ASKPASS=C:\askpass.bat
git clone https://<some_private_repo>.git

This will work (notice the forward slash after C:

set GIT_ASKPASS=C:/askpass.bat
git clone https://<some_private_repo>.git

It seems like this logic was introduced in this commit in git:

[https://github.com/git/git/commit/321fd823897#diff-7577a5178f8cdc0f719e580577889f04R401-R415

]This is arguably a bug in git, but still, a possible workaround would be to change one of the path separators in the temporary path from a '\' to a '/'

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

unread,
Mar 21, 2020, 11:33:03 AM3/21/20
to jenkinsc...@googlegroups.com

Thanks for investigating, Andras Kucsma. Unfortunately, I can't duplicate the results that you are seeing.

I'm running Git for Windows 2.25.1.windows.1 from a Windows 10 command prompt. The Windows 10 environment has the latest feature release installed.

When I create C:\askpass.bat and

set GIT_ASKPASS=C:\askpass.bat
git clone https://github.com/MarkEWaite/tasks.git

the clone succeeds.

If I remove or rename that GIT_ASKPASS file, the clone fails.

Can you provide more details on the case where you're seeing the failure? What version of Git for Windows are you running? Are you running something that is not Git for Windows, like possibly git installed from cygwin?

r0maikx02b@gmail.com (JIRA)

unread,
Mar 21, 2020, 11:53:05 AM3/21/20
to jenkinsc...@googlegroups.com

Hi Mark! I'm using Windows Server 2019, with git 2.21.0 installed using cygwin. This setup has worked in the past with an older version of git (2.7.0).

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

unread,
Mar 21, 2020, 12:13:02 PM3/21/20
to jenkinsc...@googlegroups.com

Thanks. I don't run with cygwin and I don't test with cygwin. I have enough complexities in the git plugin testing environment that I have not been willing to extend git plugin support to cygwin. Git for Windows is the git officially supported by the git client plugin.

Independent of official support, I think it is a very good idea to change the git client plugin to use Unix style '/' in the GIT_ASKPASS. I'm marking this bug report as 'newbie-friendly' so that someone can experiment with writing tests to check the condition and then changing the value of GIT_ASKPASS and SSH_ASKPASS to use Unix style '/' in the path instead of the Windows style '\' .

Reply all
Reply to author
Forward
0 new messages