{"record":{"id":"aae80508a449d380","repo":"facebook/relay","slug":"watchman-subscription-error-err","errorCode":null,"errorMessage":"Watchman subscription error: {err}","messagePattern":"Watchman subscription error: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"compiler/crates/relay-compiler/src/compiler.rs","lineNumber":319,"sourceCode":"                            Ok(FileSourceSubscriptionNextChange::TestSourceControlUpdateEnter) => {\n                                info!(\"Test: source control update started...\");\n                                source_control_update_status.mark_as_started();\n                            }\n                            Ok(FileSourceSubscriptionNextChange::TestSourceControlUpdateLeave) => {\n                                info!(\"Test: source control update completed.\");\n                                source_control_update_status.set_to_default();\n                                if restart_recheck_pending_for_subscription.swap(false, SeqCst) {\n                                    notify_sender.notify_one();\n                                }\n                            }\n                            Ok(FileSourceSubscriptionNextChange::TestSourceControlUpdate) => {\n                                info!(\"Test: source control update with new base revision...\");\n                                source_control_update_status.mark_as_completed();\n                                notify_sender.notify_one();\n                                break;\n                            }\n                            Err(err) => {\n                                panic!(\"Watchman subscription error: {err}\");\n                            }\n                        }\n                    }\n                });\n\n                Ok((compiler_state, notify_receiver, subscription_handle, restart_recheck_pending))\n\n            }\n            .await;\n\n            match result {\n                Ok((\n                    mut compiler_state,\n                    notify_receiver,\n                    subscription_handle,\n                    restart_recheck_pending,\n                )) => {\n                    let mut red_to_green = RedToGreen::new();","sourceCodeStart":301,"sourceCodeEnd":337,"githubUrl":"https://github.com/facebook/relay/blob/668b1b85e06261aa3b58dabfc51f8b5524a70955/compiler/crates/relay-compiler/src/compiler.rs#L301-L337","documentation":"The watch-mode file watching thread panics when the Watchman subscription returns an Err. Watchman is used to observe source file changes; a subscription failure kills that worker thread, interrupting continuous compilation.","triggerScenarios":"Inside watch(), the spawned subscription thread receives Err(err) from a Watchman subscription event/request and calls panic!(\"Watchman subscription error: {err}\").","commonSituations":"Watchman daemon not running or crashed, watchman project not settled (`watchman watch-del-all`), file limit/permission issues in the watched directory, or Watchman socket/env problems (TMPDIR mismatches).","solutions":["Run `watchman watch-del-all` then `watchman shutdown-server` and restart the compiler","Ensure Watchman is installed, running (`watchman version`), and the project is inside a watchable path","Fix watched-directory issues (inotify limits, permissions, deleted source roots) or disable watch mode and run a single compile"],"exampleFix":"// shell\nwatchman watch-del-all\nwatchman shutdown-server\n# then restart\nrelay-compiler --watch","handlingStrategy":"retry","validationCode":"# Validate Watchman before starting watch mode\nwatchman version || { echo 'watchman not running'; exit 1; }\nwatchman watch-project .","typeGuard":null,"tryCatchPattern":"try {\n  startRelayWatch();\n} catch (e) {\n  if (/Watchman subscription error/.test(String(e))) {\n    execSync('watchman watch-del-all');\n    execSync('watchman shutdown-server');\n    startRelayWatch(); // retry once, else fall back to non-watch build\n  } else throw e;\n}","preventionTips":["Keep Watchman installed, running, and up to date","Reset watches periodically on large repos (watchman watch-del-all)","Raise inotify/fs limits and avoid watching deleted or permission-denied roots","Fall back to one-shot (non-watch) compiles in constrained CI environments"],"tags":["watchman","file-watching","rust","panic","compiler"],"backgroundTag":"watchman-subscription-error","analyzedSha":"668b1b85e06261aa3b58dabfc51f8b5524a70955","analyzedAt":"2026-09-02T19:57:20.783Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}