checkout
checkout copied to clipboard
The checkout action fails to load on github hosted runners failing builds randomly
We're using the matrix feature with 10 concurrent jobs if that's of any relevance
We ran into a similar issue following another failure during the actual checkout job. Here's some information about our incidents:
First failure
- Run actions/checkout@v2
Syncing repository: OUR_REPO
- Getting Git version info
Deleting the contents of '/home/runner/work/OUR_REPO'
- Initializing the repository
- Disabling automatic garbage collection
- Setting up auth
- Fetching the repository
- Removing auth
Error: The process '/usr/bin/git' failed with exit code 128
Second Failure
Download action repository 'actions/checkout@v2' (SHA:ec3...)
Warning: Failed to download action 'https://api.github.com/repos/actions/checkout/tarball/ec3...'. Error: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.
Warning: Back off 23.444 seconds before retry.
Warning: Failed to download action 'https://api.github.com/repos/actions/checkout/tarball/ec3...'. Error: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.
Warning: Back off 21.926 seconds before retry.
Error: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.
And our checkout step:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
Subsequent actions have been successful since these failures around 8:00AM UTC. We're going to attempt updating to actions/checkout@v3 (released 2 days ago) and continue monitoring.
Hi @slaymance: Because we have the same issue as you have described in the first issue, solved updating to version 3 that problem?
BR Daniel
In case anyone else has a similar issue: we got this problem, but only on macOS GitHub hosted runners.
When running actions/checkout@v3 after the other steps, it would get stuck there and time out after the default timeout which is 6 hours.
2022-08-23T10:14:32.9098260Z ##[group]Fetching the repository
2022-08-23T10:14:32.9112470Z [command]/usr/local/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +2dfd3ef1c71cac819fc022fae3263870f32de0d8:refs/tags/v0.1.2
2022-08-23T16:14:23.8258730Z ##[error]The operation was canceled.
Here is the code that was causing problems:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: "1.18.x"
- name: Configure GitHub For Private Modules
env:
GOPRIVATE: "github.com/aukilabs/*"
run: git config --global url."https://redacted:${{ secrets.GITHUB_PAT }}@github.com".insteadOf "https://github.com"
- name: Check out code
uses: actions/checkout@v3
We solved the problem by doing the actions/checkout@v3 step first.
I encountered this issue too this week. Mine was apparently due to variation in how some git clients handle user:password@ (vs a single token@) in the URL?
This worked fine on everything except macos:
steps:
- name: Configure Git
run: git config --global url.'https://${{ secrets.SPECIAL_TOKEN }}:@github.com'.insteadOf 'https://github.com'
- uses: actions/checkout@v3
Only the git client that actions/checkout uses on github-hosted macos runners (or some library or such) had an issue with the : in there right next to @github, but after removing the unnecessary colon, it works properly on all OSes (and golang toolchain still too).
# no ":" here ---V makes it happy
git config --global url.'https://${{ secrets.SPECIAL_TOKEN }}@github.com'.insteadOf 'https://github.com'
So it wasn't that git config can't be run before using actions/checkout@v3, but rather that the git client on macos is a lot more finnicky with a malformed token: with trailing colon but no password in the URL, which just happened to be caused by a preceding git config step.
full workflow example that I tested with
This version works -- swap out the commented run: lines to reproduce the error.
name: macos-test
on:
push:
branches: [macos-hanging-checkout]
env:
ACTIONS_RUNNER_DEBUG: true
ACTIONS_STEP_DEBUG: true
jobs:
macos-test:
timeout-minutes: 5 # prevent it hanging ~indefinitely
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-11]
do-conf: [true, false]
runs-on: ${{matrix.os}}
steps:
- name: Configure Git
# HEY! THERE WAS A ":" IN THERE
#run: git config --global url.'https://${{ github.token }}:@github.com'.insteadOf 'https://github.com'
run: git config --global url.'https://${{ github.token }}@github.com'.insteadOf 'https://github.com'
if: ${{matrix.do-conf}}
- uses: actions/checkout@v3
Encountered a problem very similar to @gulducat's, and the resolution was essentially the same. I had git config --global url."https://${{ secrets.GH_USER }}:${{ secrets.GH_TOKEN }}@github.com".insteadOf "https://github.com" as the url config string. This worked on linux and windows runners, but hung for a very long time when using the actions/checkout@v3 action on macos-latest. Removed ${{ secrets.GH_USER }}: and the actions/checkout@v3 step completed in less than a second.
Can we get someone to look into this? If the git config works on other runners, why doesn't it work on macos?