{"record":{"id":"08e0ec321d434554","repo":"facebook/flow","slug":"failed-to-read-executable-at-for-flow-build-id","errorCode":null,"errorMessage":"failed to read executable at {} for flow build id: {}","messagePattern":"failed to read executable at (.+?) for flow build id: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"rust_port/crates/flow_common_build_id/src/lib.rs","lineNumber":20,"sourceCode":" * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nuse std::sync::OnceLock;\n\nuse flow_common_xx as xx;\n\nstatic BUILD_ID: OnceLock<String> = OnceLock::new();\n\npub fn get_build_id() -> String {\n    BUILD_ID\n        .get_or_init(|| {\n            let mut state = xx::State::new(0);\n            let executable = std::env::current_exe().expect(\"failed to get executable path\");\n            let contents = std::fs::read(&executable).unwrap_or_else(|err| {\n                panic!(\n                    \"failed to read executable at {} for flow build id: {}\",\n                    executable.display(),\n                    err\n                )\n            });\n            state.update(&contents);\n            let hash = format!(\"{:016x}\", state.digest());\n            hash\n        })\n        .clone()\n}\n","sourceCodeStart":2,"sourceCodeEnd":32,"githubUrl":"https://github.com/facebook/flow/blob/f88ac94bcf6992f5d5a158854d94613ebb92c6e6/rust_port/crates/flow_common_build_id/src/lib.rs#L2-L32","documentation":"The flow build id is an xxhash of the running executable's own bytes, computed once per process via BUILD_ID. current_exe() succeeded but std::fs::read of the executable failed, so the binary's bytes are no longer readable: the file was deleted or replaced after start (inode gone), read permission was lost, or the underlying storage returned an I/O error.","triggerScenarios":"Package manager reinstalls/upgrades flow while a daemon or long-running command started from the old binary is alive; the executable is removed by cleanup scripts or antivirus quarantine; disk/media I/O errors when reading the binary.","commonSituations":"Continuous-deploy or CI flows that 'rm -rf node_modules && npm install' with a running flow server; antivirus/EDR quarantining the binary on Windows; NFS homes with transient read failures.","solutions":["Restart flow processes (flow stop, rerun command) so build id is computed from the current binary","Reinstall the flow package if the executable was deleted","Stop deleting/replacing the binary underneath running flow processes; upgrade then restart","Check AV/EDR exclusions if the binary keeps becoming unreadable"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"# sanity: the running binary is still readable\ncat \"$(readlink -f /proc/self/exe)\" > /dev/null || echo \"self binary unreadable\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Upgrade-then-restart: never reinstall flow underneath a live daemon","Add AV/EDR exclusions for the flow binary if quarantine is suspected","Skip 'rm -rf node_modules' style cleanups while flow servers are running"],"tags":["environment","upgrade","build-id","self-path","io"],"backgroundTag":"self-executable-read-failed","analyzedSha":"f88ac94bcf6992f5d5a158854d94613ebb92c6e6","analyzedAt":"2026-08-20T10:41:37.992Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}