{"record":{"id":"aff8be6769bae27d","repo":"nektos/act","slug":"gogitactioncache-failed-to-list-files-s-with-sha","errorCode":null,"errorMessage":"GoGitActionCache failed to list files %s with sha %s subpath '%s' at %s: %w","messagePattern":"GoGitActionCache failed to list files (.+?) with sha (.+?) subpath '(.+?)' at (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/runner/action_cache.go","lineNumber":151,"sourceCode":"\tgitPath := path.Join(c.Path, safeFilename(cacheDir)+\".git\")\n\n\tlogger.Infof(\"GoGitActionCache get content %s with sha %s subpath '%s' at %s\", cacheDir, sha, includePrefix, gitPath)\n\n\tgogitrepo, err := git.PlainOpen(gitPath)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"GoGitActionCache failed to open bare git %s with sha %s subpath '%s' at %s: %w\", cacheDir, sha, includePrefix, gitPath, err)\n\t}\n\tcommit, err := gogitrepo.CommitObject(plumbing.NewHash(sha))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"GoGitActionCache failed to get commit %s with sha %s subpath '%s' at %s: %w\", cacheDir, sha, includePrefix, gitPath, err)\n\t}\n\tt, err := commit.Tree()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"GoGitActionCache failed to open git tree %s with sha %s subpath '%s' at %s: %w\", cacheDir, sha, includePrefix, gitPath, err)\n\t}\n\tfiles, err := commit.Files()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"GoGitActionCache failed to list files %s with sha %s subpath '%s' at %s: %w\", cacheDir, sha, includePrefix, gitPath, err)\n\t}\n\trpipe, wpipe := io.Pipe()\n\t// Interrupt io.Copy using ctx\n\tch := make(chan int, 1)\n\tgo func() {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\twpipe.CloseWithError(ctx.Err())\n\t\tcase <-ch:\n\t\t}\n\t}()\n\tgo func() {\n\t\tdefer wpipe.Close()\n\t\tdefer close(ch)\n\t\ttw := tar.NewWriter(wpipe)\n\t\tcleanIncludePrefix := path.Clean(includePrefix)\n\t\twpipe.CloseWithError(files.ForEach(func(f *object.File) error {\n\t\t\treturn actionCacheCopyFileOrDir(ctx, cleanIncludePrefix, t, tw, f.Name, f)","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/nektos/act/blob/4f411281417e88660bea1c1a1749aa71ae0bd60f/pkg/runner/action_cache.go#L133-L169","documentation":"GetTarArchive then calls commit.Files() to enumerate the tree's files. This wraps failure starting that file iterator — again object-store level: blobs/trees referenced by the commit are missing or unreadable in the bare cache repo (shallow/partial/corrupt object database).","triggerScenarios":"Same class as the tree error but hit while walking nested subtrees: a subdirectory tree object absent from the depth=1 fetch, corrupt packfile, or permission error reading objects/ under the cache path.","commonSituations":"Interrupted fetch; permissions changed on ~/.cache/act (different user later runs act); cache migrated between machines/filesystems with lost files.","solutions":["Delete and rebuild the cache: rm -rf <gitPath> (or all of ~/.cache/act) and re-run.","Fix ownership/permissions of the cache tree: chown -R $(id -u):$(id -g) ~/.cache/act.","Ensure the fetch phase completes without interruption (avoid Ctrl-C during 'fetching' log lines).","Use a fresh --action-cache-path if the old path is on flaky storage."],"exampleFix":"# before\nact  # failed to list files ... object not found\n\n# after\nrm -rf ~/.cache/act && act","handlingStrategy":"fallback","validationCode":"git --git-dir=\"$HOME/.cache/act/<cache-name>.git\" fsck 2>&1 | grep -q 'missing\\|corrupt' && rm -rf \"$HOME/.cache/act/<cache-name>.git\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Maintain consistent ownership/permissions on ~/.cache/act.","Wipe cache after interrupted or disk-full runs.","Do not copy cache dirs between machines with truncating filesystems."],"tags":["git","cache","objects","act"],"backgroundTag":null,"analyzedSha":"4f411281417e88660bea1c1a1749aa71ae0bd60f","analyzedAt":"2026-08-15T09:19:46.307Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}