GoogleContainerTools/skaffold · error

could not expand the glob raw manifests: %w

Error message

could not expand the glob raw manifests: %w

What it means

Generate wraps resolveRemoteAndLocal failures: before returning it emits a DeployInfoEvent carrying 'could not expand the glob raw manifests'. It is the top-level signal that expanding the rawK8s globs (local paths, gs:// or http URLs) failed during render generation.

Source

Thrown at pkg/skaffold/render/generate/generate.go:125

	if len(urlManifests) != 0 {
		paths, err := manifest.DownloadFromURL(urlManifests)
		if err != nil {
			return nil, err
		}
		list = append(list, paths...)
	}
	return list, nil
}

// Generate parses the config resources from the paths in .Generate.Manifests. This path can be the path to raw manifest,
// kustomize manifests, helm charts or kpt function configs. All should be file-watched.
func (g Generator) Generate(ctx context.Context, out io.Writer) (manifest.ManifestList, error) {
	var manifests manifest.ManifestList

	// Generate Raw Manifests
	sourceManifests, err := resolveRemoteAndLocal(g.config.RawK8s, g.workingDir)
	if err != nil {
		event.DeployInfoEvent(fmt.Errorf("could not expand the glob raw manifests: %w", err))
		return nil, err
	}

	for _, nkPath := range sourceManifests {
		if !kubernetes.HasKubernetesFileExtension(nkPath) {
			if !stringslice.Contains(g.config.RawK8s, nkPath) {
				log.Entry(ctx).Infof("refusing to deploy/delete non {json, yaml} file %s", nkPath)
				log.Entry(ctx).Info("If you still wish to deploy this file, please specify it directly, outside a glob pattern.")
				continue
			}
		}
		manifestFileContent, err := os.ReadFile(nkPath)
		if err != nil {
			return nil, err
		}
		manifests.Append(manifestFileContent)
	}

View on GitHub (pinned to a1189de023)

Solutions

  1. Check every rawK8s path/glob resolves from the skaffold.yaml directory: ls the pattern yourself
  2. Fix relative paths or set the correct working dir when invoking skaffold
  3. Ensure matched files have Kubernetes extensions (.yaml/.yml/.json)
  4. Inspect the emitted DeployInfoEvent/underlying error for the root cause (GCS vs local glob)

Example fix

// before
rawK8s:
  - ./k8s/*.yamml   # typo
// after
rawK8s:
  - ./k8s/*.yaml
Defensive patterns

Strategy: validation

Validate before calling

for p in $(yq '.render.generate.rawK8s[]' skaffold.yaml); do ls $p || echo "unresolvable: $p"; done

Try / catch

manifests, err := gen.Generate(ctx, out)
if err != nil {
    event.Subscribe(func(e event.DeployInfoEvent) { log.Printf("generate issue: %v", e.Err) })
}

Prevention

When it happens

Trigger: Calling Generator.Generate (via skaffold render/dev/deploy) where rawK8s contains a glob that matches nothing, points outside the working dir, or whose remote download failed — resolveRemoteAndLocal returns err and this event fires.

Common situations: Typo in a rawK8s glob pattern; manifests directory deleted or wrong relative path (workingDir mismatch); missing file-extension filter causing path checks to fail; referenced remote manifest unreachable.

Related errors


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