GoogleContainerTools/skaffold · error · ConfigParsingError

getting GCB repo info for %s: %w

Error message

getting GCB repo info for %s: %w

What it means

When processing a remote config dependency of type GoogleCloudBuildRepoV2, skaffold queries the Cloud Build Repos v2 API (GetRepoInfo) to resolve the repository URI/clone URI. If that API call fails, the error is wrapped with the repo name and returned as a ConfigParsingError. This means the remote GCB repository reference could not be resolved.

Source

Thrown at pkg/skaffold/parser/config.go:298

	var repoInfo *git.Config
	configFilePath := ""
	path := makeConfigPathAbsolute(d.Path, cfgOpts.file)
	isRemoteCfg := false

	if d.GitRepo != nil {
		configFilePath = d.GitRepo.Path
		repoInfo = &git.Config{
			Repo:         d.GitRepo.Repo,
			RepoCloneURI: d.GitRepo.Repo,
			Ref:          d.GitRepo.Ref,
			Sync:         d.GitRepo.Sync,
		}
	}

	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
	}

View on GitHub (pinned to a1189de023)

Solutions

  1. Verify the dependency fields (projectID, region, connection, repo) against the actual GCB v2 repo in the console/gcloud
  2. Authenticate and check IAM: gcloud auth application-default login and ensure cloudbuild.repositories.get permission
  3. Test resolution manually (gcloud cloud-build repositories describe ... in the same project/region) to see the raw API error
  4. Fix network/proxy issues if the underlying error is a connection failure, then re-run

Example fix

// before: skaffold.yaml
dependencies:
  - googleCloudBuildRepoV2:
      projectID: wrong-project
      repo: my-repo
// after
dependencies:
  - googleCloudBuildRepoV2:
      projectID: my-project
      region: us-central1
      connection: my-connection
      repo: my-repo
      ref: main
Defensive patterns

Strategy: try-catch

Validate before calling

// before parsing configs with GCB dependencies
cmd := exec.Command("gcloud", "cloud-build", "repositories", "describe", dep.Repo,
    "--project="+dep.ProjectID, "--region="+dep.Region, "--connection="+dep.Connection)
if err := cmd.Run(); err != nil {
    return fmt.Errorf("GCB repo %s not resolvable: %w", dep.Repo, err)
}

Try / catch

cfgs, err := skaffoldConfig.Parse(...)
if err != nil {
    var pe *sErrors.ConfigParsingError
    if errors.As(err, &pe) && strings.Contains(err.Error(), "getting GCB repo info") {
        // re-auth and retry once
        exec.Command("gcloud", "auth", "application-default", "login").Run()
        cfgs, err = skaffoldConfig.Parse(...)
    }
    if err != nil { return err }
}

Prevention

When it happens

Trigger: gcbreposv2.GetRepoInfo fails: wrong projectID/region/connection/repo values in the dependency, missing gcloud credentials or insufficient IAM (cloudbuild.repositories.get), the repo/connection does not exist, or API/network errors.

Common situations: Typo in the repo name or connection id in skaffold.yaml dependencies; running without 'gcloud auth application-default login'; project/region mismatch with where the connection was created; deleted or renamed GCB v2 repository.

Related errors


AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05). Data as JSON: /api/errors/02371d64b2ed9455. Report an issue: GitHub.