GoogleContainerTools/skaffold · error
CONFIG_REMOTE_REPO_CACHE_NOT_FOUND_ERR
CONFIG_REMOTE_REPO_CACHE_NOT_FOUND_ERR
Error message
cache directory %q for Google Cloud Storage source %q does not exist and remote cache sync is explicitly disabled via flag `--sync-remote-cache`
What it means
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.
Source
Thrown at pkg/skaffold/gcs/gsutil.go:135
return cacheDir, nil
}
// getPerSourceDir returns the directory used per Google Cloud Storage source. Directory is a hash of the source provided.
func getPerSourceDir(g latest.GoogleCloudStorageInfo) (string, error) {
inputs := []string{g.Source}
hasher := sha256.New()
enc := json.NewEncoder(hasher)
if err := enc.Encode(inputs); err != nil {
return "", err
}
return base64.URLEncoding.EncodeToString(hasher.Sum(nil))[:32], nil
}
// 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.
func syncDisabledErr(g latest.GoogleCloudStorageInfo, cacheDir string) error {
msg := 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)
return sErrors.NewError(errors.New(msg),
&proto.ActionableErr{
Message: msg,
ErrCode: proto.StatusCode_CONFIG_REMOTE_REPO_CACHE_NOT_FOUND_ERR,
Suggestions: []*proto.Suggestion{
{
SuggestionCode: proto.SuggestionCode_CONFIG_ENABLE_REMOTE_REPO_SYNC,
Action: fmt.Sprintf("Either download the Google Cloud Storage objects manually to %q or set flag `--sync-remote-cache` to `always` or `missing`", cacheDir),
},
},
})
}
View on GitHub (pinned to a1189de023)
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
Example fix
// before skaffold dev --sync-remote-cache=false // after skaffold dev # allow remote cache sync # or pre-warm: gsutil -m rsync -r gs://my-bucket/deps /path/to/cacheDir
Defensive patterns
Strategy: fallback
Validate before calling
if _, err := os.Stat(cacheDir); os.IsNotExist(err) {
// cache missing: either enable remote sync or pre-populate before running
if remoteSyncDisabled { return fmt.Errorf("pre-warm cache %s or drop --sync-remote-cache=false", cacheDir) }
} Try / catch
if err := runSkaffold(); err != nil && strings.Contains(err.Error(), "does not exist and remote cache sync is explicitly disabled") {
log.Println("cache missing; retrying with remote sync enabled")
err = runSkaffold("--sync-remote-cache=true")
} Prevention
- 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
When it happens
Trigger: 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).
Common situations: 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.
Related errors
- CONFIG_REMOTE_REPO_CACHE_NOT_FOUND_ERR
- failed determining remote cache directory: %w
- value must be one of `always`, `missing`, or `never`
- INSPECT_BUILD_ENV_ALREADY_EXISTS_ERR
- INSPECT_BUILD_ENV_INCORRECT_TYPE_ERR
AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05).
Data as JSON: /api/errors/c2de7d42109aa816.
Report an issue: GitHub.