GoogleContainerTools/skaffold · error

retrieving image %q: %w

Error message

retrieving image %q: %w

What it means

Fires in parseOnbuild when the base image named in a FROM instruction cannot be retrieved (from local docker daemon or remote registry) while checking it for ONBUILD triggers. Wraps the underlying retrieval error: image not found locally, registry auth failure, or network problem.

Source

Thrown at pkg/skaffold/docker/parse.go:419

			// Stage names are case insensitive
			onbuildNodesCache[strings.ToLower(from.as)] = nodes
			onbuildNodesCache[strings.ToLower(from.image)] = nodes

			expandedNodes = append(expandedNodes, onbuildNodes...)
		}
	}
	expandedNodes = append(expandedNodes, nodes[n:]...)

	return expandedNodes, nil
}

func parseOnbuild(ctx context.Context, image string, cfg Config) ([]*parser.Node, error) {
	log.Entry(context.TODO()).Tracef("Checking base image %s for ONBUILD triggers.", image)

	// Image names are case SENSITIVE
	img, err := RetrieveImage(ctx, image, cfg)
	if err != nil {
		return nil, fmt.Errorf("retrieving image %q: %w", image, err)
	}

	if len(img.Config.OnBuild) == 0 {
		return []*parser.Node{}, nil
	}

	log.Entry(context.TODO()).Tracef("Found ONBUILD triggers %v in image %s", img.Config.OnBuild, image)

	obRes, err := parser.Parse(strings.NewReader(strings.Join(img.Config.OnBuild, "\n")))
	if err != nil {
		return nil, err
	}

	return obRes.AST.Children, nil
}

func fromInstruction(node *parser.Node) from {
	var as string

View on GitHub (pinned to a1189de023)

Solutions

  1. Pull the base image locally: docker pull <image>
  2. Check registry credentials (docker login) for private base images
  3. Fix network/proxy issues blocking registry access
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at pkg/skaffold/docker/parse.go:419 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/01e4e715fef21cc3. Report an issue: GitHub.