{"record":{"id":"036bd79e9a1d56eb","repo":"facebook/relay","slug":"failed-to-get-current-exe-path","errorCode":null,"errorMessage":"Failed to get current exe path","messagePattern":"Failed to get current exe path","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"compiler/crates/relay-compiler/src/server_daemon.rs","lineNumber":370,"sourceCode":"/// to come up. The child is invoked as\n/// `<current_exe> server <extra_args> --project <p>... start --foreground <start_extra_args>`,\n/// with stdout/stderr redirected to the daemon log file derived from\n/// `config_path` and `projects`.\n///\n/// Polls the daemon socket once per second for up to 60 seconds. Exits the\n/// caller process with code 1 if the child exits during startup or fails\n/// to bind the socket within the timeout. `extra_args` is inserted before\n/// the project flags so callers can pass `Server`-subcommand-level options\n/// (e.g. the OSS relay-bin passes `--config <path>`). `start_extra_args`\n/// is appended after `--foreground` so callers can pass `Start`-subcommand-\n/// level options (e.g. `--initial-import-state <path>`).\npub async fn start_daemon_process(\n    config_path: &Path,\n    projects: &[String],\n    extra_args: &[String],\n    start_extra_args: &[String],\n) {\n    let current_exe = std::env::current_exe().expect(\"Failed to get current exe path\");\n    let mut args = vec![\"server\".to_string()];\n    args.extend(extra_args.iter().cloned());\n    for project in projects {\n        args.push(\"--project\".to_string());\n        args.push(project.clone());\n    }\n    args.push(\"start\".to_string());\n    args.push(\"--foreground\".to_string());\n    args.extend(start_extra_args.iter().cloned());\n\n    let log_path = get_log_file_path(config_path, projects);\n    let log_file = File::options()\n        .create(true)\n        .append(true)\n        .open(&log_path)\n        .expect(\"Failed to open daemon log file\");\n    let log_file_clone = log_file\n        .try_clone()","sourceCodeStart":352,"sourceCodeEnd":388,"githubUrl":"https://github.com/facebook/relay/blob/668b1b85e06261aa3b58dabfc51f8b5524a70955/compiler/crates/relay-compiler/src/server_daemon.rs#L352-L388","documentation":"Startup panic in start_daemon_process: the compiler server could not determine the path of its own executable via std::env::current_exe(). The daemon is relaunched by re-invoking the current binary, so without the exe path the watchdog cannot spawn the background server process and aborts immediately.","triggerScenarios":"Thrown at compiler/crates/relay-compiler/src/server_daemon.rs:370 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["On Linux, check that /proc is mounted and the exe entry is readable","Ensure the binary wasn't deleted or replaced while running (re-exec requires the original path to exist)","Run the compiler from a stable installed location rather than a temporary build artifact that gets cleaned up"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"668b1b85e06261aa3b58dabfc51f8b5524a70955","analyzedAt":"2026-09-02T19:57:20.783Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}