GoogleContainerTools/skaffold · error

failed to interpret %q as image: %v

Error message

failed to interpret %q as image: %v

What it means

Fires in GetPlatforms when the media type indicates a single image manifest (OCI schema1/Docker schema2) but the object cannot be asserted to the Image interface — an internal type-assertion failure in go-containerregistry image handling, not a user config error.

Source

Thrown at pkg/skaffold/docker/platform.go:62

	case types.OCIImageIndex, types.DockerManifestList:
		ix, ok := i.(v1.ImageIndex)
		if !ok {
			return nil, fmt.Errorf("failed to interpret %q as index: %v", image, i)
		}
		manifests, err := ix.IndexManifest()
		if err != nil {
			return nil, err
		}
		for _, m := range manifests.Manifests {
			if m.Platform == nil || m.Platform.Architecture == "unknown" || m.Platform.OS == "unknown" {
				continue
			}
			p = append(p, util.ConvertFromV1Platform(*m.Platform))
		}
	case types.OCIManifestSchema1, types.DockerManifestSchema2:
		im, ok := i.(v1.Image)
		if !ok {
			return nil, fmt.Errorf("failed to interpret %q as image: %v", image, im)
		}
		cf, err := im.ConfigFile()
		if err != nil {
			return nil, err
		}
		p = append(p, spec.Platform{OS: cf.OS, Architecture: cf.Architecture})
	default:
		return nil, fmt.Errorf("image media type: %s", mt)
	}
	if err != nil {
		return nil, err
	}
	return p, nil
}

func getImage(image string) (ImageRef, error) {
	ref, err := name.ParseReference(image, name.WeakValidation)
	if err != nil {

View on GitHub (pinned to a1189de023)

Solutions

  1. Re-pull or re-push the image to rule out a corrupted registry artifact
  2. Rebuild the image with current tooling
  3. Report to skaffold maintainers with the image reference if persistent
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at pkg/skaffold/docker/platform.go:62 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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