The error suggested that it could be one, or many/all of the following, in order by what I think is most likely:
The git SHA is no longer available in the branch that is being referenced so when the checkout runs it is unable to locate the reference.
The current deploy key used is not allowed to checkout the branch or the git commit.
I would recommend trying to run the same command locally against the SHA to check if you are able to complete the clone to rule out the first option.
In regards to the second bullet point, I would recommend making sure that the SSH key that is set as your deploy key is generated in the right format following the guide below:
Hi Owen,
Thanks for your answer. The issue seemed to have resolved itself back in September. However, we are seeing the same error today.
After waiting a while, hitting the “Retrying the workflow from failed” button starts to work for some reason… like if GH and CCI are “”“out-of-sync”“”.
We didn’t change our CircleCI/GH configuration lately.
The error “fatal: reference is not a tree:” is being generated by git as it processes data that it has received from github and so is out of circleci’s control/hands.
One thing to look at - are you caching the git rep in some way so that the git command being issued by circleci is trying to update a local repo rather than generate a new local repo. If so delete the cached repo copy so that it has to be rebuilt. The reason for doing this can be seen on this thread for another CI system.