GoogleContainerTools/skaffold · error · ConfigParsingError
caching remote dependency %s: %w
Error message
caching remote dependency %s: %w
What it means
After resolving repo info for a remote config dependency (git or GCB), skaffold clones/caches the repository locally via cacheRepo so its configs can be parsed. If caching fails (clone error, auth, bad ref), the error is wrapped with the repo name and returned as a ConfigParsingError. The underlying git/network error is the real cause.
Source
Thrown at pkg/skaffold/parser/config.go:312
if d.GoogleCloudBuildRepoV2 != nil {
repInf, err := gcbreposv2.GetRepoInfo(ctx, d.GoogleCloudBuildRepoV2.ProjectID, d.GoogleCloudBuildRepoV2.Region, d.GoogleCloudBuildRepoV2.Connection, d.GoogleCloudBuildRepoV2.Repo)
if err != nil {
return nil, sErrors.ConfigParsingError(fmt.Errorf("getting GCB repo info for %s: %w", d.GoogleCloudBuildRepoV2.Repo, err))
}
configFilePath = d.GoogleCloudBuildRepoV2.Path
repoInfo = &git.Config{
Repo: repInf.URI,
RepoCloneURI: repInf.CloneURI,
Ref: d.GoogleCloudBuildRepoV2.Ref,
Sync: d.GoogleCloudBuildRepoV2.Sync,
}
}
if repoInfo != nil {
cachePath, err := cacheRepo(ctx, *repoInfo, configFilePath, opts, r)
if err != nil {
return nil, sErrors.ConfigParsingError(fmt.Errorf("caching remote dependency %s: %w", repoInfo.Repo, err))
}
path = cachePath
isRemoteCfg = true
}
if d.GoogleCloudStorage != nil {
cachePath, err := cacheGCSObject(ctx, *d.GoogleCloudStorage, opts, r)
if err != nil {
return nil, sErrors.ConfigParsingError(fmt.Errorf("caching remote dependency %s: %w", d.GoogleCloudStorage.Path, err))
}
path = cachePath
isRemoteCfg = true
}
if path == "" {
// empty path means configs in the same file
path = cfgOpts.file
}View on GitHub (pinned to a1189de023)
Solutions
- Read the wrapped cause: fix git auth (add SSH keys or credential helper) or network first, then re-run
- Verify the repo URI and ref (git ls-remote <repo> <ref>) exist and are reachable
- Clear a corrupt cache directory and let skaffold re-clone
- If the dependency is wrong in skaffold.yaml, correct the git.repo/ref or switch to a local path dependency for testing
Example fix
// before
dependencies:
- git:
repo: git@github.com:org/private-configs.git
ref: no-such-branch
// after
dependencies:
- git:
repo: https://github.com/org/private-configs.git
ref: main
sync: false Defensive patterns
Strategy: try-catch
Validate before calling
// verify the remote dep is clonable before parsing
ref := dep.Git.Ref
if ref == "" { ref = "HEAD" }
if err := exec.Command("git", "ls-remote", dep.Git.Repo, ref).Run(); err != nil {
return fmt.Errorf("remote dep %s unreachable or bad ref: %w", dep.Git.Repo, err)
} Try / catch
cfgs, err := skaffoldConfig.Parse(...)
if err != nil {
var pe *sErrors.ConfigParsingError
if errors.As(err, &pe) && strings.Contains(err.Error(), "caching remote dependency") {
exec.Command("git", "credential", "fill").Run() // trigger credential helper
os.RemoveAll(cacheDir) // clear stale cache, then retry
cfgs, err = skaffoldConfig.Parse(...)
}
if err != nil { return err }
} Prevention
- Set up git credentials (SSH keys or credential helper) for private dependency repos
- Verify refs with 'git ls-remote <repo> <ref>' before committing them to skaffold.yaml
- Clear the skaffold cache directory if clones repeatedly fail with corrupt-repo errors
- For local iteration, use a local path dependency instead of a remote git dep
When it happens
Trigger: cacheRepo fails: git clone cannot reach the remote (network, auth, missing SSH keys/token), the configured Ref does not exist, the repo URI/clone URI is wrong, or the local cache directory is unwritable/corrupt.
Common situations: Private git repos without deploy keys/credentials configured; typo'd ref/branch/tag in the dependency; VPN/offline while cloning; stale cache directory with wrong permissions; repo moved to a new host so the URI no longer resolves.
Related errors
- failed to clone repo: %w
- failed to lookup %s branch for repo %s: %w
- failed to clone repo %s: trouble getting default branch: %w
- failed to clone repo %s: trouble resetting branch to origin/
- getting GCB repo info for %s: %w
AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05).
Data as JSON: /api/errors/329960cb820674c3.
Report an issue: GitHub.