GoogleContainerTools/skaffold · error

listing artifact dependencies: %w

Error message

listing artifact dependencies: %w

What it means

CheckArtifacts times how long it takes to enumerate an artifact's source dependencies via graph.NewSourceDependenciesCache/SingleArtifactDependencies. If that dependency listing fails on the first pass, the error is wrapped with this message.

Source

Thrown at pkg/skaffold/diagnose/diagnose.go:64

			output.Default.Fprintf(out, "\n%s: %s\n", typeOfArtifact(artifact), artifact.ImageName)

			if artifact.DockerArtifact != nil {
				size, err := sizeOfDockerContext(ctx, artifact, cfg)
				if err != nil {
					return fmt.Errorf("computing the size of the Docker context: %w", err)
				}

				fmt.Fprintf(out, " - Size of the context: %vbytes\n", size)
			}

			tag, ok := tags[artifact.ImageName]
			if !ok {
				return fmt.Errorf("getting tag for image %s", artifact.ImageName)
			}

			timeDeps1, deps, err := timeToListDependencies(ctx, artifact, tag, cfg)
			if err != nil {
				return fmt.Errorf("listing artifact dependencies: %w", err)
			}
			timeDeps2, _, err := timeToListDependencies(ctx, artifact, tag, cfg)
			if err != nil {
				return fmt.Errorf("listing artifact dependencies: %w", err)
			}

			fmt.Fprintln(out, " - Dependencies:", len(deps), "files")
			fmt.Fprintf(out, " - Time to list dependencies: %v (2nd time: %v)\n", timeDeps1, timeDeps2)

			// Only check sync map if inferred sync is configured on artifact
			if artifact.Sync != nil && len(artifact.Sync.Infer) > 0 {
				timeSyncMap1, err := timeToConstructSyncMap(ctx, artifact, cfg)
				if err != nil {
					if _, isNotSupported := err.(build.ErrSyncMapNotSupported); !isNotSupported {
						return fmt.Errorf("constructing inferred sync map: %w", err)
					}
				}
				timeSyncMap2, err := timeToConstructSyncMap(ctx, artifact, cfg)

View on GitHub (pinned to a1189de023)

Solutions

  1. Check the wrapped underlying error for the specific buildlet failure
  2. Install/verify required build tools (mvn, gradle) on PATH for Jib artifacts
  3. Verify the artifact's workspace path and dependency configuration in skaffold.yaml
  4. Run the underlying build tool's dependency command manually in the workspace

Example fix

// before: jib artifact without maven installed
skaffold diagnose
// error: listing artifact dependencies: ... mvn: not found
// after
mvn -v && skaffold diagnose
Defensive patterns

Strategy: try-catch

Validate before calling

if a.JibArtifact != nil {
	if _, err := exec.LookPath("mvn"); err != nil {
		if _, err := exec.LookPath("gradle"); err != nil {
			return errors.New("install maven or gradle for jib dependency listing")
		}
	}
}

Try / catch

if err := CheckArtifacts(ctx, cfg, tags, out); err != nil {
	if strings.Contains(err.Error(), "listing artifact dependencies") {
		log.Warnf("dependency resolution failed: %v", err)
	}
}

Prevention

When it happens

Trigger: Running `skaffold diagnose` when SingleArtifactDependencies fails for an artifact — e.g. Jib/Buildpack/Ko dependency resolution failing due to missing build tooling (mvn/gradle not installed), invalid workspace, or bad build configuration in skaffold.yaml.

Common situations: Jib artifacts with no Maven/Gradle wrapper available; custom dependency dependencies.json pointing to missing files; workspace path wrong in skaffold.yaml.

Related errors


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