Shallow clone causes platform.sh (and potentially others) to hang-up during push

Created on 24 October 2024, 30 days ago

Problem/Motivation

The artifact deployment tool sensibly does a shall clone/fetch of the artifact repository.
This causes platform.sh to error (not on the first, but on subsequent pushes).
This is a known issue with platform.sh: https://support.platform.sh/hc/en-us/requests/332594?page=1

Steps to reproduce

Push to an existing branch.
Get error:
send-pack: unexpected disconnect while reading sideband packet.
fatal: the remote end hung up unexpectedly

Proposed resolution

At present I have just removed the shallow clone with a local project patch.
Should we consider making the shallow clone optional? I am happy to do this pending on your feedback.
The patch is on top of another patch for issue #3481055 and I have not yet created a clean patch against the head of this branch.

From 5f207271da2aa6480a310e08f9701da9cc150b4c Mon Sep 17 00:00:00 2001
From: Trent Crawford <trent.crawford@liip.ch>
Date: Thu, 24 Oct 2024 17:52:02 +0200
Subject: [PATCH] Don't shallow clone as it causes platform.sh to hang up.

---
 ArtifactDeploymentCommands.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ArtifactDeploymentCommands.php b/ArtifactDeploymentCommands.php
index ce0cd68..1d83f77 100644
--- a/ArtifactDeploymentCommands.php
+++ b/ArtifactDeploymentCommands.php
@@ -244,14 +244,14 @@ final class ArtifactDeploymentCommands extends DrushCommands {

     $outputCallback('out', "Initializing Git in $artifactDir");
     $this->localMachineHelper->checkRequiredBinariesExist(['git']);
-    $process = $this->localMachineHelper->execute(['git', 'clone', '--depth=1', $vcsUrl, $artifactDir],
+    $process = $this->localMachineHelper->execute(['git', 'clone', $vcsUrl, $artifactDir],
       $outputCallback,
       NULL,
       ($this->output->getVerbosity() > OutputInterface::VERBOSITY_NORMAL));
     if (!$process->isSuccessful()) {
       throw new \RuntimeException(sprintf('Failed to clone repository from the Cloud Platform: %s', $process->getErrorOutput()));
     }
-    $process = $this->localMachineHelper->execute(['git', 'fetch', '--depth=1', '--update-head-ok', $vcsUrl, $vcsPath . ':' . $vcsPath],
+    $process = $this->localMachineHelper->execute(['git', 'fetch', '--update-head-ok', $vcsUrl, $vcsPath . ':' . $vcsPath],
       $outputCallback,
       $artifactDir,
       ($this->output->getVerbosity() > OutputInterface::VERBOSITY_NORMAL));
--
2.47.0


Remaining tasks

Consider what is the most sustainable solution.

User interface changes

API changes

Potential method signatures will change if we make the shallow clone optional.

Data model changes

None

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇨🇭Switzerland tcrawford

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024