Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-61076

add a hex output of the error code in case of failure running git cli on windows

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • git-client-plugin
    • None

      if the git plugin fails to launch git on windows it logs the error as a signed int in the jobs console log.

      however on windows the failure is likely to be a {{HRESULT }}which is an unsigned int and you need to know that in order to google to find the underlying cause.  Most users who have never interacted with the windows API probably don't know that.

      therefore in addition to an error code (which could be returned by git/ssh) the request is to add the hex to the log with perhaps a pointer to the [MS documentation|https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/596a1078-e883-4972-9bbc-49e60bebca55] and the git documentation (if there is any) explaining the error codes.  (Jenkins also has a lookup from HRESULT to human text - so as an added bonus this could be used as well).

      [2020-02-13T11:19:27.516Z] using credential xxxxxxxxxxxxxxxx
      [2020-02-13T11:19:27.536Z] Cloning the remote Git repository
      [2020-02-13T11:19:27.536Z] Cloning with configured refspecs honoured and without tags
      [2020-02-13T11:19:13.417Z] Cloning repository git@github.com:myorg/myrepo.git
      [2020-02-13T11:19:13.521Z]  > git init C:\e4909a8e\workspace\_myrepo_PR-288 # timeout=10
      [2020-02-13T11:19:28.304Z] ERROR: Error cloning remote repo 'origin'
      [2020-02-13T11:19:28.304Z] hudson.plugins.git.GitException: Could not init C:\e4909a8e\workspace\_myrepo_PR-288
      [2020-02-13T11:19:28.304Z] 	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.execute(CliGitAPIImpl.java:918)
      [2020-02-13T11:19:28.304Z] 	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:710)
      [2020-02-13T11:19:28.304Z] 	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)
      [2020-02-13T11:19:28.304Z] 	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)
      [2020-02-13T11:19:28.305Z] 	at hudson.remoting.UserRequest.perform(UserRequest.java:211)
      [2020-02-13T11:19:28.305Z] 	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
      [2020-02-13T11:19:28.305Z] 	at hudson.remoting.Request$2.run(Request.java:369)
      [2020-02-13T11:19:28.305Z] 	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      [2020-02-13T11:19:28.305Z] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      [2020-02-13T11:19:28.305Z] 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      [2020-02-13T11:19:28.305Z] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      [2020-02-13T11:19:28.305Z] 	at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:97)
      [2020-02-13T11:19:28.305Z] 	at java.lang.Thread.run(Thread.java:748)
      [2020-02-13T11:19:28.305Z] 	Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from xxx-xxx-xxx-xxx.ingress-nginx.ingress-nginx.svc.cluster.local/xxx.xxx.xxx.xxx:56774
      [2020-02-13T11:19:28.305Z] 		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1741)
      [2020-02-13T11:19:28.305Z] 		at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
      [2020-02-13T11:19:28.305Z] 		at hudson.remoting.Channel.call(Channel.java:955)
      [2020-02-13T11:19:28.305Z] 		at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146)
      [2020-02-13T11:19:28.305Z] 		at sun.reflect.GeneratedMethodAccessor1158.invoke(Unknown Source)
      [2020-02-13T11:19:28.305Z] 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      [2020-02-13T11:19:28.305Z] 		at java.lang.reflect.Method.invoke(Method.java:498)
      [2020-02-13T11:19:28.305Z] 		at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:132)
      [2020-02-13T11:19:28.305Z] 		at com.sun.proxy.$Proxy164.execute(Unknown Source)
      [2020-02-13T11:19:28.305Z] 		at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1152)
      [2020-02-13T11:19:28.305Z] 		at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1192)
      [2020-02-13T11:19:28.305Z] 		at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:124)
      [2020-02-13T11:19:28.305Z] 		at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:93)
      [2020-02-13T11:19:28.305Z] 		at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:80)
      [2020-02-13T11:19:28.305Z] 		at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
      [2020-02-13T11:19:28.305Z] 		at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      [2020-02-13T11:19:28.305Z] 		at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      [2020-02-13T11:19:28.305Z] 		at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      [2020-02-13T11:19:28.305Z] 		at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      [2020-02-13T11:19:28.305Z] 		... 1 more
      [2020-02-13T11:19:28.305Z] Caused by: hudson.plugins.git.GitException: Command "git init C:\e4909a8e\workspace\_myrepo_PR-288" returned status code -1073741502:
      [2020-02-13T11:19:28.305Z] stdout: 
      [2020-02-13T11:19:28.305Z] stderr: 
      [2020-02-13T11:19:28.305Z] 	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2174)
      [2020-02-13T11:19:28.305Z] 	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2142)
      [2020-02-13T11:19:28.305Z] 	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2138)
      [2020-02-13T11:19:28.305Z] 	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1743)
      [2020-02-13T11:19:28.305Z] 	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.execute(CliGitAPIImpl.java:916)
      [2020-02-13T11:19:28.305Z] 	... 12 more
      

            Unassigned Unassigned
            teilo James Nord
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: