GoogleContainerTools/skaffold · error

parsing image name for registry: %w

Error message

parsing image name for registry: %w

What it means

Wraps a failure of reference.ParseNormalizedNamed when parsing an image name into a normalized registry reference before resolving auth. Any invalid image reference makes encodedRegistryAuth — used by Push and Pull — fail.

Source

Thrown at pkg/skaffold/docker/auth.go:234

func parseRepositoryInfo(reposName reference.Named) (string, bool) {
	normalizeIndexName := func(val string) string {
		if val == "index.docker.io" {
			return "docker.io"
		}
		return val
	}
	val := normalizeIndexName(reference.Domain(reposName))
	if val == DockerIndexName {
		return DockerIndexName, true
	}
	return val, false
}

func (l *localDaemon) encodedRegistryAuth(ctx context.Context, a AuthConfigHelper, image string) (string, error) {
	ref, err := reference.ParseNormalizedNamed(image)
	if err != nil {
		return "", fmt.Errorf("parsing image name for registry: %w", err)
	}

	configKey, official := parseRepositoryInfo(ref)
	if official {
		configKey = l.officialRegistry(ctx)
	}

	ac, err := a.GetAuthConfig(ctx, configKey)
	if err != nil {
		return "", fmt.Errorf("getting auth config: %w", err)
	}

	return encodeAuthConfig(ac)
}

func encodeAuthConfig(authConfig types.AuthConfig) (string, error) {
	b, err := json.Marshal(authConfig)
	if err != nil {

View on GitHub (pinned to a1189de023)

Solutions

  1. Fix the image name: lowercase repository, valid format [[host]/]repo[:tag][@digest]
  2. Remove any scheme (https://) from the image name
  3. Check templated image names render non-empty values
  4. Validate locally: `docker image inspect <name>` or a reference parser to confirm the ref is valid

Example fix

// before
image: MyImage
// after
image: myimage
# or fully qualified:
image: gcr.io/project/my-image:v1
Defensive patterns

Strategy: validation

Validate before calling

_, err := reference.ParseNormalizedNamed(imageName)
if err != nil {
  return fmt.Errorf("invalid image name %q: %w", imageName, err)
}

Try / catch

_, err := daemon.Push(ctx, imageName)
if err != nil && strings.Contains(err.Error(), "parsing image name for registry") {
  return fmt.Errorf("fix image name %q (lowercase, no scheme): %w", imageName, err)
}

Prevention

When it happens

Trigger: localDaemon.Push/Pull (or a callback) calls encodedRegistryAuth with an image string ParseNormalizedNamed rejects: empty string, invalid characters, wrong case (uppercase repo on docker.io), or malformed tag/digest.

Common situations: Typo in image name in skaffold.yaml; image name containing uppercase letters for Docker Hub; empty image name after templating; passing a URL with scheme (https://) instead of an image ref.

Related errors


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