{"record":{"id":"ca919eb0ba8128d5","repo":"GoogleContainerTools/skaffold","slug":"schema-q-not-found-w","errorCode":null,"errorMessage":"schema %q not found: %w","messagePattern":"schema %q not found: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/skaffold/app/cmd/schema/print.go","lineNumber":34,"sourceCode":"\npackage schema\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"path\"\n\t\"strings\"\n\n\t\"github.com/GoogleContainerTools/skaffold/v2/fs\"\n)\n\n// Print prints the json schema for a given version.\nfunc Print(out io.Writer, version string) error {\n\tfilename := path.Join(\"assets/schemas_generated\", strings.TrimPrefix(version, \"skaffold/\")+\".json\")\n\n\tcontent, err := fs.AssetsFS.ReadFile(filename)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"schema %q not found: %w\", version, err)\n\t}\n\n\t_, err = out.Write(content)\n\treturn err\n}\n","sourceCodeStart":16,"sourceCodeEnd":40,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/cmd/skaffold/app/cmd/schema/print.go#L16-L40","documentation":"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`.","triggerScenarios":"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`).","commonSituations":"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.","solutions":["Run `skaffold schema list` and use one of the exact versions it prints.","Ensure the version includes the `skaffold/` prefix if your tooling strips or expects it (e.g. `skaffold/v2.13.2`).","Upgrade skaffold to a build that includes the schema asset for the version you need."],"exampleFix":"// before\nskaffold schema print --version v2.13.2\n// after\nskaffold schema print --version skaffold/v2.13.2","handlingStrategy":"validation","validationCode":"allowed := exec.Command(\"skaffold\", \"schema\", \"list\", \"--output\", \"json\").Output()\nif !strings.Contains(string(allowed), \"\\\"skaffold/v2.13.2\\\"\") {\n    return fmt.Errorf(\"schema version %s not supported\", version)\n}","typeGuard":null,"tryCatchPattern":"if err := schema.Print(w, version); err != nil {\n    var nf *fs.PathError\n    if errors.As(err, &nf) || strings.Contains(err.Error(), \"not found\") {\n        // prompt user with `skaffold schema list` output\n    }\n}","preventionTips":["Always source version strings from `skaffold schema list` output.","Keep the `skaffold/` prefix on version identifiers.","Pin schema versions your tooling supports in CI."],"tags":["cli","schema","not-found","skaffold"],"backgroundTag":"resource-not-found","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}