{"record":{"id":"6288c0cc502a3f82","repo":"GoogleContainerTools/skaffold","slug":"getting-multi-level-repo-support-w","errorCode":null,"errorMessage":"getting multi-level repo support: %w","messagePattern":"getting multi-level repo support: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/deploy/util/util.go","lineNumber":64,"sourceCode":"\t\"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/tag\"\n\t\"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/util/stringset\"\n\ttimeutil \"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/util/time\"\n)\n\nvar (\n\tconfirmHydrationDirOverride = prompt.ConfirmHydrationDirOverride\n)\n\n// ApplyDefaultRepo applies the default repo to a given image tag.\nfunc ApplyDefaultRepo(globalConfig string, defaultRepo *string, tag string) (string, error) {\n\trepo, err := config.GetDefaultRepo(globalConfig, defaultRepo)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"getting default repo: %w\", err)\n\t}\n\n\tmultiLevel, err := config.GetMultiLevelRepo(globalConfig)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"getting multi-level repo support: %w\", err)\n\t}\n\n\tnewTag, err := docker.SubstituteDefaultRepoIntoImage(repo, multiLevel, tag)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"applying default repo to %q: %w\", tag, err)\n\t}\n\n\treturn newTag, nil\n}\n\n// Update which images are logged, if the image is present in the provided deployer's artifacts.\nfunc AddTagsToPodSelector(runnerBuilds []graph.Artifact, deployerArtifacts []graph.Artifact, podSelector *kubernetes.ImageList) {\n\t// This implementation is mostly picked from v1 for fixing log duplication issue when multiple deployers are used.\n\t// According to the original author \"Each Deployer will be directly responsible for adding its deployed artifacts to the PodSelector\n\t// by cross-referencing them against the list of images parsed out of the set of manifests they each deploy\". Each deploy should only\n\t// add its own deployed artifacts to the PodSelector to avoid duplicate logging when multi-deployers are used.\n\t// This implementation only streams logs for the intersection of runnerBuilds and deployerArtifacts images, not all images from a deployer\n\t// probably because at that time the team didn't want to stream logs from images not built by Skaffold, e.g. images from docker hub, but this","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/deploy/util/util.go#L46-L82","documentation":"ApplyDefaultRepo returns this when config.GetMultiLevelRepo fails while reading the multi-level repo support setting from the global skaffold config. This boolean controls whether default repo substitution applies to multi-level repository paths; the error indicates the global config file could not be read or parsed. The wrapped error from GetMultiLevelRepo identifies the underlying cause.","triggerScenarios":"Calling ApplyDefaultRepo (via ImageTags) where config.GetMultiLevelRepo(globalConfig) errors — typically when the globalConfig path points to an unreadable or malformed skaffold config file, immediately after the default-repo lookup succeeded.","commonSituations":"A partially written or corrupted ~/.skaffold/config; permission errors on the global config file; a config file written by a newer skaffold version with unexpected schema fields; globalConfig pointing at the wrong path.","solutions":["Check the global skaffold config file (~/.skaffold/config by default) parses correctly; remove or repair corrupt entries.","Check file permissions on the global config file so the current user can read it.","Back up and delete ~/.skaffold/config, then re-run `skaffold config set` commands to regenerate it.","Ensure the skaffold version matches the config schema; upgrade skaffold if the config was written by a newer version."],"exampleFix":"// before\n$ cat ~/.skaffold/config # truncated/invalid YAML\n// after\n$ mv ~/.skaffold/config ~/.skaffold/config.bak\n$ skaffold config set --global default-repo gcr.io/my-project","handlingStrategy":"try-catch","validationCode":"// Pre-check that multi-level repo setting is readable\nmultiLevel, err := config.GetMultiLevelRepo(globalConfig)\nif err != nil {\n\treturn fmt.Errorf(\"global skaffold config unreadable (%s): %w\", globalConfig, err)\n}\n_ = multiLevel","typeGuard":null,"tryCatchPattern":"newTag, err := util.ApplyDefaultRepo(globalConfig, defaultRepo, tag)\nif err != nil && strings.Contains(err.Error(), \"getting multi-level repo support\") {\n\treturn fmt.Errorf(\"global config %s is corrupt or unreadable; regenerate it: %w\", globalConfig, err)\n}","preventionTips":["Check read permissions on the global skaffold config file.","Regenerate the config after failed or interrupted skaffold runs.","Upgrade skaffold when config schema errors appear after a version bump.","Keep the global config minimal to reduce parse-failure risk."],"tags":["configuration","global-config","default-repo"],"backgroundTag":"corrupt-config-file","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"}