0

I am trying to execute a Jenkins job , that pulls the code from git repo and then builds and execute integrations. During git fetch i am getting below issue. I have another Jenkins job, with same git repo configured , and its working fine there. I refered many threads, like Git submodule head 'reference is not a tree' error , but still not getting how in one Jenkins job , its working fine and failing in another

 17:48:37  > git rev-parse origin/alternate^{commit} # timeout=10
    17:48:37 Checking out Revision 8e4ffd8bb7596248efd4082ea529d42ce8022b1e (origin/alternate)
    17:48:37  > git config core.sparsecheckout # timeout=10
    17:48:37  > git checkout -f 8e4ffd8bb7596248efd4082ea529d42ce8022b1e # timeout=10
    17:48:39 Commit message: "Merged 1 PR(s): pull request #1987 (disable batch node in dev/stage) from ksdwpta/disable_SYSE-6232  (https://git.corp.mycompany.com/Org/StorageService/pull/1987)"
    17:48:39 First time build. Skipping changelog.
    17:48:39 [EnvInject] - Inject global passwords.
    17:48:39 [EnvInject] - Mask passwords that will be passed as build parameters.
    17:48:39 [css-dev-esm-an1-deploytool-validation-demo] $ /bin/bash /apps/temp/jenkins1473873858039772764.sh
    17:48:39 fatal: reference is not a tree: 9a895aa7b58bc033068f1a61b8dab66ab4faedd4
    17:48:39 Build step 'Execute shell' marked build as failure
    17:48:39 $ ssh-agent -k
    17:48:39 unset SSH_AUTH_SOCK;
    17:48:39 unset SSH_AGENT_PID;
    17:48:39 echo Agent pid 20731 killed;
    17:48:39 [ssh-agent] Stopped.
    17:48:39 Recording test results
    17:48:39 ERROR: Step ?Publish JUnit test result report? failed: No test report files were found. Configuration error?
    17:48:39 Archiving artifacts
    17:48:39 Notifying endpoint with url 'https://conduit.pipeline.corp.mycompany.com/v1/jenkins/status'
    17:48:39 Started calculate disk usage of build
    17:48:39 Finished Calculation of disk usage of build in 0 seconds
    17:48:39 Started calculate disk usage of workspace
    17:48:40 Finished Calculation of disk usage of workspace in 0 seconds
    17:48:40 Finished: FAILURE
KCS
  • 2,257
  • 4
  • 14
  • 22

1 Answers1

0

TLDR : if it is easy for you to tear down a jenkins agent and spawn a new one, try that and see if it chases the problem away.


More details :

In git parlance : a "tree" is a directory stored in git's database.

For some reason : the tree identified by the hash 9a895aa... mentionned in the error message is not accessible.

That's all that can be sais with certainty with the information you posted, we would need more details if you need further assistance (see "Debugging" below)


Some possible reasons :

  • the trace mentions a sparsecheckout option : if this agent does not have that tree in its repo, it will not be able to access it
  • for some reason, the git clone used by this specific agent got corrupted, and is now missing this tree
  • there are some submodules within your repo which haven't been initialized/fetched correctly

Debugging :

  • your trace mention a jenkins1473873858039772764.sh which is the sign of an inline script written in your pipeline (is that correct ?).

If you can : add the text of this script to your question.

You can also edit the script to add more traces (e.g : by adding echo "some message" instructions in it)

  • on your local clone, you can check if tree 9a895aa... should be part of your own repo, or perhaps of some submodule :

    # from your repo, run :
    git show 9a895aa
    

Fixing ?

  • try removing the sparsecheckout option
  • if the tree is displayed succesfully on your local clone: the jenkins agent should have it ; the easiest fix is to re-clone the repo on that agent, or reset the agent
  • if it isn't: it must probably be a tree in a submodule, run the same command from within each of your submodules ; once you have identified the submodule, check how this submodule is initialized on this jenkins agent
LeGEC
  • 29,595
  • 2
  • 37
  • 78