{"record":{"id":"08d9d8d17463bdf7","repo":"GoogleContainerTools/skaffold","slug":"watching-skaffold-configuration-q-w","errorCode":null,"errorMessage":"watching skaffold configuration %q: %w","messagePattern":"watching skaffold configuration %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/runner/dev.go","lineNumber":455,"sourceCode":"\tif err := r.monitor.Register(\n\t\tr.deployer.Dependencies,\n\t\tfunc(filemon.Events) { r.changeSet.Redeploy() },\n\t); err != nil {\n\t\tevent.DevLoopFailedWithErrorCode(r.devIteration, proto.StatusCode_DEVINIT_REGISTER_DEPLOY_DEPS, err)\n\t\teventV2.TaskFailed(constants.DevLoop, err)\n\t\tendTrace()\n\t\treturn fmt.Errorf(\"watching files for deployer: %w\", err)\n\t}\n\n\t// Watch Skaffold configuration\n\tif err := r.monitor.Register(\n\t\tfunc() ([]string, error) { return []string{r.runCtx.ConfigurationFile()}, nil },\n\t\tfunc(filemon.Events) { r.changeSet.Reload() },\n\t); err != nil {\n\t\tevent.DevLoopFailedWithErrorCode(r.devIteration, proto.StatusCode_DEVINIT_REGISTER_CONFIG_DEP, err)\n\t\teventV2.TaskFailed(constants.DevLoop, err)\n\t\tendTrace()\n\t\treturn fmt.Errorf(\"watching skaffold configuration %q: %w\", r.runCtx.ConfigurationFile(), err)\n\t}\n\n\tlog.Entry(ctx).Infoln(\"List generated in\", timeutil.Humanize(time.Since(start)))\n\tlog.Entry(ctx).Infoln(\"Dev loop completed in\", timeutil.Humanize(time.Since(devStart)))\n\n\t// Init Sync State\n\tif err := sync.Init(ctx, artifacts); err != nil {\n\t\tevent.DevLoopFailedWithErrorCode(r.devIteration, proto.StatusCode_SYNC_INIT_ERROR, err)\n\t\teventV2.TaskFailed(constants.DevLoop, err)\n\t\tendTrace()\n\t\treturn fmt.Errorf(\"exiting dev mode because initializing sync state failed: %w\", err)\n\t}\n\n\toutput.Yellow.Fprintln(out, \"Press Ctrl+C to exit\")\n\n\tevent.DevLoopComplete(r.devIteration)\n\teventV2.TaskSucceeded(constants.DevLoop)\n\tendTrace()","sourceCodeStart":437,"sourceCodeEnd":473,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/runner/dev.go#L437-L473","documentation":"Dev() watches the skaffold.yaml configuration file itself so changes trigger a reload. If registering that single file with the monitor fails, Skaffold emits DEVINIT_REGISTER_CONFIG_DEP and returns 'watching skaffold configuration <path>'. Registration here rarely fails from the dependency function (it returns a constant path); failures come from the file monitor itself.","triggerScenarios":"`r.monitor.Register(func() { return []string{r.runCtx.ConfigurationFile()}, nil }, ...)` errors — typically the watcher cannot add the config file path (file deleted mid-init, watch descriptor exhaustion, unsupported filesystem).","commonSituations":"skaffold.yaml deleted or renamed while dev initializes; running on a filesystem that doesn't support inotify/fsnotify (some network mounts); fs.inotify.max_user_watches exhausted.","solutions":["Confirm skaffold.yaml exists at the path shown in the error message","Raise inotify limits: `sysctl fs.inotify.max_user_watches=524288` and `max_user_instances`","Avoid running the watcher on network filesystems that don't support file events","Re-run `skaffold dev` from the project root"],"exampleFix":"// before: run from wrong directory\n$ skaffold dev -f configs/skaffold.yaml  # file moved\n// after\n$ cd project-root && skaffold dev","handlingStrategy":"validation","validationCode":"// ensure the config file exists and is on a watchable FS\nif _, err := os.Stat(\"skaffold.yaml\"); err != nil {\n    return fmt.Errorf(\"skaffold.yaml not found in cwd\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run skaffold from the directory containing skaffold.yaml","Don't rename/delete the config during dev","Use local filesystems, not network mounts, for watched files","Raise fs.inotify.max_user_watches"],"tags":["skaffold","file-watch","dev-loop","config"],"backgroundTag":"file-watch-registration-failed","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"}