GoogleContainerTools/skaffold · error

watching files for deployer: %w

Error message

watching files for deployer: %w

What it means

Dev() registers the deployer's dependencies (manifest files the deployer consumes) with the file monitor so changes trigger redeploy. Failure emits DEVINIT_REGISTER_DEPLOY_DEPS and returns 'watching files for deployer', aborting dev mode during init.

Source

Thrown at pkg/skaffold/runner/dev.go:444

	if err := r.monitor.Register(
		r.renderer.ManifestDeps,
		func(filemon.Events) { r.changeSet.Redeploy() },
	); err != nil {
		event.DevLoopFailedWithErrorCode(r.devIteration, proto.StatusCode_DEVINIT_REGISTER_RENDER_DEPS, err)
		eventV2.TaskFailed(constants.DevLoop, err)
		endTrace()
		return fmt.Errorf("watching files for renderer: %w", err)
	}

	// Watch deployment configuration
	if err := r.monitor.Register(
		r.deployer.Dependencies,
		func(filemon.Events) { r.changeSet.Redeploy() },
	); err != nil {
		event.DevLoopFailedWithErrorCode(r.devIteration, proto.StatusCode_DEVINIT_REGISTER_DEPLOY_DEPS, err)
		eventV2.TaskFailed(constants.DevLoop, err)
		endTrace()
		return fmt.Errorf("watching files for deployer: %w", err)
	}

	// Watch Skaffold configuration
	if err := r.monitor.Register(
		func() ([]string, error) { return []string{r.runCtx.ConfigurationFile()}, nil },
		func(filemon.Events) { r.changeSet.Reload() },
	); err != nil {
		event.DevLoopFailedWithErrorCode(r.devIteration, proto.StatusCode_DEVINIT_REGISTER_CONFIG_DEP, err)
		eventV2.TaskFailed(constants.DevLoop, err)
		endTrace()
		return fmt.Errorf("watching skaffold configuration %q: %w", r.runCtx.ConfigurationFile(), err)
	}

	log.Entry(ctx).Infoln("List generated in", timeutil.Humanize(time.Since(start)))
	log.Entry(ctx).Infoln("Dev loop completed in", timeutil.Humanize(time.Since(devStart)))

	// Init Sync State
	if err := sync.Init(ctx, artifacts); err != nil {

View on GitHub (pinned to a1189de023)

Solutions

  1. Fix the deploy manifest paths in skaffold.yaml so dependency enumeration succeeds
  2. Validate manifests standalone: `kustomize build <dir>` or `helm template`
  3. Check file permissions on the referenced manifest files
  4. Raise inotify watch limits if the watcher cannot be created

Example fix

// before
deploy:
  kustomize: {paths: ['k8s/base']}  # base has broken reference
// after
deploy:
  kustomize: {paths: ['k8s/overlays/dev']}
Defensive patterns

Strategy: validation

Validate before calling

// pre-validate deployer dependencies
if err := exec.Command("kustomize", "build", deployDir).Run(); err != nil {
    return fmt.Errorf("kustomize build failed before dev: %w", err)
}

Prevention

When it happens

Trigger: `r.monitor.Register(r.deployer.Dependencies, ...)` errors — the deployer (kubectl/helm/kpt) cannot enumerate its input manifests, e.g. kustomize build fails while listing dependencies, or the watcher registration fails.

Common situations: kubectl deployer given kustomize paths that don't build; helm values files missing; remote bases unresolvable; file permission errors; inotify watch exhaustion.

Related errors


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