Aaron
Aaron

Reputation: 7145

Why does Jenkins fail to git init and return status code 1?

Scenario

Versions of things

What have I tried on xcode7

Questions

Stack Trace from Jenkins Build Job

[EnvInject] - Mask passwords passed as build parameters.
Started by user anonymous
[EnvInject] - Loading node environment variables.
Building remotely on xcode7-xcode (xcode7) in workspace /var/jenkins/workspace/mobile.iphone-app-xcode7.ci
Cloning the remote Git repository
Cloning repository [email protected]:mobile/iphone-app.git
 > git init /var/jenkins/workspace/mobile.iphone-app-xcode7.ci # timeout=10
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Could not init /var/jenkins/workspace/mobile.iphone-app-xcode7.ci
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.execute(CliGitAPIImpl.java:656)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:463)
    at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:152)
    at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:145)
    at hudson.remoting.UserRequest.perform(UserRequest.java:121)
    at hudson.remoting.UserRequest.perform(UserRequest.java:49)
    at hudson.remoting.Request$2.run(Request.java:324)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
    at ......remote call to xcode7-xcode(Native Method)
    at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1356)
    at hudson.remoting.UserResponse.retrieve(UserRequest.java:221)
    at hudson.remoting.Channel.call(Channel.java:752)
    at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:145)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:131)
    at com.sun.proxy.$Proxy81.execute(Unknown Source)
    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:488)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1253)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:622)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:528)
    at hudson.model.Run.execute(Run.java:1745)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:89)
    at hudson.model.Executor.run(Executor.java:240)
Caused by: hudson.plugins.git.GitException: Command "git init /var/jenkins/workspace/mobile.iphone-app-xcode7.ci" returned         status code 1:
stdout: 
stderr: xcrun: error: missing DEVELOPER_DIR path: /Applications/Xcode
... 

Upvotes: 2

Views: 5355

Answers (2)

mkasberg
mkasberg

Reputation: 17262

The error that it's complaining about is error: missing DEVELOPER_DIR path: /Applications/Xcode. Is that variable set on both machines? Is is the same on both machines? Does the directory exist and contain the same thing on both machines?

Upvotes: 1

whitediver
whitediver

Reputation: 468

I hope update Jenkins to newest version helps

This bug found and fixed at Jenkins 1.509.4

See

I Think you can try to create remote working dir manual and run this command from console. This will be some kind of workaround

Upvotes: 1

Related Questions