{"record":{"id":"ec39eb53f8e76ffa","repo":"nektos/act","slug":"gogitactioncache-failed-to-open-git-tree-s-with-s","errorCode":null,"errorMessage":"GoGitActionCache failed to open git tree %s with sha %s subpath '%s' at %s: %w","messagePattern":"GoGitActionCache failed to open git tree (.+?) with sha (.+?) subpath '(.+?)' at (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/runner/action_cache.go","lineNumber":147,"sourceCode":"\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 {\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)","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/nektos/act/blob/4f411281417e88660bea1c1a1749aa71ae0bd60f/pkg/runner/action_cache.go#L129-L165","documentation":"After loading the commit, GetTarArchive reads its root tree with commit.Tree(). This wraps a go-git object-read failure for the tree: the commit object exists but its tree object is missing from the (shallow, depth=1) object database, or the object store is corrupt — distinct from loading the commit itself.","triggerScenarios":"Shallow fetch stored the commit but not its tree (partial fetch interrupted after commit arrival), corrupt loose/pack objects in the bare cache, or object pruning removed the tree.","commonSituations":"Interrupted (Ctrl-C / OOM-killed) act run leaving half-populated objects; disk-full during fetch; cache written on one act version and read by an incompatible go-git version.","solutions":["Wipe the cache repo named in the error: rm -rf <gitPath>, then re-run.","Check disk space on the cache volume (df -h) — ENOSPC during fetch produces truncated object stores.","Upgrade act so the go-git version writing and reading the cache matches.","If persistent, move the cache: act --action-cache-path /new/dir."],"exampleFix":"# before\nact  # failed to open git tree ... object not found\n\n# after\nrm -rf ~/.cache/act && act","handlingStrategy":"fallback","validationCode":"git --git-dir=\"$HOME/.cache/act/<cache-name>.git\" fsck --no-dangling 2>&1 | head -5  # spot corrupt objects before running","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not kill act mid-fetch; let 'GoGitActionCache fetch' log lines finish.","Keep the act version constant while reusing a cache dir.","Free disk space and wipe cache after ENOSPC events."],"tags":["git","cache","corruption","act"],"backgroundTag":null,"analyzedSha":"4f411281417e88660bea1c1a1749aa71ae0bd60f","analyzedAt":"2026-08-15T09:19:46.307Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}