Repeated `Warning: Checkout failed` errors while preparing working directory
- Dominant language
- Go
- Stars
- 1.1k
- Forks
- 378
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 74
Description
Heya,
We've recently setup a windows pipeline (https://buildkite.com/angular/angular) and have observed some odd errors (log [1](https://buildkite.com/angular/angular/builds/70#9fc8283b-7088-4aee-9582-53166c9a8d3d], [2](https://buildkite.com/angular/angular/builds/96#65a95d9f-7677-4d22-b794-d56b985463aa), [3](https://buildkite.com/angular/angular/builds/67#f8dc2fab-07e5-489e-8be4-f7a64d1099c9), [3](https://buildkite.com/angular/angular/builds/97#49ffb1e8-0930-453d-ae7a-439437201014)). The pipeline is public so anyone should be able to see the builds.
All of these fail in the `Preparing working directory` in a similar pattern: somehow the folder is no longer a git repository and the retries fail:
```
[2018-12-06T07:58:04Z] > cd C:\buildkite-agent\builds\gce-buildkite-windows-1-3\angular\angular
--
| [2018-12-06T07:58:04Z] > git remote set-url origin https://github.com/angular/angular
| [2018-12-06T07:58:04Z] fatal: not a git repository (or any of the parent directories): .git
| [2018-12-06T07:58:04Z] # Removing C:\buildkite-agent\builds\gce-buildkite-windows-1-3\angular\angular
| [2018-12-06T07:58:04Z] ⚠️ Warning: Checkout failed! Error running `C:\git\cmd\git.exe remote set-url origin https://github.com/angular/angular`: exit status 128 (Attempt 1/3 Retrying in 2s)
| [2018-12-06T07:58:06Z] > git remote set-url origin https://github.com/angular/angular
| [2018-12-06T07:58:06Z] fatal: not a git repository (or any of the parent directories): .git
| [2018-12-06T07:58:06Z] # Removing C:\buildkite-agent\builds\gce-buildkite-windows-1-3\angular\angular
| [2018-12-06T07:58:06Z] ⚠️ Warning: Checkout failed! Error running `C:\git\cmd\git.exe remote set-url origin https://github.com/angular/angular`: exit status 128 (Attempt 2/3 Retrying in 2s)
| [2018-12-06T07:58:08Z] > git clone --config core.autocrlf=input --config core.eol=lf --config core.longpaths=true --config core.symlinks=true -- https://github.com/angular/angular .
| [2018-12-06T07:58:08Z] fatal: destination path '.' already exists and is not an empty directory.
| [2018-12-06T07:58:08Z] # Removing C:\buildkite-agent\builds\gce-buildkite-windows-1-3\angular\angular
| [2018-12-06T07:58:08Z] ⚠️ Warning: Checkout failed! Error running `C:\git\cmd\git.exe clone --config core.autocrlf=input --config core.eol=lf --config core.longpaths=true --config core.symlinks=true -- https://github.com/angular/angular .`: exit status 128 (Attempt 3/3 Retrying in 2s)
| [2018-12-06T07:58:10Z] 🚨 Error: Error running `C:\git\cmd\git.exe clone --config core.autocrlf=input --config core.eol=lf --config core.longpaths=true --config core.symlinks=true -- https://github.com/angular/angular .`: exit status 128
```
It doesn't always happen and subsequent builds of the same code can succeed (see [67](https://buildkite.com/angular/angular/builds/67#f8dc2fab-07e5-489e-8be4-f7a64d1099c9) and then [86](https://buildkite.com/angular/angular/builds/86#496de24a-77d9-4cb6-bf3d-2b47347f9fec).
There isn't much for us to go on here since our build steps never really run. This all happens in the agent repository cloning code.
@lox @toolmantim this seems like a more severe version of what I saw a couple of weeks ago (https://github.com/buildkite-plugins/docker-buildkite-plugin/issues/85#issuecomment-441130155), but this time the retries did not work.
Contributor guide
Assessment
This issue has not been assessed yet.