nektos / act

Run your GitHub Actions locally šŸš€
https://nektosact.com
MIT License
54.78k stars 1.37k forks source link

Hangs at end of `actions/checkout@v2` after git fetch #1269

Closed AndrewSouthpaw closed 2 years ago

AndrewSouthpaw commented 2 years ago

Bug report info

$ act --bug-report
act version:            0.2.26
GOOS:                   darwin
GOARCH:                 arm64
NumCPU:                 10
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
    /var/run/docker.sock
Config files:
    /Users/andrew/.actrc:
        -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest
        -P ubuntu-20.04=ghcr.io/catthehacker/ubuntu:act-20.04
        -P ubuntu-18.04=ghcr.io/catthehacker/ubuntu:act-18.04
Docker Engine:
    Engine version:        20.10.17
    Engine runtime:        runc
    Cgroup version:        2
    Cgroup driver:         cgroupfs
    Storage driver:        overlay2
    Registry URI:          https://index.docker.io/v1/
    OS:                    Docker Desktop
    OS type:               linux
    OS version:
    OS arch:               aarch64
    OS kernel:             5.10.104-linuxkit
    OS CPU:                2
    OS memory:             7951 MB
    Security options:
        name=seccomp,profile=default
        name=cgroupns

Command used with act

act -j test -e pullRequest.json --container-architecture linux/amd64 -s GITHUB_TOKEN=...

Describe issue

It gets to the end of the checkout, completes the git fetch, and hangs. Didn't respond to ^C, had to manually kill it from docker desktop.

Link to GitHub repository

No response

Workflow content

jobs:
  test:
    name: Run tests
    runs-on: ubuntu-latest
    steps:
      - run: echo hello world
      - uses: actions/checkout@v2
        with:
          ref: ${{ github.event.pull_request.head.sha }}
      - uses: actions/setup-node@v2
        with:
          node-version: 14.17.6
          cache: npm

Relevant log output

[Test/Run tests] ā­  Run actions/checkout@v2
[Test/Run tests]   ā˜  git clone 'https://github.com/actions/checkout' # ref=v2
[Test/Run tests]   šŸ³  docker cp src=/Users/andrew/.cache/act/actions-checkout@v2/ dst=/var/run/act/actions/actions-checkout@v2/
[Test/Run tests]   šŸ³  docker exec cmd=[mkdir -p /var/run/act/actions/actions-checkout@v2/] user= workdir=
[Test/Run tests]   šŸ³  docker exec cmd=[node /var/run/act/actions/actions-checkout@v2/dist/index.js] user= workdir=
[Test/Run tests]   ā“  ::save-state name=isPost::true
[Test/Run tests]   šŸ’¬  ::debug::GITHUB_WORKSPACE = '/Users/andrew/Projects/gather-town'
[Test/Run tests]   šŸ’¬  ::debug::qualified repository = ...
[Test/Run tests]   šŸ’¬  ::debug::ref = 'refs/heads/andrew/eng-4904-local-dev'
[Test/Run tests]   šŸ’¬  ::debug::commit = ...
[Test/Run tests]   šŸ’¬  ::debug::clean = true
[Test/Run tests]   šŸ’¬  ::debug::fetch depth = 1
[Test/Run tests]   šŸ’¬  ::debug::lfs = false
[Test/Run tests]   šŸ’¬  ::debug::submodules = false
[Test/Run tests]   šŸ’¬  ::debug::recursive submodules = false
[Test/Run tests]   šŸ’¬  ::debug::Repository owner ID not found within GITHUB event info
[Test/Run tests]   ā“  ::add-matcher::/run/act/actions/actions-checkout@v2/dist/problem-matcher.json
| Syncing repository: gathertown/gather-town
[Test/Run tests]   ā“  ::group::Getting Git version info
| Working directory is '/Users/andrew/Projects/gather-town'
[Test/Run tests]   šŸ’¬  ::debug::Getting git version
| [command]/usr/bin/git version
| git version 2.37.1
[Test/Run tests]   šŸ’¬  ::debug::Set git useragent to: git/2.37.1 (github-actions-checkout)
[Test/Run tests]   ā“  ::endgroup::
[Test/Run tests]   āš™  ***
| Temporarily overriding HOME='/tmp/c1d6a46e-a2d6-44db-8aaa-a713453687fb' before making global git config changes
| Adding repository directory to the temporary git global config as a safe directory
| [command]/usr/bin/git config --global --add safe.directory /Users/andrew/Projects/gather-town
[Test/Run tests]   ā“  ::save-state name=setSafeDirectory::true
| Deleting the contents of '/Users/andrew/Projects/gather-town'
[Test/Run tests]   ā“  ::save-state name=repositoryPath::/Users/andrew/Projects/gather-town
[Test/Run tests]   ā“  ::group::Initializing the repository
| [command]/usr/bin/git init /Users/andrew/Projects/gather-town
| hint: Using 'master' as the name for the initial branch. This default branch name
| hint: is subject to change. To configure the initial branch name to use in all
| hint: of your new repositories, which will suppress this warning, call:
| hint:
| hint:     git config --global init.defaultBranch <name>
| hint:
| hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
| hint: 'development'. The just-created branch can be renamed via this command:
| hint:
| hint:     git branch -m <name>
| Initialized empty Git repository in /Users/andrew/Projects/gather-town/.git/
| [command]/usr/bin/git remote add origin https://github.com/gathertown/gather-town
[Test/Run tests]   ā“  ::endgroup::
[Test/Run tests]   ā“  ::group::Disabling automatic garbage collection
| [command]/usr/bin/git config --local gc.auto 0
[Test/Run tests]   ā“  ::endgroup::
[Test/Run tests]   ā“  ::group::Setting up auth
| [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
| [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :
| [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
| [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :
| [command]/usr/bin/git config --local http.https://github.com/.extraheader AUTHORIZATION: basic ***
[Test/Run tests]   ā“  ::endgroup::
[Test/Run tests]   ā“  ::group::Fetching the repository
| [command]/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +...
| remote: Enumerating objects: 4870, done.
remote: Counting objects: 100% (4870/4870), done.
remote: Compressing objects: 100% (4405/4405), done.
[hangs]

Additional information

No response

AndrewSouthpaw commented 2 years ago

I tried this again a couple weeks later and it's working again. Maybe my computer was just having a day. šŸ¤·šŸ¼ā€ā™‚ļø

dhaval-dhanani-coforge commented 1 year ago

Can we reopen? I am facing same issue.

andrewvaughan commented 1 year ago

Just adding that I've run into this, as well - there's not a lot of data in verbose logs that's very helpful. I can't tell if it's an issue on the GitHub server or with the client.

Even after failing, it hangs, which makes me think it's an odd quirk in act and not a server issue:

...

[Issue Progress on Branch Created/Label Issue on Branch Create]   šŸ’¬  ::debug::fetch tags = false
[Issue Progress on Branch Created/Label Issue on Branch Create]   šŸ’¬  ::debug::lfs = false
[Issue Progress on Branch Created/Label Issue on Branch Create]   šŸ’¬  ::debug::submodules = false
[Issue Progress on Branch Created/Label Issue on Branch Create]   šŸ’¬  ::debug::recursive submodules = false
[Issue Progress on Branch Created/Label Issue on Branch Create]   ā—  ::error::Input required and not supplied: token
[Issue Progress on Branch Created/Label Issue on Branch Create]   āŒ  Failure - Main Checking out repository

...hangs...

I actually have to go kill the docker container because I can't even CTL+C out.

Edit:

I think this is happening because I have my SSH key managed by a password manager. Usually when I clone an SSH repository, 1Password pops up for me to authenticate. I have a feeling this may be causing some issues. I'll update here if I find more in case someone finds this as a top search result like I did.