{"record":{"id":"8b236f459500bea0","repo":"tauri-apps/tauri","slug":"failed-to-read-missing-addr-file-e","errorCode":null,"errorMessage":"failed to read missing addr file {}: {e}","messagePattern":"failed to read missing addr file (.+?): (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tauri-cli/src/mobile/mod.rs","lineNumber":386,"sourceCode":"\n  Ok(OptionsHandle(runtime, handle))\n}\n\nfn read_options(config: &ConfigMetadata) -> CliOptions {\n  let runtime = tokio::runtime::Runtime::new().unwrap();\n  let options = runtime\n    .block_on(async move {\n      let addr_path = temp_dir().join(format!(\n        \"{}-server-addr\",\n        config\n          .original_identifier()\n          .context(\"app configuration is missing an identifier\")?\n      ));\n      let (tx, rx) = WsTransportClientBuilder::default()\n        .build(\n          format!(\n            \"ws://{}\",\n            read_to_string(&addr_path).unwrap_or_else(|e| panic!(\n              \"failed to read missing addr file {}: {e}\",\n              addr_path.display()\n            ))\n          )\n          .parse()\n          .unwrap(),\n        )\n        .await\n        .context(\"failed to build WebSocket client\")?;\n      let client: Client = ClientBuilder::default().build_with_tokio(tx, rx);\n      let options: CliOptions = client\n        .request(\"options\", rpc_params![])\n        .await\n        .context(\"failed to request options\")?;\n      Ok::<CliOptions, Error>(options)\n    })\n    .expect(\"failed to read CLI options\");\n","sourceCodeStart":368,"sourceCodeEnd":404,"githubUrl":"https://github.com/tauri-apps/tauri/blob/52e4b6e71d8632a7e648f866c442e287ecddee34/crates/tauri-cli/src/mobile/mod.rs#L368-L404","documentation":"Panic in the mobile dev runtime support code. During `tauri ios dev`/`tauri android dev`, the CLI-side build step reads the temp file `{TMPDIR}/{identifier}-server-addr` (written by the running tauri CLI dev server) to learn the WebSocket address of the dev server, and read_to_string failure panics here. The identifier comes from the app configuration, so a mismatch yields a different filename than the one that was written.","triggerScenarios":"The dev server process died or never wrote the addr file; identifier in tauri.conf.json changed between the CLI run and the Xcode/Gradle build step; TMPDIR differs between the CLI and the build tool process (sudo, sandboxed Xcode service, macOS per-user temp dirs); a second dev session overwrote/removed it.","commonSituations":"Editing `identifier` mid-session; running Xcode builds with sudo or from a different login session; concurrent `tauri dev` runs on the same app; temp dir cleaners removing the file mid-build.","solutions":["Stop all tauri dev processes and re-run `tauri ios dev` / `tauri android dev` from a clean shell so server and build step share one session","Keep the app identifier stable in tauri.conf.json while iterating on mobile dev","Run the CLI and the IDE/build on the same user without sudo so TMPDIR resolves identically"],"exampleFix":"# before\n# Xcode step panics: failed to read missing addr file /tmp/com.example.app-server-addr\n\n# after\npkill -f 'tauri.*dev' || true\nnpx tauri ios dev   # single session writes and reads the same {identifier}-server-addr file","handlingStrategy":"retry","validationCode":"# ensure no orphan dev servers before starting (stale/missing addr file is the usual cause)\npkill -f 'tauri.*dev' || true\nls \"${TMPDIR:-/tmp}\"/*-server-addr 2>/dev/null && echo 'stale addr file present; previous session crashed?'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run one `tauri dev` session per app; kill leftovers before starting","Never change `identifier` while a mobile dev session is open","Run the CLI and Xcode/Gradle as the same user (no sudo) so the temp dir matches"],"tags":["mobile","dev-server","websocket","tauri-cli","ios","android","temp-files"],"backgroundTag":"dev-server-connection-failed","analyzedSha":"52e4b6e71d8632a7e648f866c442e287ecddee34","analyzedAt":"2026-08-20T13:59:20.734Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}