How do I fix `fatal: the remote end hung up unexpectedly` while pushing from a GitLab pipeline to Platform.sh?

While pushing to Platform git repository from our GitLab runner, the pipeline fails with the following error: fatal: the remote end hung up unexpectedly.
How can I fix that?

The GitLab runner 8.9 introduced a new feature called shallow cloning.

This feature allows GitLab runner to fetch only a subset of your repository commit history as opposed to the whole commit history. Unfortunately, when the runner pushes an incomplete history to your Platform repository, the Platform git server hangs and terminates transfer, causing your pipeline to fail with fatal: the remote end hung up unexpectedly.

Until we support shallow clones, the solution is to disable them. Setting “Git shallow clone” to 0 as shown in the below screenshot will resolve the issue.

1 Like

I was able to resolve the problem by following this.

1 Like