GoogleContainerTools/skaffold · error

schema %q not found: %w

Error message

schema %q not found: %w

What it means

Print() reads the JSON schema file for a requested skaffold version from the embedded assets filesystem at assets/schemas_generated/<version>.json. If that file does not exist (unknown version, missing `skaffold/` prefix handling, or corrupted assets), the read error is wrapped as `schema %q not found`.

Source

Thrown at cmd/skaffold/app/cmd/schema/print.go:34

package schema

import (
	"fmt"
	"io"
	"path"
	"strings"

	"github.com/GoogleContainerTools/skaffold/v2/fs"
)

// Print prints the json schema for a given version.
func Print(out io.Writer, version string) error {
	filename := path.Join("assets/schemas_generated", strings.TrimPrefix(version, "skaffold/")+".json")

	content, err := fs.AssetsFS.ReadFile(filename)
	if err != nil {
		return fmt.Errorf("schema %q not found: %w", version, err)
	}

	_, err = out.Write(content)
	return err
}

View on GitHub (pinned to a1189de023)

Solutions

  1. Run `skaffold schema list` and use one of the exact versions it prints.
  2. Ensure the version includes the `skaffold/` prefix if your tooling strips or expects it (e.g. `skaffold/v2.13.2`).
  3. Upgrade skaffold to a build that includes the schema asset for the version you need.

Example fix

// before
skaffold schema print --version v2.13.2
// after
skaffold schema print --version skaffold/v2.13.2
Defensive patterns

Strategy: validation

Validate before calling

allowed := exec.Command("skaffold", "schema", "list", "--output", "json").Output()
if !strings.Contains(string(allowed), "\"skaffold/v2.13.2\"") {
    return fmt.Errorf("schema version %s not supported", version)
}

Try / catch

if err := schema.Print(w, version); err != nil {
    var nf *fs.PathError
    if errors.As(err, &nf) || strings.Contains(err.Error(), "not found") {
        // prompt user with `skaffold schema list` output
    }
}

Prevention

When it happens

Trigger: Calling `skaffold schema print` (or Print(out, version)) with a version string that has no generated schema asset, e.g. `skaffold schema print --version 9.9.9` or a typo like `v2.0.0` instead of `skaffold/v2.0.0` (the prefix is TrimPrefix'd, so `skaffold/v2.0.0` maps to `assets/schemas_generated/v2.0.0.json`).

Common situations: Asking for a schema version newer than the installed skaffold binary supports; requesting versions of other tools; automation piping versions from `schema list` output that includes the `skaffold/` prefix inconsistently.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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