Git Failed to connect to repository : Could not init tmp

Article ID:218156697
1 minute readKnowledge base

Issue

Trying to setup a GIT repository on the SCM section for a job, the following error appears on the GUI:

Failed to connect to repository : Could not init /your/path/to/a/filetmp

In certain situations, the job is executed properly even with this issue.

Environment

  • Jenkins

  • Jenkins LTS

  • CloudBees Jenkins Enterprise

  • Git Plugin

Resolution

Follow these steps:

1) Check if Git is installed on the Jenkins server. If so, find path to the Git executable by:

  • Unix System: which git.

  • Windows System: where git.

2) Check if the Git Executable Path is properly set under Manage Jenkins  Global Tool Configuration  Git  Path to Git executable (for CJP 1.x it is under Manage Jenkins  Configure System  Git  Path to Git executable).

  • Unix System, example: /usr/bin/git.

  • Windows System example C:/Program Files (x86)/Git/bin/git.exe. Do not forget to include '.exe' extension

    Make sure not to include any white space at the end of your path.
This article is part of our Knowledge Base and is provided for guidance-based purposes only. The solutions or workarounds described here are not officially supported by CloudBees and may not be applicable in all environments. Use at your own discretion, and test changes in a safe environment before applying them to production systems.