{"record":{"id":"4f24b5ba84d5d2d6","repo":"microsoft/typescript-go","slug":"inotify-add-watch-on-s-failed-w","errorCode":null,"errorMessage":"inotify_add_watch on '%s' failed: %w","messagePattern":"inotify_add_watch on '(.+?)' failed: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/fswatch/inotify_linux.go","lineNumber":219,"sourceCode":"// Called by removeSharedBackend when the last watch drops. Reads\n// the pipe write fd via atomic so it's safe to race against the start\n// goroutine's deferred closeFDs.\nfunc (b *inotifyBackend) shutdown() {\n\tfd := b.pipeWriteFD.Load()\n\tif fd < 0 {\n\t\treturn\n\t}\n\t_, _ = unix.Write(int(fd), []byte{'X'})\n\t<-b.endedSignal\n}\n\n// subscribe mirrors `inotifyBackend::subscribe`. Called via the watcherBase\n// virtual dispatch under b.mu (so it's serialized against handleEvent).\nfunc (b *inotifyBackend) subscribe(w *dirWatch) error {\n\tif !w.recursive {\n\t\tif _, err := b.watchDir(w, w.dir, w.physicalDir); err != nil {\n\t\t\treturn &dirWatchError{\n\t\t\t\terr:      fmt.Errorf(\"inotify_add_watch on '%s' failed: %w\", w.dir, err),\n\t\t\t\tdirWatch: w,\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}\n\tif err := walkDir(w.physicalDir, true, func(watchPath string, isDir bool) error {\n\t\tif !isDir {\n\t\t\treturn nil\n\t\t}\n\t\tpath := w.displayPath(watchPath)\n\t\tif _, err := b.watchDir(w, path, watchPath); err != nil {\n\t\t\treturn &dirWatchError{\n\t\t\t\terr:      fmt.Errorf(\"inotify_add_watch on '%s' failed: %w\", path, err),\n\t\t\t\tdirWatch: w,\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}); err != nil {","sourceCodeStart":201,"sourceCodeEnd":237,"githubUrl":"https://github.com/microsoft/typescript-go/blob/1bcfa18d79a3be41772223d5c05dfe4480e614ff/internal/fswatch/inotify_linux.go#L201-L237","documentation":"Error \"inotify_add_watch on '%s' failed: %w\" thrown in microsoft/typescript-go.","triggerScenarios":"Thrown at internal/fswatch/inotify_linux.go:219 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1bcfa18d79a3be41772223d5c05dfe4480e614ff","analyzedAt":"2026-08-16T02:12:00.115Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}