[GH-ISSUE #1885] failed to identify reference (tag/branch) for the checked-out revision #912

Closed
opened 2026-03-01 21:47:22 +03:00 by kerem · 3 comments
Owner

Originally created by @andre15silva on GitHub (Jun 26, 2023).
Original GitHub issue: https://github.com/nektos/act/issues/1885

Bug report info

act version:            0.2.46
GOOS:                   linux
GOARCH:                 amd64
NumCPU:                 128
Docker host:            DOCKER_HOST environment variable is not set
Sockets found:
	/var/run/docker.sock
Config files:
	/home/andre-silva/.actrc:
		-P ubuntu-latest=catthehacker/ubuntu:full-latest
		-P ubuntu-latest=catthehacker/ubuntu:full-20.04
		-P ubuntu-18.04=catthehacker/ubuntu:full-18.04
Build info:
	Go version:            go1.18.10
	Module path:           github.com/nektos/act
	Main version:          (devel)
	Main path:             github.com/nektos/act
	Main checksum:
	Build settings:
		-compiler:            gc
		-ldflags:             -s -w -X main.version=0.2.46 -X main.commit=b0d0cec71f2240fc629dcaa1889ed8c4ad52beb9 -X main.date=2023-06-01T02:39:24Z -X main.builtBy=goreleaser
		CGO_ENABLED:          0
		GOARCH:               amd64
		GOOS:                 linux
		GOAMD64:              v1
		vcs:                  git
		vcs.revision:         b0d0cec71f2240fc629dcaa1889ed8c4ad52beb9
		vcs.time:             2023-06-01T02:39:05Z
		vcs.modified:         false
Docker Engine:
	Engine version:        20.10.21
	Engine runtime:        runc
	Cgroup version:        1
	Cgroup driver:         cgroupfs
	Storage driver:        overlay2
	Registry URI:          https://index.docker.io/v1/
	OS:                    Ubuntu 20.04.6 LTS
	OS type:               linux
	OS version:            20.04
	OS arch:               x86_64
	OS kernel:             5.4.0-146-generic
	OS CPU:                128
	OS memory:             515580 MB
	Security options:
		name=apparmor
		name=seccomp,profile=default

Command used with act

act -P ubuntu-latest=catthehacker/ubuntu:full-latest --bind --pull=false --container-options '-u {os.getuid()}' -v --rm --cache-server-path /tmp/{uuid.uuid4()}

Describe issue

Sometines (not always), when running act in parallel there occur failures in checking out either the repository or some actions (e.g, setup-java, setup-python).

We have tried and this also occurs in older version (0.2.44, 0.2.45), with and without the cache server feature (and using the workaround suggested in https://github.com/nektos/act/issues/1825#issuecomment-1606063316)

https://github.com/Nfsaavedra/crawlergpt-test-repo

Workflow content

name: test
on: [push]
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        
      - name: Setup JDK${{ matrix.java-version }}
        uses: actions/setup-java@v3
        with:
          java-version: 8
          distribution: 'temurin'
            
      - name: Build and run tests
        run: mvn test

Relevant log output

stdout

[DEBUG] executing remote job container: [node /var/run/act/actions/actions-setup-java@v3/dist/cleanup/index.js]
[7cfa0dd0-4522-4e9e-a878-d412f78fe00a/test]   🐳  docker exec cmd=[node /var/run/act/actions/actions-setup-java@v3/dist/cleanup/index.js] user= workdir=
[7cfa0dd0-4522-4e9e-a878-d412f78fe00a/test] [DEBUG] Exec command '[node /var/run/act/actions/actions-setup-java@v3/dist/cleanup/index.js]'
[7cfa0dd0-4522-4e9e-a878-d412f78fe00a/test] [DEBUG] Working directory '/tmp/01649026-bc2d-4827-b9ce-c1719a1626d9'
[7cfa0dd0-4522-4e9e-a878-d412f78fe00a/test]   ✅  Success - Post Setup JDK
[7cfa0dd0-4522-4e9e-a878-d412f78fe00a/test] [DEBUG] skipping post step for 'actions/checkout@v3': no action model available
[7cfa0dd0-4522-4e9e-a878-d412f78fe00a/test] [DEBUG] Removed container: 768da5a678a609a6dff400dafbaf92b5c59b4efb5f952ad2ee03742033c79499
[7cfa0dd0-4522-4e9e-a878-d412f78fe00a/test] [DEBUG]   🐳  docker volume rm act-7cfa0dd0-4522-4e9e-a878-d412f78fe00a-test-3d0c43acad5aea917fd27c1680375781e3cb8b2ece65197f633f1056adb5edb9-env
[7cfa0dd0-4522-4e9e-a878-d412f78fe00a/test] 🏁  Job failed
[7cfa0dd0-4522-4e9e-a878-d412f78fe00a/test] [DEBUG] Loading revision from git directory
[7cfa0dd0-4522-4e9e-a878-d412f78fe00a/test] [DEBUG] Found revision: 5871e6f8f072b4b3e07d4753c55c6c6302419b1e
[7cfa0dd0-4522-4e9e-a878-d412f78fe00a/test] [DEBUG] HEAD points to '5871e6f8f072b4b3e07d4753c55c6c6302419b1e'
[7cfa0dd0-4522-4e9e-a878-d412f78fe00a/test] unable to get git ref: failed to identify reference (tag/branch) for the checked-out revision '5871e6f8f072b4b3e07d4753c55c6c6302419b1e'
[7cfa0dd0-4522-4e9e-a878-d412f78fe00a/test] [DEBUG] Found revision: 5871e6f8f072b4b3e07d4753c55c6c6302419b1e


stderr

time=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"Loading environment from /tmp/01649026-bc2d-4827-b9ce-c1719a1626d9/.env\"
time=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"Loading action inputs from /tmp/01649026-bc2d-4827-b9ce-c1719a1626d9/.input\"
time=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"Loading secrets from /tmp/01649026-bc2d-4827-b9ce-c1719a1626d9/.secrets\"
time=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"Conditional GET for notices etag=4bd065a2-f056-4b52-82b1-b5c71f0213a7\"
time=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"Evaluated matrix inclusions: map[]\"
time=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"Loading workflow '/tmp/01649026-bc2d-4827-b9ce-c1719a1626d9/.github/workflows/tests-crawler.yml'\"
time=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"Reading workflow '/tmp/01649026-bc2d-4827-b9ce-c1719a1626d9/.github/workflows/tests-crawler.yml'\"
time=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"Preparing plan with all jobs\"
time=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"Using the only detected workflow event: push\"
time=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"Planning jobs for event: push\"\ntime=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"gc: 2023-06-26 10:01:01.083276234 +0200 CEST m=+0.014729264\" module=artifactcache
time=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"Final matrix after applying user inclusions '[map[]]'\"
time=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"Loading revision from git directory\"\ntime=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"Found revision: 5871e6f8f072b4b3e07d4753c55c6c6302419b1e\"
time=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"HEAD points to '5871e6f8f072b4b3e07d4753c55c6c6302419b1e'\"
time=\"2023-06-26T10:01:01+02:00\" level=warning msg=\"unable to get git ref: failed to identify reference (tag/branch) for the checked-out revision '5871e6f8f072b4b3e07d4753c55c6c6302419b1e'\"
time=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"Found revision: 5871e6f8f072b4b3e07d4753c55c6c6302419b1e\"
time=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"Saving notices etag=4bd065a2-f056-4b52-82b1-b5c71f0213a7\"
time=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"No new notices\"
Error: Job 'test' failed\n

Additional information

No response

Originally created by @andre15silva on GitHub (Jun 26, 2023). Original GitHub issue: https://github.com/nektos/act/issues/1885 ### Bug report info ```plain text act version: 0.2.46 GOOS: linux GOARCH: amd64 NumCPU: 128 Docker host: DOCKER_HOST environment variable is not set Sockets found: /var/run/docker.sock Config files: /home/andre-silva/.actrc: -P ubuntu-latest=catthehacker/ubuntu:full-latest -P ubuntu-latest=catthehacker/ubuntu:full-20.04 -P ubuntu-18.04=catthehacker/ubuntu:full-18.04 Build info: Go version: go1.18.10 Module path: github.com/nektos/act Main version: (devel) Main path: github.com/nektos/act Main checksum: Build settings: -compiler: gc -ldflags: -s -w -X main.version=0.2.46 -X main.commit=b0d0cec71f2240fc629dcaa1889ed8c4ad52beb9 -X main.date=2023-06-01T02:39:24Z -X main.builtBy=goreleaser CGO_ENABLED: 0 GOARCH: amd64 GOOS: linux GOAMD64: v1 vcs: git vcs.revision: b0d0cec71f2240fc629dcaa1889ed8c4ad52beb9 vcs.time: 2023-06-01T02:39:05Z vcs.modified: false Docker Engine: Engine version: 20.10.21 Engine runtime: runc Cgroup version: 1 Cgroup driver: cgroupfs Storage driver: overlay2 Registry URI: https://index.docker.io/v1/ OS: Ubuntu 20.04.6 LTS OS type: linux OS version: 20.04 OS arch: x86_64 OS kernel: 5.4.0-146-generic OS CPU: 128 OS memory: 515580 MB Security options: name=apparmor name=seccomp,profile=default ``` ### Command used with act ```sh act -P ubuntu-latest=catthehacker/ubuntu:full-latest --bind --pull=false --container-options '-u {os.getuid()}' -v --rm --cache-server-path /tmp/{uuid.uuid4()} ``` ### Describe issue Sometines (not always), when running `act` in parallel there occur failures in checking out either the repository or some actions (e.g, `setup-java`, `setup-python`). We have tried and this also occurs in older version (`0.2.44`, `0.2.45`), with and without the cache server feature (and using the workaround suggested in https://github.com/nektos/act/issues/1825#issuecomment-1606063316) ### Link to GitHub repository https://github.com/Nfsaavedra/crawlergpt-test-repo ### Workflow content ```yml name: test on: [push] jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Setup JDK${{ matrix.java-version }} uses: actions/setup-java@v3 with: java-version: 8 distribution: 'temurin' - name: Build and run tests run: mvn test ``` ### Relevant log output ```sh stdout [DEBUG] executing remote job container: [node /var/run/act/actions/actions-setup-java@v3/dist/cleanup/index.js] [7cfa0dd0-4522-4e9e-a878-d412f78fe00a/test] 🐳 docker exec cmd=[node /var/run/act/actions/actions-setup-java@v3/dist/cleanup/index.js] user= workdir= [7cfa0dd0-4522-4e9e-a878-d412f78fe00a/test] [DEBUG] Exec command '[node /var/run/act/actions/actions-setup-java@v3/dist/cleanup/index.js]' [7cfa0dd0-4522-4e9e-a878-d412f78fe00a/test] [DEBUG] Working directory '/tmp/01649026-bc2d-4827-b9ce-c1719a1626d9' [7cfa0dd0-4522-4e9e-a878-d412f78fe00a/test] ✅ Success - Post Setup JDK [7cfa0dd0-4522-4e9e-a878-d412f78fe00a/test] [DEBUG] skipping post step for 'actions/checkout@v3': no action model available [7cfa0dd0-4522-4e9e-a878-d412f78fe00a/test] [DEBUG] Removed container: 768da5a678a609a6dff400dafbaf92b5c59b4efb5f952ad2ee03742033c79499 [7cfa0dd0-4522-4e9e-a878-d412f78fe00a/test] [DEBUG] 🐳 docker volume rm act-7cfa0dd0-4522-4e9e-a878-d412f78fe00a-test-3d0c43acad5aea917fd27c1680375781e3cb8b2ece65197f633f1056adb5edb9-env [7cfa0dd0-4522-4e9e-a878-d412f78fe00a/test] 🏁 Job failed [7cfa0dd0-4522-4e9e-a878-d412f78fe00a/test] [DEBUG] Loading revision from git directory [7cfa0dd0-4522-4e9e-a878-d412f78fe00a/test] [DEBUG] Found revision: 5871e6f8f072b4b3e07d4753c55c6c6302419b1e [7cfa0dd0-4522-4e9e-a878-d412f78fe00a/test] [DEBUG] HEAD points to '5871e6f8f072b4b3e07d4753c55c6c6302419b1e' [7cfa0dd0-4522-4e9e-a878-d412f78fe00a/test] unable to get git ref: failed to identify reference (tag/branch) for the checked-out revision '5871e6f8f072b4b3e07d4753c55c6c6302419b1e' [7cfa0dd0-4522-4e9e-a878-d412f78fe00a/test] [DEBUG] Found revision: 5871e6f8f072b4b3e07d4753c55c6c6302419b1e stderr time=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"Loading environment from /tmp/01649026-bc2d-4827-b9ce-c1719a1626d9/.env\" time=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"Loading action inputs from /tmp/01649026-bc2d-4827-b9ce-c1719a1626d9/.input\" time=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"Loading secrets from /tmp/01649026-bc2d-4827-b9ce-c1719a1626d9/.secrets\" time=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"Conditional GET for notices etag=4bd065a2-f056-4b52-82b1-b5c71f0213a7\" time=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"Evaluated matrix inclusions: map[]\" time=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"Loading workflow '/tmp/01649026-bc2d-4827-b9ce-c1719a1626d9/.github/workflows/tests-crawler.yml'\" time=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"Reading workflow '/tmp/01649026-bc2d-4827-b9ce-c1719a1626d9/.github/workflows/tests-crawler.yml'\" time=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"Preparing plan with all jobs\" time=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"Using the only detected workflow event: push\" time=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"Planning jobs for event: push\"\ntime=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"gc: 2023-06-26 10:01:01.083276234 +0200 CEST m=+0.014729264\" module=artifactcache time=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"Final matrix after applying user inclusions '[map[]]'\" time=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"Loading revision from git directory\"\ntime=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"Found revision: 5871e6f8f072b4b3e07d4753c55c6c6302419b1e\" time=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"HEAD points to '5871e6f8f072b4b3e07d4753c55c6c6302419b1e'\" time=\"2023-06-26T10:01:01+02:00\" level=warning msg=\"unable to get git ref: failed to identify reference (tag/branch) for the checked-out revision '5871e6f8f072b4b3e07d4753c55c6c6302419b1e'\" time=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"Found revision: 5871e6f8f072b4b3e07d4753c55c6c6302419b1e\" time=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"Saving notices etag=4bd065a2-f056-4b52-82b1-b5c71f0213a7\" time=\"2023-06-26T10:01:01+02:00\" level=debug msg=\"No new notices\" Error: Job 'test' failed\n ``` ### Additional information _No response_
kerem 2026-03-01 21:47:22 +03:00
  • closed this issue
  • added the
    kind/bug
    label
Author
Owner

@andre15silva commented on GitHub (Jun 26, 2023):

I have tried with setting a random artifact server path with a random port (0) for each execution, but still face the same issue sometimes:

Start server on http://130.242.72.40:0\"
time=\"2023-06-26T16:40:34+02:00\" level=warning msg=\"unable to get git ref: failed to identify reference (tag/branch) for the checked-out revision 'cad6744850817b708400736678d2601cbd1c1dd6'\"
Error: unexpected EOF
<!-- gh-comment-id:1607744658 --> @andre15silva commented on GitHub (Jun 26, 2023): I have tried with setting a random artifact server path with a random port (`0`) for each execution, but still face the same issue sometimes: ``` Start server on http://130.242.72.40:0\" time=\"2023-06-26T16:40:34+02:00\" level=warning msg=\"unable to get git ref: failed to identify reference (tag/branch) for the checked-out revision 'cad6744850817b708400736678d2601cbd1c1dd6'\" Error: unexpected EOF ```
Author
Owner

@ChristopherHX commented on GitHub (Jun 26, 2023):

when running act in parallel there occur failures in ... some actions (e.g, setup-java, setup-python).

Yes, act's git actions download cache isn't process / thread safe. I confirm this defect.

  • joba - checks revision A out (uses git file locks)
  • joba - copies the action content into the container A (access without file locks), while jobb - checks revision B out (uses git file locks)
  • jobb - copies the action content into the container B (access without file locks)

If an action has no update available this problem doesn't appear after one job has cached the action.

Error: unexpected EOF

Wait who returns this error?

failed to identify reference (tag/branch) for the checked-out revision

This is a warning. The function logging this message can not return any error.

"Relevant log output", I have a different opinion about how relevant the missing part of your log is. It misses why "Error: Job 'test' failed" has been returned, might has not been logged.

Or is the bug report because of a warning?

<!-- gh-comment-id:1608105452 --> @ChristopherHX commented on GitHub (Jun 26, 2023): > when running act in parallel there occur failures in ... some actions (e.g, setup-java, setup-python). Yes, act's git actions download cache isn't process / thread safe. I confirm this defect. - joba - checks revision A out (uses git file locks) - joba - copies the action content into the container A (access without file locks), while jobb - checks revision B out (uses git file locks) - jobb - copies the action content into the container B (access without file locks) If an action has no update available this problem doesn't appear after one job has cached the action. > Error: unexpected EOF Wait who returns this error? > failed to identify reference (tag/branch) for the checked-out revision This is a warning. The function logging this message can not return any error. "Relevant log output", I have a different opinion about how relevant the missing part of your log is. It misses why "Error: Job 'test' failed" has been returned, might has not been logged. Or is the bug report because of a warning?
Author
Owner

@andre15silva commented on GitHub (Jun 29, 2023):

Hi @ChristopherHX ,

Thanks a lot! Indeed, this was the problem. We didn't realize that the option --cache-server-path would not set a different cache directory (as one can do by setting XDG_CACHE_HOME or using the new option introduced in https://github.com/nektos/act/pull/1863).

Now that we have a different action cache directory for each worker it runs without any issue :))

Regarding the other errors, we noticed that we also had a bug in our code that could end up with two distinct act runs on the same repository/working directory (but on different commits). This was likely the cause of the checkout errors/warnings at the repository level. Now that we have fixed it we don't observe them anymore.

<!-- gh-comment-id:1612656750 --> @andre15silva commented on GitHub (Jun 29, 2023): Hi @ChristopherHX , Thanks a lot! Indeed, this was the problem. We didn't realize that the option `--cache-server-path` would not set a different cache directory (as one can do by setting `XDG_CACHE_HOME` or using the new option introduced in https://github.com/nektos/act/pull/1863). Now that we have a different action cache directory for each worker it runs without any issue :)) Regarding the other errors, we noticed that we also had a bug in our code that could end up with two distinct `act` runs on the same repository/working directory (but on different commits). This was likely the cause of the checkout errors/warnings at the repository level. Now that we have fixed it we don't observe them anymore.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#912
No description provided.