{"record":{"id":"c2de7d42109aa816","repo":"GoogleContainerTools/skaffold","slug":"config-remote-repo-cache-not-found-err","errorCode":"CONFIG_REMOTE_REPO_CACHE_NOT_FOUND_ERR","errorMessage":"cache directory %q for Google Cloud Storage source %q does not exist and remote cache sync is explicitly disabled via flag `--sync-remote-cache`","messagePattern":"cache directory %q for Google Cloud Storage source %q does not exist and remote cache sync is explicitly disabled via flag `--sync-remote-cache`","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/gcs/gsutil.go","lineNumber":135,"sourceCode":"\treturn cacheDir, nil\n}\n\n// getPerSourceDir returns the directory used per Google Cloud Storage source. Directory is a hash of the source provided.\nfunc getPerSourceDir(g latest.GoogleCloudStorageInfo) (string, error) {\n\tinputs := []string{g.Source}\n\thasher := sha256.New()\n\tenc := json.NewEncoder(hasher)\n\tif err := enc.Encode(inputs); err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn base64.URLEncoding.EncodeToString(hasher.Sum(nil))[:32], nil\n}\n\n// syncDisabledErr returns error to use when remote sync is turned off by the user and the Google Cloud Storage object doesn't exist inside the cache directory.\nfunc syncDisabledErr(g latest.GoogleCloudStorageInfo, cacheDir string) error {\n\tmsg := fmt.Sprintf(\"cache directory %q for Google Cloud Storage source %q does not exist and remote cache sync is explicitly disabled via flag `--sync-remote-cache`\", cacheDir, g.Source)\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 download the Google Cloud Storage objects manually to %q or set flag `--sync-remote-cache` to `always` or `missing`\", cacheDir),\n\t\t\t\t},\n\t\t\t},\n\t\t})\n}\n","sourceCodeStart":117,"sourceCodeEnd":147,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/gcs/gsutil.go#L117-L147","documentation":"When --sync-remote-cache=false (or default sync is disabled), the GCS source handler expects the remote objects to already exist in a local cache directory. syncDisabledErr is returned by SyncObjects when that cache directory is missing, with an actionable error carrying code CONFIG_REMOTE_REPO_CACHE_NOT_FOUND_ERR and a suggestion to enable remote sync.","triggerScenarios":"Running skaffold with a Google Cloud Storage dependency/source where the local cache directory does not exist and the user explicitly disabled remote cache sync via --sync-remote-cache=false (or sync-remote-cache=false in config).","commonSituations":"CI caching not warmed before the run; cache directory path changed between runs; first run on a fresh machine with sync disabled; accidentally passing --sync-remote-cache=false while relying on GCS sources.","solutions":["Remove the --sync-remote-cache=false flag (or set it to true) so Skaffold can download the GCS objects into the cache","Pre-populate the cache directory manually (e.g. gsutil rsync the bucket into the expected cacheDir path)","Check skaffold.yaml/config file for sync-remote-cache: false and remove it","Verify the cacheDir path printed in the error and create/populate it before rerunning"],"exampleFix":"// before\nskaffold dev --sync-remote-cache=false\n// after\nskaffold dev  # allow remote cache sync\n# or pre-warm:\ngsutil -m rsync -r gs://my-bucket/deps /path/to/cacheDir","handlingStrategy":"fallback","validationCode":"if _, err := os.Stat(cacheDir); os.IsNotExist(err) {\n    // cache missing: either enable remote sync or pre-populate before running\n    if remoteSyncDisabled { return fmt.Errorf(\"pre-warm cache %s or drop --sync-remote-cache=false\", cacheDir) }\n}","typeGuard":null,"tryCatchPattern":"if err := runSkaffold(); err != nil && strings.Contains(err.Error(), \"does not exist and remote cache sync is explicitly disabled\") {\n    log.Println(\"cache missing; retrying with remote sync enabled\")\n    err = runSkaffold(\"--sync-remote-cache=true\")\n}","preventionTips":["Warm the GCS cache in CI before runs that disable sync","Keep --sync-remote-cache consistent across pipeline stages","Monitor cache directory existence as a pre-flight check"],"tags":["gcs","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"}