{"record":{"id":"1e1d2329cb692929","repo":"nektos/act","slug":"gogitactioncache-failed-to-fetch-s-with-ref-s-at","errorCode":null,"errorMessage":"GoGitActionCache failed to fetch %s with ref %s at %s: %w","messagePattern":"GoGitActionCache failed to fetch (.+?) with ref (.+?) at (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/runner/action_cache.go","lineNumber":82,"sourceCode":"\t\tURLs: []string{\n\t\t\turl,\n\t\t},\n\t})\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"GoGitActionCache failed to create remote %s with ref %s at %s: %w\", url, ref, gitPath, err)\n\t}\n\tdefer func() {\n\t\t_ = gogitrepo.DeleteBranch(branchName)\n\t}()\n\tif err := remote.FetchContext(ctx, &git.FetchOptions{\n\t\tRefSpecs: []config.RefSpec{\n\t\t\tconfig.RefSpec(ref + \":\" + branchName),\n\t\t},\n\t\tAuth:  auth,\n\t\tForce: true,\n\t\tDepth: 1,\n\t}); err != nil {\n\t\treturn \"\", fmt.Errorf(\"GoGitActionCache failed to fetch %s with ref %s at %s: %w\", url, ref, gitPath, err)\n\t}\n\thash, err := gogitrepo.ResolveRevision(plumbing.Revision(branchName))\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"GoGitActionCache failed to resolve sha %s with ref %s at %s: %w\", url, ref, gitPath, err)\n\t}\n\tlogger.Infof(\"GoGitActionCache fetch %s with ref %s at %s resolved to %s\", url, ref, gitPath, hash.String())\n\treturn hash.String(), nil\n}\n\ntype GitFileInfo struct {\n\tname    string\n\tsize    int64\n\tmodTime time.Time\n\tisDir   bool\n\tmode    fs.FileMode\n}\n\n// IsDir implements fs.FileInfo.","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/nektos/act/blob/4f411281417e88660bea1c1a1749aa71ae0bd60f/pkg/runner/action_cache.go#L64-L100","documentation":"Fetch performs remote.FetchContext with a single refspec 'ref -> tmpBranch', force=true, depth=1, optional basic auth from a token. This error wraps any go-git fetch failure: network unreachable, HTTP 401/403/404 from the git host, authentication required, ref not found, or context cancellation.","triggerScenarios":"Private action repo without a token (act -s GITHUB_TOKEN=... missing); wrong/insufficient token; ref does not exist (deleted branch/tag, typo in @ref); no network; proxy blocking HTTPS; GitHub rate-limiting; ctx cancelled during fetch.","commonSituations":"First-time run pulling actions/checkout on a corp network with TLS interception; using a private action without passing GITHUB_TOKEN; referencing a tag that was force-deleted; offline environments.","solutions":["For private actions, pass a token: act -s GITHUB_TOKEN=$(gh auth token).","Verify the ref exists: git ls-remote https://github.com/{owner}/{repo} | grep <ref>.","Check network/proxy: HTTPS_PROXY/HTTPS_CA_INFO settings; ensure github.com is reachable (curl -I https://github.com).","Retry — transient 5xx or rate limits resolve themselves; if cancelled, look for a timeout upstream."],"exampleFix":"# before\nact -j build  # fetch fails: authentication required / repository not found\n\n# after\nact -s GITHUB_TOKEN=\"$(gh auth token)\" -j build","handlingStrategy":"retry","validationCode":"# preflight: can we reach the host and is the token valid?\ncurl -sS -o /dev/null -w '%{http_code}\\n' https://github.com\ngh auth status >/dev/null 2>&1 || echo 'no github token'","typeGuard":null,"tryCatchPattern":"for i in 1 2 3; do act -j build && break || sleep 5; done  # retries transient fetch failures","preventionTips":["Always pass -s GITHUB_TOKEN=$(gh auth token) when private actions are referenced.","Pin refs that exist; verify with git ls-remote.","Configure HTTPS_PROXY/CA env for corporate networks before running act."],"tags":["network","git","auth","act","fetch"],"backgroundTag":null,"analyzedSha":"4f411281417e88660bea1c1a1749aa71ae0bd60f","analyzedAt":"2026-08-15T09:19:46.307Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}