nektos/act · error
GoGitActionCache failed to open bare git %s with ref %s at %
Error message
GoGitActionCache failed to open bare git %s with ref %s at %s: %w
What it means
GoGitActionCache.Fetch (pkg/runner/action_cache.go) maintains bare git repos under c.Path named safeFilename(cacheDir)+".git". It first tries git.PlainInit(gitPath, true) to create a bare repo; if the repo already exists it opens it with git.PlainOpen. This error wraps failure of BOTH calls: PlainInit failed with something other than ErrRepositoryAlreadyExists (permissions, disk full, invalid path) or PlainOpen failed on an existing but corrupt directory.
Source
Thrown at pkg/runner/action_cache.go:47
type GoGitActionCache struct {
Path string
}
func (c GoGitActionCache) Fetch(ctx context.Context, cacheDir, url, ref, token string) (string, error) {
logger := common.Logger(ctx)
gitPath := path.Join(c.Path, safeFilename(cacheDir)+".git")
logger.Infof("GoGitActionCache fetch %s with ref %s at %s", url, ref, gitPath)
gogitrepo, err := git.PlainInit(gitPath, true)
if errors.Is(err, git.ErrRepositoryAlreadyExists) {
logger.Debugf("GoGitActionCache cache hit %s with ref %s at %s", url, ref, gitPath)
gogitrepo, err = git.PlainOpen(gitPath)
}
if err != nil {
return "", fmt.Errorf("GoGitActionCache failed to open bare git %s with ref %s at %s: %w", url, ref, gitPath, err)
}
tmpBranch := make([]byte, 12)
if _, err := rand.Read(tmpBranch); err != nil {
return "", fmt.Errorf("GoGitActionCache failed to generate random tmp branch %s with ref %s at %s: %w", url, ref, gitPath, err)
}
branchName := hex.EncodeToString(tmpBranch)
var auth transport.AuthMethod
if token != "" {
auth = &http.BasicAuth{
Username: "token",
Password: token,
}
}
remote, err := gogitrepo.CreateRemoteAnonymous(&config.RemoteConfig{
Name: "anonymous",
URLs: []string{
url,View on GitHub (pinned to 4f41128141)
Solutions
- Delete the specific corrupt cache repo printed in the error path (the '<...>.git' directory), or the whole cache: rm -rf ~/.cache/act.
- Fix permissions: chown -R $(id -u):$(id -g) ~/.cache/act && chmod -R u+rwX ~/.cache/act.
- Point act at a writable cache: act --action-cache-path /path/to/writable/dir.
- Check disk space (df -h) and filesystem permissions on the parent of the cache path.
Example fix
# before act # error: GoGitActionCache failed to open bare git ... : repository does not exist / permission denied # after rm -rf ~/.cache/act act --action-cache-path "$HOME/.cache/act"
Defensive patterns
Strategy: validation
Validate before calling
CACHE="${ACT_CACHE_PATH:-$HOME/.cache/act}"
[ -w "$CACHE" ] || { echo "cache dir not writable: $CACHE"; exit 1; }
# detect corrupt bare repos: a valid one has HEAD and objects/
for d in "$CACHE"/*.git; do [ -f "$d/HEAD" ] || { echo "corrupt: $d"; exit 1; }; done Prevention
- Use a dedicated writable --action-cache-path per environment/user.
- Clean ~/.cache/act after interrupted runs.
- Ensure consistent ownership of the cache directory across act invocations.
When it happens
Trigger: The host cache directory (~/.cache/act by default, or --action-cache-path) has wrong ownership/permissions, is on a read-only filesystem, is full, or contains a corrupt/partially-created *.git directory from a previously interrupted run.
Common situations: Running act as a different user than the one that created ~/.cache/act; a killed act process left a half-initialized bare repo; Docker desktop VM file mapping issues; SELinux/AppArmor denial on the cache path.
Related errors
- GoGitActionCache failed to resolve sha %s with ref %s at %s:
- GoGitActionCache failed to open bare git %s with sha %s subp
- GoGitActionCache failed to get commit %s with sha %s subpath
- GoGitActionCache failed to open git tree %s with sha %s subp
- GoGitActionCache failed to list files %s with sha %s subpath
AI-assisted analysis of nektos/act@4f41128141 (2026-08-15).
Data as JSON: /api/errors/fb7551a03fee6a96.
Report an issue: GitHub.