Tried with the configure option, not able to find the tools
configuration option and the git executable section. Seems like it
occurs after a successful build only. Please help.
Here's the output I receive after building the project on the console output section:
Building in workspace C:\Users\Anishas\.jenkins\workspace\Sample123
Cloning the remote Git repository
Cloning repository https://github.com/AnishaSalunkhe/HelloWorld.git
> C:\Users\Anishas\git init C:\Users\Anishas\.jenkins\workspace\Sample123 # timeout=10
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Could not init C:\Users\Anishas\.jenkins\workspace\Sample123
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.execute(CliGitAPIImpl.java:656)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:463)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1057)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1097)
at hudson.scm.SCM.checkout(SCM.java:485)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1269)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:607)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
at hudson.model.Run.execute(Run.java:1738)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Caused by: hudson.plugins.git.GitException: Error performing command: C:\Users\Anishas\git init C:\Users\Anishas\.jenkins\workspace\Sample123
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1726)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1695)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1691)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1321)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.execute(CliGitAPIImpl.java:654)
... 12 more
Caused by: java.io.IOException: Cannot run program "C:\Users\Anishas\git" (in directory "C:\Users\Anishas\.jenkins\workspace\Sample123"): CreateProcess error=5, Access is denied
at java.lang.ProcessBuilder.start(Unknown Source)
at hudson.Proc$LocalProc.<init>(Proc.java:240)
at hudson.Proc$LocalProc.<init>(Proc.java:212)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:815)
at hudson.Launcher$ProcStarter.start(Launcher.java:381)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1715)
... 16 more
Caused by: java.io.IOException: CreateProcess error=5, Access is denied
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 22 more
ERROR: null
Finished: FAILURE
This wasted so much time on my Jenkins Windows slave.
I knew git was in the path because I executed "where git" in the build job's batch command.
where git
C:\Program Files (x86)\Git\cmd\git.exe
Apparently the Jenkins Git Plugin executes ** before ** the environment is inherited.
SET YOUR SLAVE's PATH to Git ( Just DO IT !! )
1) Go to your Windows slave configuration
Manage Jenkins > Manage Nodes
2) Select your slave configuration
3) Check Tool Locations under Node Properties
4) Enter complete path to git executable including git.exe
[x] Tool Locations
Name: (GIT) git
Home: C:\Program Files (x86)\Git\cmd\git.exe
See screenshot:
Go to Manage Jenkins / Global Tool Configuration and set Path to Git executable:
set the path to git.exe and not only to the directory of the git file in both the locations of tool configurations.
Check for below command in Jenkins Server in linux Env:
`whereis git`
you will get the path like /usr/bin/git
Place it in Manage jenkin>Global Tool Configuration> under git path mention /usr/bin/git
Rerun job again
Sometimes this error occurs when disk space is less. so do check the space of your machine where jenkins is hosted. :)
If anyone is using Jenkins with freshly installed Xcode, you'll need to agree to the license using sudo xcodebuild -license or agree through UI.
There can be multiple reasons for that
Check the Permission of the Folder or the Worker Node, In my case 3rd one was the issue because of not providing permissions to the users and groups. As a result you may need to do
sudo chown -R user:group folderName
Check you have configured the SSH Key, if you are using Private Repo from GitHub.
Path Must be provided inside Jenkins Global Configuration of Default Git
In my case,
I have installed git on my slave server. Download-git
Run cmd command
where git
and update your git path with exe file like below in Jenkins node configuration.
C:\Program Files\Git\cmd\git.exe
Go to your Windows slave configuration, Manage Jenkins > Manage Nodes > Select your slave > configure
Check "Tool Locations" under "Node Properties" and give the full path what you got from 'where git' command and save.
yes I have faced the same issue on the Linux ec2 instance but I fixed it through
First of all on your server run the below command, and this command will return to you
$ which git
this command will return to you the actual path of the git, where your git is installed like that /usr/bin/git copy this path.
open your Jenkins > go to manage Jenkins >Global tool configuration > paste the in this field "Path to Git executable
Windows:
1. Install git in windows machine
2. The git.exe path is C:\Program Files\Git\cmd\git.exe (by default, unless you change during installation)
3.Now need to show the path of git.exe in Jenkins git plugin tool
a)manage Jenkins>Global Tool Configuration>Git
b)Add git : name: anything and Path:C:\Program Files\Git\cmd\git.exe
4. Then build for clone. Should be ok
Linux CentOS7:
Same error message I got and after installation git in same machine were Jenkins installed, it is solved.
yum install git
Then you need to follow below steps. Hope so this may be useful for you to resolve your problem.
If your master is linux machine and slave is windows machine...
Pre-Requisites:
your slave machine should have same java version(jdk 1.8).
Git should be installed on your slave machine.
Steps to follow:
Go to your Windows slave configuration Manage Jenkins > Manage Nodes
Select your slave configuration
Check Tool Locations under Node Properties
Enter complete path to git executable including git.exe
Tool Locations
Name: (GIT) git
Home: C:\Program Files (x86)\Git\cmd\git.exe
See screenshot:
1) Make sure the git.exe has executable permissions.
2) Make sure git is configured correctly to refer in Global Tool configurations and also on the Jenkins agent (windows in your case) where you running the job, environment variable for git.exe executable is set correctly
have this problem after my company move to 2FA (2 factory authentication) at GitHub
in the Jenkins I get in credential this
to fix it
I create a personal access token in Github from here
2)after that i get to the same place in the jenkins when the errors ->Credential->add ->jenkins
and get as you see in the picture down
username= what you want name
password = token that you get
Upgrading all plugins and Jenkins to 2.332.1 solved for me
This answer may sound like a joke, but it resolved the exact error message we were getting for only 1 pipeline:
Check if the pipeline has a parameter with no name value.
Don't forget to Add your deploy key credentials (the deploy key attached to the github project) in jenkins (http://yourjenkinsurl:8080/credentials/)
I need some help with an authentication issue I have encountered with Github/Jenkins.
Setup is as follows:
Jenkins master is on windows
Slave is running on OSX
Jenkins can communicate fine with the slave
When trying to pull from our private git repo we see the following error, this error is not on either the master or other linux slaves and clones fine in OSX terminal.
Started by user xxxxxxxxxxxx
[EnvInject] - Loading node environment variables.
Building remotely on MAC01 in workspace /var/jenkins/workspace/xxxxxxxxxxxx
Checkout:NativeiOSSlots / /var/jenkins/workspace/xxxxxxxxxxxxx - hudson.remoting.Channel#166d8eb:MAC01
Using strategy: Default
Last Built Revision: Revision 7232678c31bf2c6f3c4bd5a66b349edf9288440c (origin/HEAD, origin/master)
Cloning the remote Git repository
Cloning repository <repo url>
git --version
git version 1.8.3.1
ERROR: Error cloning remote repo 'origin' : Could not clone <repo url>
hudson.plugins.git.GitException: Could not clone <repo url>
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:226)
at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.clone(AbstractGitAPIImpl.java:57)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.clone(CliGitAPIImpl.java:33)
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1012)
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:948)
at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2387)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:326)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:680)
Caused by: hudson.plugins.git.GitException: Command "/Applications/GitHub.app/Contents/Resources/git/bin/git clone --progress -o origin <repo url> /var/jenkins/workspace/xxxxxxxxxx" returned status code 128:
stdout: Cloning into '/var/jenkins/workspace/xxxxxxxxxx'...
stderr: remote: Repository not found.
fatal: Authentication failed for '<repo url>'
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:790)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$100(CliGitAPIImpl.java:33)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:224)
... 14 more
Any Ideas?
I was facing same problem. Jenkin was not able to clone my git repo to local PC.
Solution:
Start services.msc
goto Jenkins service and open it's property
goto Logon tab and and give your a/c userName and password.
restart the service.
These steps solved my problem, as I have given my enterprise login and password in there.
Most likely the user that the Jenkins slave runs as on your Mac isn't properly set up for github (doesn't have the proper certificate). On my Mac slave that's the user named jenkins. Log in as that user on your slave and see if you can do:
ssh -T git#github.com
If that's not working, make sure you have the proper certificate installed and that the machine can see the outside world.
Does it really clone fine from the terminal when run as the user running jenkins ?
You probably haven't set up your SSH access properly. See this: Could not clone repository
I also had this issue. I ended up having to downgrade my Git Client plugin to 1.6.4. When I was running 1.8.0 I got this error for every repo I tried to clone. As soon as I rolled it back, it all started to work.
Right now I'm trying to pull a repository from bitbucket with the Git plugin, and build it within jenkins. However, whenever I do this, I get:
FATAL: Could not checkout null with start point <Starting Point>
hudson.plugins.git.GitException: Could not checkout null with start point <Starting Point>
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.checkoutBranch(CliGitAPIImpl.java:894)
at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1229)
at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1205)
at hudson.FilePath.act(FilePath.java:906)
at hudson.FilePath.act(FilePath.java:879)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1205)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1394)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:676)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:581)
at hudson.model.Run.execute(Run.java:1593)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:247)
Caused by: hudson.plugins.git.GitException: Command "git checkout -f <Starting Point>" returned status code 1:
stdout:
stderr: error: unable to unlink old <File> (Permission denied)
error: unable to unlink old <File> (Permission denied)
error: unable to unlink old <File> (Permission denied)
error: unable to unlink old <File> (Permission denied)
error: unable to create file <File> (Permission denied)
error: unable to unlink old <File> (Permission denied)
I've tried manually deleting the files under the non-jenkins user in OSX, and it works, but then it will be unable to create a file.
EDIT: I actually fixed the problem by adding an "Execute shell command" step, and inserting "Git pull ", rather than using the Git plugin.
The Starting Point parameter needs to be defined
Try this instead:
git checkout -f HEAD
I am using Jenkings in Linux_Machine_1. It have around 20 jobs(successfully running jobs)
I copied .jenkins folder to Linux_Machine_2. I started Jenkins in Linux_Machine_2.
I tried to run one of the jobs and I am getting below error:
Started by user anonymous
Building in workspace /home/portaldev/.jenkins/workspace/Trunk_Build
[Trunk_Build] $ /usr/local/bin/bash -xe /tmp/hudson1846171411013031358.sh
FATAL: command execution failed
java.io.IOException: Cannot run program "/usr/local/bin/bash" (in directory "/home/portaldev/.jenkins/workspace/Trunk_Build"): error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
at hudson.Proc$LocalProc.<init>(Proc.java:244)
at hudson.Proc$LocalProc.<init>(Proc.java:216)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:763)
at hudson.Launcher$ProcStarter.start(Launcher.java:353)
at hudson.Launcher$ProcStarter.join(Launcher.java:360)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:91)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:60)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
at hudson.model.Build$BuildExecution.build(Build.java:199)
at hudson.model.Build$BuildExecution.doRun(Build.java:160)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:586)
at hudson.model.Run.execute(Run.java:1576)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:241)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:135)
at java.lang.ProcessImpl.start(ProcessImpl.java:130)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1021)
... 16 more
Build step 'Execute shell' marked build as failure
An attempt to send an e-mail to empty list of recipients, ignored.
Finished: FAILURE
After I created simple job Test_Job (no build scripts) in the Linux_Machine_2. And build, even I am getting same type of error.
I tried by execute permission to all .jenkins folder
chmod +x .jenkings/
Even same out error output.
I run which bash and it gave output /bin/bash.
say ls -l /usr/local/bin/bash on machine 1 to see if there's a symbolic link from /usr/local/bin/bash to /bin/bash. if yes, then create the same link on machine 2:
cd /usr/local/bin
ln -s /bin/bash .
i'm trying to built my Xcode Projekt with Jenkins, but when i built i get the error
Started by user anonymous Building in workspace /Users/icash/.jenkins/jobs/first-ios-app/workspace JDK installation
skipped: Unknown CPU name: mac os x Checkout:workspace / /Users/icash/.jenkins/jobs/first-ios-app/workspace -
hudson.remoting.LocalChannel#13ed9bc5 Using strategy: Default Last Built Revision:
Revision abc22103fa068c103fabf76999ec03d8710957f4 (origin/master)
Checkout:workspace / /Users/icash/.jenkins/jobs/first-ios-app/workspace -
hudson.remoting.LocalChannel#13ed9bc5 Fetching changes from 1 remote Git repository Fetching upstream changes
from git://github.com/shinetech/jenkins-ios-example.git Commencing build of Revision
abc22103fa068c103fabf76999ec03d8710957f4 (origin/master) Checking out Revision abc22103fa068c103fabf76999ec03d8710957f4
(origin/master) JDK installation skipped: Unknown CPU name: mac os x Working directory is
/Users/icash/.jenkins/jobs/first-ios-app/workspace [workspace] $ /users/icash/dev/ -version FATAL: Cannot run program
"/users/icash/dev/" (in directory "/Users/icash/.jenkins/jobs/first-ios-app/workspace"): error=13, Permission denied
java.io.IOException: Cannot run program "/users/icash/dev/" (in directory
"/Users/icash/.jenkins/jobs/first-ios-app/workspace"): error=13, Permission denied
at java.lang.ProcessBuilder.start(ProcessBuilder.java:460) at hudson.Proc$LocalProc.<init>(Proc.java:244)
at hudson.Proc$LocalProc.<init>(Proc.java:216) at hudson.Launcher$LocalLauncher.launch(Launcher.java:707)
at hudson.Launcher$ProcStarter.start(Launcher.java:338) at hudson.Launcher$ProcStarter.join(Launcher.java:345)
at au.com.rayh.XCodeBuilder.perform(XCodeBuilder.java:120)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:703)
at hudson.model.Build$RunnerImpl.build(Build.java:178)
at hudson.model.Build$RunnerImpl.doRun(Build.java:139)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:473)
at hudson.model.Run.run(Run.java:1410)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:238) Caused by: java.io.IOException: error=13, Permission denied
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:53)
at java.lang.ProcessImpl.start(ProcessImpl.java:91)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
although i gave .jenkins folder all permission.
Looks like that it is trying to run a directory (/users/icash/dev/) as if it is an app. Seems something is configured incorrectly. Search for /users/icash/dev/ in your top-level config.xml; if not found search for a pattern ${var_name}/dev. If not found there, look in config.xml for your job.
I bet your build step looks like:
/users/icash/dev/$SOMEVARIABLE -version
and SOMEVARIABLE is not defined in the environment where Jenkins is running. That is why it expands into an empty string. What is left is the path to a directory and you cannot execute that.
If you need some environment variables in Jenkins, you can set them by going to Jenkins UI -> Manage Jenkins -> Configure System. Then add environment variables there.