{"record":{"id":"ac7fc10c3281d638","repo":"nektos/act","slug":"gogitactioncache-failed-to-open-bare-git-s-with-s","errorCode":null,"errorMessage":"GoGitActionCache failed to open bare git %s with sha %s subpath '%s' at %s: %w","messagePattern":"GoGitActionCache failed to open bare git (.+?) with sha (.+?) subpath '(.+?)' at (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/runner/action_cache.go","lineNumber":139,"sourceCode":"func (g *GitFileInfo) Size() int64 {\n\treturn g.size\n}\n\n// Sys implements fs.FileInfo.\nfunc (g *GitFileInfo) Sys() any {\n\treturn nil\n}\n\nfunc (c GoGitActionCache) GetTarArchive(ctx context.Context, cacheDir, sha, includePrefix string) (io.ReadCloser, error) {\n\tlogger := common.Logger(ctx)\n\n\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 {","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/nektos/act/blob/4f411281417e88660bea1c1a1749aa71ae0bd60f/pkg/runner/action_cache.go#L121-L157","documentation":"GetTarArchive opens the previously created bare cache repo with git.PlainOpen(gitPath) to stream the action's files as a tar. This error wraps failure to open that bare repo: it does not exist (Fetch never ran or cache was wiped between fetch and materialize) or the directory exists but is not a valid git repository.","triggerScenarios":"The *.git cache directory was deleted (concurrent 'rm -rf ~/.cache/act', another act run cleaning up) between the Fetch phase and GetTarArchive; or a partial/corrupt directory is present so PlainOpen fails with repository does not exist.","commonSituations":"Two act processes sharing one cache path with one pruning it; disk-cleanup cron jobs removing the cache mid-run; a previously crashed run leaving a directory without a valid HEAD/objects layout.","solutions":["Re-run the job after clearing the cache entirely: rm -rf ~/.cache/act (stale state is rebuilt).","Give each concurrent act run its own cache: act --action-cache-path /tmp/cache-$$ per instance.","Exclude the act cache dir from disk-cleanup jobs (nohup scripts, Docker image prunes touching volumes).","Verify the printed gitPath exists and contains HEAD/config/objects after a run: ls <gitPath>."],"exampleFix":"# before\nrm -rf ~/.cache/act & act -j build   # racing cleanup\n\n# after\nact --action-cache-path /tmp/act-cache-a -j build   # isolated cache per run","handlingStrategy":"validation","validationCode":"for d in \"$HOME/.cache/act\"/*.git; do git --git-dir=\"$d\" rev-parse --is-bare-repository >/dev/null 2>&1 || echo \"corrupt cache repo: $d\"; done","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Give concurrent act runs separate --action-cache-path values.","Exclude the act cache from cleanup cron jobs.","After a crashed run, wipe the cache before the next run."],"tags":["git","cache","concurrency","act"],"backgroundTag":null,"analyzedSha":"4f411281417e88660bea1c1a1749aa71ae0bd60f","analyzedAt":"2026-08-15T09:19:46.307Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}