Skip to content

main windows-test workflow error handling is buggy #938

Open
@jsoref

Description

@jsoref

Looking at some runs, I noticed some odd failures...

This run especially:
https://github.com/check-spelling/git/actions/runs/762362339/workflow

Here's an excerpt of the log (eventually the run will be Garbage Collected, and at some point before or after that, I will probably delete the repository):

❌ actions/checkout@v1
    steps:
    - uses: actions/checkout@v1
Run actions/checkout@v1
Syncing repository: check-spelling/git
git version
git version 2.31.1.windows.1
git lfs version
git-lfs/2.13.3 (GitHub; windows amd64; go 1.16.2; git a5e65851)
git init "D:\a\git\git"
Initialized empty Git repository in D:/a/git/git/.git/
git remote add origin https://github.com/check-spelling/git
git config gc.auto 0
git config --get-all http.https://github.com/check-spelling/git.extraheader
git -c http.extraheader="AUTHORIZATION: basic ***" fetch --tags --prune --progress --no-recurse-submodules origin +refs/heads/*:refs/remotes/origin/*
remote: Repository not found.
Error: fatal: repository 'https://github.com/check-spelling/git/' not found
Warning: Git fetch failed with exit code 128, back off 5.447 seconds before retry.
git -c http.extraheader="AUTHORIZATION: basic ***" fetch --tags --prune --progress --no-recurse-submodules origin +refs/heads/*:refs/remotes/origin/*
error: RPC failed; HTTP 404 curl 22 The requested URL returned error: 404
Error: fatal: error reading section header 'shallow-info'
Warning: Git fetch failed with exit code 128, back off 2.088 seconds before retry.
git -c http.extraheader="AUTHORIZATION: basic ***" fetch --tags --prune --progress --no-recurse-submodules origin +refs/heads/*:refs/remotes/origin/*
remote: Repository not found.
Error: fatal: repository 'https://github.com/check-spelling/git/' not found
Error: Git fetch failed with exit code: 128
Error: Exit code 1 returned from process: file name 'c:\runners\2.277.1\bin\Runner.PluginHost.exe', arguments 'action "GitHub.Runner.Plugins.Repository.v1_0.CheckoutTask, Runner.Plugins"'.

🚫 download build artifacts
🚫 extract build artifacts
🚫 download git-sdk-64-minimal
🚫 test

❌ ci/print-test-failures.sh
    - name: ci/print-test-failures.sh
      if: failure()
      shell: powershell
      run: |
        & .\git-sdk-64-minimal\usr\bin\bash.exe -lc ci/print-test-failures.sh
Run & .\git-sdk-64-minimal\usr\bin\bash.exe -lc ci/print-test-failures.sh
& : The term '.\git-sdk-64-minimal\usr\bin\bash.exe' is not recognized as the name of a cmdlet, function, script file, 
or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and 
try again.
At D:\a\_temp\b09e3e86-ad33-476d-ae75-7deb9764dc31.ps1:2 char:3
+ & .\git-sdk-64-minimal\usr\bin\bash.exe -lc ci/print-test-failures.sh
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (.\git-sdk-64-minimal\usr\bin\bash.exe:String) [], ParentContainsErrorRe 
   cordException
    + FullyQualifiedErrorId : CommandNotFoundException
 
Error: Process completed with exit code 1.

The first step (checkout) failed (❌), and thus the next four steps were skipped (🚫). The ci/print-test-failures.sh step has an if: failure() so it will run even though the job is dead (in fact, only because...).

Here's the version of the workflow used:
https://github.com/git/git/blob/0981a071e2e7d229ae547fe8db2875c0e3e38944/.github/workflows/main.yml

I wonder what value is gained by trying to use git-sdk-64-minimal's bash instead of doing shell: bash. I'm pretty sure that azure runners will have bash as well. I'd be shocked by a CI system that supports .github and doesn't support shell: bash.

A quick look at https://github.com/git/git/blob/0981a071e2e7d229ae547fe8db2875c0e3e38944/ci/print-test-failures.sh doesn't seem to show any particular benefit from trying to use the custom bash (which in the case of this run wasn't downloaded).

Admittedly, there's nothing useful to report since nothing actually ran. But this is an error in an error handler, and there's no need for it to error.


I'm not sure why the checkout itself failed. I mean, I can see what it says, but it doesn't particularly make sense to me. I'm puzzled by the pinned choice of actions/checkout@v1 instead of actions/checkout@v2 + with: + fetch-depth: 0 (see actions/checkout#fetch-all-history-for-all-tags-and-branches), but that's an unrelated issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions