{"record":{"id":"05fc6983655373c6","repo":"GoogleContainerTools/skaffold","slug":"config-remote-repo-cache-not-found-err-05fc69","errorCode":"CONFIG_REMOTE_REPO_CACHE_NOT_FOUND_ERR","errorMessage":"cache directory %q for repository %q at ref %q does not exist, and repository sync is explicitly disabled via flag `--sync-remote-cache`","messagePattern":"cache directory %q for repository %q at ref %q does not exist, and repository sync is explicitly disabled via flag `--sync-remote-cache`","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/git/errors.go","lineNumber":30,"sourceCode":"WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\npackage git\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\n\tsErrors \"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/errors\"\n\t\"github.com/GoogleContainerTools/skaffold/v2/proto/v1\"\n)\n\n// SyncDisabledErr returns error when git repository sync is turned off by the user but the repository clone doesn't exist inside the cache directory.\nfunc SyncDisabledErr(g Config, repoCacheDir string) error {\n\tmsg := fmt.Sprintf(\"cache directory %q for repository %q at ref %q does not exist, and repository sync is explicitly disabled via flag `--sync-remote-cache`\", repoCacheDir, g.Repo, g.Ref)\n\treturn sErrors.NewError(errors.New(msg),\n\t\t&proto.ActionableErr{\n\t\t\tMessage: msg,\n\t\t\tErrCode: proto.StatusCode_CONFIG_REMOTE_REPO_CACHE_NOT_FOUND_ERR,\n\t\t\tSuggestions: []*proto.Suggestion{\n\t\t\t\t{\n\t\t\t\t\tSuggestionCode: proto.SuggestionCode_CONFIG_ENABLE_REMOTE_REPO_SYNC,\n\t\t\t\t\tAction:         fmt.Sprintf(\"Either clone the repository manually inside %q, or set flag `--sync-remote-cache` to `always` or `missing`\", repoCacheDir),\n\t\t\t\t},\n\t\t\t},\n\t\t})\n}\n","sourceCodeStart":12,"sourceCodeEnd":42,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/git/errors.go#L12-L42","documentation":"The git dependency handler mirrors the GCS behavior: SyncDisabledErr is returned by syncRepo when the user disabled repository sync (--sync-remote-cache=false) but the cloned repository cache directory for the given repo and ref does not exist. The error carries code CONFIG_REMOTE_REPO_CACHE_NOT_FOUND_ERR and suggests enabling remote sync.","triggerScenarios":"Using a git dependency in skaffold.yaml while running with --sync-remote-cache=false, where no prior run has cloned the repo at the requested ref into the cache directory.","commonSituations":"Fresh CI machine with sync disabled and no cache restored; cached clone deleted by cleanup; ref changed (new commit) so the cached dir for that ref is missing; typo in cache path env.","solutions":["Rerun without --sync-remote-cache=false so Skaffold can clone the repository","Restore the cache directory from CI cache artifacts before running","Pin the ref that is already present in the cache, or update the dependency ref to one that exists locally","Check the printed repoCacheDir path and create the clone there manually (git clone + git checkout <ref>)"],"exampleFix":"// before\nskaffold run --sync-remote-cache=false\n// after\nskaffold run  # first run clones repos into cache\n# subsequent runs may use --sync-remote-cache=false with a restored cache","handlingStrategy":"fallback","validationCode":"if _, err := os.Stat(repoCacheDir); os.IsNotExist(err) {\n    // repo not cloned: enable sync or clone at the pinned ref first\n    exec.Command(\"git\", \"clone\", repo.URL, repoCacheDir).Run()\n    exec.Command(\"git\", \"-C\", repoCacheDir, \"checkout\", repo.Ref).Run()\n}","typeGuard":null,"tryCatchPattern":"if err := runSkaffold(); err != nil && strings.Contains(err.Error(), \"repository sync is explicitly disabled\") {\n    log.Println(\"repo cache missing; retrying with remote sync enabled\")\n    err = runSkaffold(\"--sync-remote-cache=true\")\n}","preventionTips":["Do a first run with remote sync enabled before using --sync-remote-cache=false","Restore git repo caches from CI cache artifacts keyed by ref","Pin dependency refs that are known to be cached"],"tags":["git","cache","skaffold","configuration"],"backgroundTag":"remote-cache-missing","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}