Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug Git: Error during clone

Discussion in 'Unity Build Automation' started by cmersereau, Sep 1, 2022.

  1. cmersereau

    cmersereau

    Joined:
    Nov 6, 2020
    Posts:
    52
    Cloud builds are failing with the error in the title. It was first noticed this morning with an automated clean build, but all project configurations are getting the same error.

    The following line after the error message is
    Connection to github.com closed by remote host.


    We are using Unity version 2020.3.20f1. We are building for Android only.

    Code (CSharp):
    1. 48: [2022-09-01T17:11:11.227Z] - 6.3.13.2.4.2 - INFO: ++++++++++++++++++++ SECTION ++++++++++++++++++++
    2. 49: [2022-09-01T17:11:11.228Z] - 6.3.13.2.4.2 - INFO: + Checking out Source Code
    3. 50: [2022-09-01T17:11:11.228Z] - 6.3.13.2.4.2 - INFO: ++++++++++++++++++++ SECTION ++++++++++++++++++++
    4. 51: [2022-09-01T17:11:12.170Z] - 6.3.13.2.4.2 - INFO: BVR: SCM Checkout
    5. 52: [2022-09-01T17:11:12.172Z] - 6.3.13.2.4.2 - INFO: GIT: Checkout project...
    6. 53: [2022-09-01T17:11:12.425Z] - 6.3.13.2.4.2 - INFO: GIT: git version (2.31.1)
    7. 54: [2022-09-01T17:11:12.425Z] - 6.3.13.2.4.2 - INFO: GIT: Checking out git@github.com:<mycompany>/<ourgitproject>.git/dev
    8. 55: [2022-09-01T17:13:47.139Z] - 6.3.13.2.4.2 - ERROR: GIT: Error during clone: /cygdrive/c/tools/cygwin/bin/gitc.exe  clone '--branch' 'dev' '--recursive' '--' 'git@github.com:<mycompany>/<ourgitproject>.git' 'BUILD_PATH/p/'  2>&1:Cloning into 'BUILD_PATH/p'...
    9. 56: Connection to github.com closed by remote host.
    10. 57: ! checkout failed. /cygdrive/c/tools/cygwin/bin/gitc.exe  clone '--branch' 'dev' '--recursive' '--' 'git@github.com:<mycompany>/<ourgitproject>.git' 'BUILD_PATH/p/'  2>&1:Cloning into 'BUILD_PATH/p'...
    11. 58: Connection to github.com closed by remote host.

    We have cloned the project locally using the exact clone command from the log, except instead of
    /cygdrive/c/tools/cygwin/bin/gitc.exe
    we simply use
    git
    . We have pulled all latest changes and successfully made builds on our local machines.

    I have seen a few similar posts in the Unity forums but none include resolution steps. I have a ticket open with Unity but my team would like a speedy solution to this problem.
     
    Last edited: Sep 1, 2022
  2. Benjamin-Gooding

    Benjamin-Gooding

    Unity Technologies

    Joined:
    Apr 12, 2022
    Posts:
    242
    Are you able to use oauth over ssh for your configuration of the source control? Just something that might be worth trying
     
  3. cmersereau

    cmersereau

    Joined:
    Nov 6, 2020
    Posts:
    52
    We have not tried that. It's certainly a valid suggestion, although we are hoping that the issue will be resolved for our current setup.

    We have a build running at this moment that appears to finally have gotten past the cloning issue. It is unknown what got it over the hump as it is an automated build from a developer pushing changes to Github for tasks not related to the build process. It has not finished so it's not quite a success yet, and we also obviously do not know if any underlying issue is actually resolved or we just got lucky with this one. If we run into another build failure for cloning, we will try the suggestion of switching to the oauth approach.
     
  4. Benjamin-Gooding

    Benjamin-Gooding

    Unity Technologies

    Joined:
    Apr 12, 2022
    Posts:
    242
    I would recommend switching to OAuth in general, especially for automated builds. When using OAuth we can rely on WebHooks to alert us to a commit rather than relying on us polling the source control provider every so often to see if there are changes.
     
    cmersereau likes this.