{"record":{"id":"02371d64b2ed9455","repo":"GoogleContainerTools/skaffold","slug":"getting-gcb-repo-info-for-s-w","errorCode":null,"errorMessage":"getting GCB repo info for %s: %w","messagePattern":"getting GCB repo info for (.+?): %w","errorType":"console","errorClass":"ConfigParsingError","httpStatus":null,"severity":"error","filePath":"pkg/skaffold/parser/config.go","lineNumber":298,"sourceCode":"\tvar repoInfo *git.Config\n\tconfigFilePath := \"\"\n\tpath := makeConfigPathAbsolute(d.Path, cfgOpts.file)\n\tisRemoteCfg := false\n\n\tif d.GitRepo != nil {\n\t\tconfigFilePath = d.GitRepo.Path\n\t\trepoInfo = &git.Config{\n\t\t\tRepo:         d.GitRepo.Repo,\n\t\t\tRepoCloneURI: d.GitRepo.Repo,\n\t\t\tRef:          d.GitRepo.Ref,\n\t\t\tSync:         d.GitRepo.Sync,\n\t\t}\n\t}\n\n\tif d.GoogleCloudBuildRepoV2 != nil {\n\t\trepInf, err := gcbreposv2.GetRepoInfo(ctx, d.GoogleCloudBuildRepoV2.ProjectID, d.GoogleCloudBuildRepoV2.Region, d.GoogleCloudBuildRepoV2.Connection, d.GoogleCloudBuildRepoV2.Repo)\n\t\tif err != nil {\n\t\t\treturn nil, sErrors.ConfigParsingError(fmt.Errorf(\"getting GCB repo info for %s: %w\", d.GoogleCloudBuildRepoV2.Repo, err))\n\t\t}\n\t\tconfigFilePath = d.GoogleCloudBuildRepoV2.Path\n\t\trepoInfo = &git.Config{\n\t\t\tRepo:         repInf.URI,\n\t\t\tRepoCloneURI: repInf.CloneURI,\n\t\t\tRef:          d.GoogleCloudBuildRepoV2.Ref,\n\t\t\tSync:         d.GoogleCloudBuildRepoV2.Sync,\n\t\t}\n\t}\n\n\tif repoInfo != nil {\n\t\tcachePath, err := cacheRepo(ctx, *repoInfo, configFilePath, opts, r)\n\t\tif err != nil {\n\t\t\treturn nil, sErrors.ConfigParsingError(fmt.Errorf(\"caching remote dependency %s: %w\", repoInfo.Repo, err))\n\t\t}\n\t\tpath = cachePath\n\t\tisRemoteCfg = true\n\t}","sourceCodeStart":280,"sourceCodeEnd":316,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/parser/config.go#L280-L316","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify the dependency fields (projectID, region, connection, repo) against the actual GCB v2 repo in the console/gcloud","Authenticate and check IAM: gcloud auth application-default login and ensure cloudbuild.repositories.get permission","Test resolution manually (gcloud cloud-build repositories describe ... in the same project/region) to see the raw API error","Fix network/proxy issues if the underlying error is a connection failure, then re-run"],"exampleFix":"// before: skaffold.yaml\ndependencies:\n  - googleCloudBuildRepoV2:\n      projectID: wrong-project\n      repo: my-repo\n// after\ndependencies:\n  - googleCloudBuildRepoV2:\n      projectID: my-project\n      region: us-central1\n      connection: my-connection\n      repo: my-repo\n      ref: main","handlingStrategy":"try-catch","validationCode":"// before parsing configs with GCB dependencies\ncmd := exec.Command(\"gcloud\", \"cloud-build\", \"repositories\", \"describe\", dep.Repo,\n    \"--project=\"+dep.ProjectID, \"--region=\"+dep.Region, \"--connection=\"+dep.Connection)\nif err := cmd.Run(); err != nil {\n    return fmt.Errorf(\"GCB repo %s not resolvable: %w\", dep.Repo, err)\n}","typeGuard":null,"tryCatchPattern":"cfgs, err := skaffoldConfig.Parse(...)\nif err != nil {\n    var pe *sErrors.ConfigParsingError\n    if errors.As(err, &pe) && strings.Contains(err.Error(), \"getting GCB repo info\") {\n        // re-auth and retry once\n        exec.Command(\"gcloud\", \"auth\", \"application-default\", \"login\").Run()\n        cfgs, err = skaffoldConfig.Parse(...)\n    }\n    if err != nil { return err }\n}","preventionTips":["Run 'gcloud auth application-default login' before working with GCB repo dependencies","Double-check projectID/region/connection/repo values against gcloud output, not memory","Ensure IAM grants cloudbuild.repositories.get for your account","Test with 'gcloud cloud-build repositories describe' when parsing fails"],"tags":["gcp","cloudbuild","config","network"],"backgroundTag":"gcb-repo-info-lookup-failed","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"}