GoogleContainerTools/skaffold · error

no tag provided for image

Error message

no tag provided for image [%s]

What it means

validateArtifactTags iterates over merged build artifacts and fails if any artifact has an empty Tag. Tags are produced by the tag strategy (envTemplate, dateTime, gitCommit, sha256, etc.); an empty tag means the builder could not derive an image tag, so the merged build output would be unusable downstream (deploy expects fully tagged images).

Solutions

  1. Regenerate the build output with `skaffold build --file-output artifacts.json` instead of hand-editing it.
  2. Check your tagger config in skaffold.yaml; ensure envTemplate references defined env vars so the tag is non-empty.
  3. Inspect the artifacts JSON and ensure every entry has a non-empty `tag` field.

Example fix

// before (hand-edited artifacts.json)
[{"imageName":"gcr.io/proj/app","tag":""}]
// after
[{"imageName":"gcr.io/proj/app","tag":"gcr.io/proj/app:abc123"}]
Defensive patterns

Strategy: validation

Validate before calling

for _, a := range artifacts {
    if a.Tag == "" {
        return fmt.Errorf("artifact %q has empty tag; rerun skaffold build", a.ImageName)
    }
}

Try / catch

if err := deployCmd.Run(); err != nil {
    if strings.Contains(err.Error(), "no tag provided for image") {
        // regenerate build output via `skaffold build --file-output`
    }
}

Prevention

When it happens

Trigger: Calling mergeBuildArtifacts with build results whose `Tag` field is empty — typically when a custom builder/cache path returns artifacts without tags, or when merging artifacts loaded from a file (`--build-artifacts` / `--file-output`) that was hand-edited or produced by an older skaffold version.

Common situations: Piping `skaffold build --file-output` results into `skaffold deploy` after manual editing; custom build scripts emitting JSON without the `tag` field; tag template rendering to an empty string (e.g. missing env var in envTemplate tagger).

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at cmd/skaffold/app/cmd/util.go:102

				artifact.Tag = artifact.ImageName + ":" + opts.CustomTag
			} else {
				newTag, err := tag.SetImageTag(artifact.Tag, opts.CustomTag)
				if err != nil {
					return nil, err
				}
				artifact.Tag = newTag
			}
			result = append(result, artifact)
		}
		return result, nil
	}
	return artifacts, nil
}

func validateArtifactTags(artifacts []graph.Artifact) error {
	for _, artifact := range artifacts {
		if artifact.Tag == "" {
			return fmt.Errorf("no tag provided for image [%s]", artifact.ImageName)
		}
	}
	return nil
}

View on GitHub (pinned to a1189de023)