{"record":{"id":"5d12ba02d23f143c","repo":"GoogleContainerTools/skaffold","slug":"couldn-t-parse-image-tag-s-w","errorCode":null,"errorMessage":"couldn't parse image tag %s %w","messagePattern":"couldn't parse image tag (.+?) %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/docker/build_args.go","lineNumber":122,"sourceCode":"\tfor _, d := range deps {\n\t\tt, found := r.GetImageTag(d.ImageName)\n\t\tswitch {\n\t\tcase found:\n\t\t\tm[d.Alias] = &t\n\t\tcase missingIsFatal:\n\t\t\tlog.Entry(context.TODO()).Fatalf(\"failed to resolve build result for required artifact %q\", d.ImageName)\n\t\tdefault:\n\t\t\tm[d.Alias] = nil\n\t\t}\n\t}\n\treturn m\n}\n\n// EnvTags generate a set of build tags from the docker image name.\nfunc EnvTags(tag string) (map[string]string, error) {\n\timgRef, err := ParseReference(tag)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"couldn't parse image tag %s %w\", tag, err)\n\t}\n\tif imgRef.Tag == \"\" {\n\t\timgRef.Tag = \"latest\"\n\t}\n\treturn map[string]string{\n\t\t\"IMAGE_REPO\": imgRef.Repo,\n\t\t\"IMAGE_NAME\": imgRef.Name,\n\t\t\"IMAGE_TAG\":  imgRef.Tag,\n\t}, nil\n}\n","sourceCodeStart":104,"sourceCodeEnd":133,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/docker/build_args.go#L104-L133","documentation":"EnvTags derives IMAGE_REPO/IMAGE_NAME/IMAGE_TAG build args from an image tag; it wraps ParseReference failure with the offending tag in the message. The tag string supplied by Build/sourceDependenciesForArtifact was not a parsable image reference.","triggerScenarios":"EnvTags(tag) called with a tag that ParseReference rejects — empty string after templating, invalid characters, scheme-prefixed value, or malformed registry/repo:tag.","commonSituations":"Templated tag (e.g. {{.IMAGE}}) rendering empty; invalid characters from shell interpolation; scheme (https://) accidentally included; typo in registry host.","solutions":["Inspect the %s in the message to see the offending tag value","Fix the image/tag string to a valid reference (lowercase repo, optional :tag/@digest)","Ensure any env templating renders non-empty values before the call","Remove URL schemes from the tag value"],"exampleFix":"// before\ntag: \"https://gcr.io/proj/img\"\n// after\ntag: \"gcr.io/proj/img:v1\"","handlingStrategy":"validation","validationCode":"if tag == \"\" {\n  return fmt.Errorf(\"image tag is empty; check templating\")\n}\nif strings.Contains(tag, \"://\") {\n  return fmt.Errorf(\"tag %q must not contain a scheme\", tag)\n}\nif _, err := docker.ParseReference(tag); err != nil {\n  return fmt.Errorf(\"invalid tag %q: %w\", tag, err)\n}","typeGuard":null,"tryCatchPattern":"tags, err := docker.EnvTags(tag)\nif err != nil {\n  return fmt.Errorf(\"IMAGE_REPO/IMAGE_TAG args unavailable; fix tag %q: %w\", tag, err)\n}","preventionTips":["Ensure image-tag templating produces non-empty values","Use lowercase repos and valid tag characters","Strip URL schemes from tag strings","Validate tags with docker.ParseReference upstream"],"tags":["docker","image-tag","parsing","skaffold"],"backgroundTag":"invalid-image-reference","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"}