{"record":{"id":"ca0cf73939da7fe8","repo":"tracel-ai/burn","slug":"remote-service-has-not-connected-to-this-device-ye","errorCode":null,"errorMessage":"Remote service has not connected to this device yet","messagePattern":"Remote service has not connected to this device yet","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-remote/src/client/service/registry.rs","lineNumber":103,"sourceCode":"        .by_index\n        .get(&id)\n        .map(|entry| (entry.endpoint.clone(), entry.device_index))\n}\n\n/// The runtime captured for `id`'s device at construction, used to drive its session tasks.\npub(crate) fn executor_for(id: u32) -> Option<Executor> {\n    registry()\n        .lock()\n        .unwrap()\n        .by_index\n        .get(&id)\n        .map(|entry| entry.executor.clone())\n}\n\npub(crate) fn settings_for(id: u32) -> DeviceSettings {\n    *settings_cell(id)\n        .get()\n        .expect(\"Remote service has not connected to this device yet\")\n}\n\npub(crate) fn has_settings(id: u32) -> bool {\n    registry()\n        .lock()\n        .unwrap()\n        .by_index\n        .get(&id)\n        .is_some_and(|entry| entry.settings.get().is_some())\n}\n\npub(crate) fn settings_cell(id: u32) -> Arc<OnceLock<DeviceSettings>> {\n    registry()\n        .lock()\n        .unwrap()\n        .by_index\n        .get(&id)\n        .expect(\"Device id not registered\")","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-remote/src/client/service/registry.rs#L85-L121","documentation":"This panic means the burn-remote client registry holds no DeviceSettings OnceLock for the requested device id, i.e. the remote service never published settings for it. settings_for unwraps the OnceLock and panics if it is still empty.","triggerScenarios":"Calling settings_for(id) (directly or via client setup paths) before the remote service connection handshake has populated settings for that device id, or with an id that the service never registered.","commonSituations":"Querying device settings immediately after creating a client without awaiting connection; device id mismatch between client and server; server crashed before advertising settings.","solutions":["Ensure the client has fully connected (and the service has registered the device) before calling settings_for","Verify the device id is one the remote service actually exposes (check registry with has_settings)","Check server logs for failed startup/handshake that would prevent settings publication","Retry after connection is established rather than calling settings_for eagerly"],"exampleFix":"// before\nlet settings = settings_for(device_id);\n// after\nif !has_settings(device_id) {\n    // wait for connection / register the device first\n}\nlet settings = settings_for(device_id);","handlingStrategy":"validation","validationCode":"if !registry::has_settings(device_id) {\n    // wait for connection / register the device before proceeding\n    return Err(anyhow!(\"settings for device {device_id} not yet available\"));\n}\nlet settings = registry::settings_for(device_id);","typeGuard":null,"tryCatchPattern":"let settings = std::panic::catch_unwind(|| registry::settings_for(device_id))\n    .map_err(|_| anyhow!(\"remote service not connected for device {device_id}\"))?;","preventionTips":["Check has_settings(id) before calling settings_for","Only query device settings after the client connection handshake completes","Log and validate device ids received from the server before use"],"tags":["rust","remote","state","initialization"],"backgroundTag":"device-not-connected","analyzedSha":"d16f7ba2ed0d41408189384044cc886fb4c8f957","analyzedAt":"2026-09-05T13:19:14.260Z","contentChangedAt":"2026-09-05T13:19:14.260Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}