{"record":{"id":"c680d5d5ffa880ce","repo":"tracel-ai/burn","slug":"can-bind-the-burn-remote-server-endpoint","errorCode":null,"errorMessage":"Can bind the Burn Remote server endpoint","messagePattern":"Can bind the Burn Remote server endpoint","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-remote/src/transport/iroh/server.rs","lineNumber":30,"sourceCode":"use std::sync::Arc;\n\n/// Serve Burn Remote over Iroh until the process receives its shutdown signal.\n///\n/// Binds a server endpoint with the stable identity carried by `secret` and hosts `devices` as the\n/// sole protocol on it. Reached through [`RemoteServerBuilder`](super::RemoteServerBuilder) (the\n/// single turnkey entry point); use [`RemoteNode::protocol`] for composition with other protocols.\n#[cfg(not(target_family = \"wasm\"))]\npub(crate) async fn start_iroh_async<B: BackendIr>(\n    secret: crate::RemoteSecret,\n    devices: Vec<Device<B>>,\n    custom_ops: CustomOpRegistry<B>,\n) {\n    let endpoint = Endpoint::builder(presets::N0)\n        .secret_key(secret.secret_key())\n        .alpns(vec![BURN_REMOTE_ALPN.to_vec()])\n        .bind()\n        .await\n        .expect(\"Can bind the Burn Remote server endpoint\");\n\n    let probe = if crate::metrics::TelemetryLogger::enabled() {\n        TelemetryProbe::new(crate::telemetry::CHANNEL_CAPACITY)\n    } else {\n        TelemetryProbe::disabled()\n    };\n\n    let protocol = IrohRemoteProtocol::new(\n        endpoint.clone(),\n        devices,\n        Arc::new(AllowAll),\n        probe,\n        custom_ops,\n    );\n\n    let router = Router::builder(endpoint)\n        .accept(BURN_REMOTE_ALPN, protocol)\n        .spawn();","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-remote/src/transport/iroh/server.rs#L12-L48","documentation":"start_iroh_async binds the iroh Endpoint (with the Burn Remote ALPN) and expects the bind to succeed. Panic means the iroh transport could not establish its endpoint — typically network, relay, or key issues.","triggerScenarios":"Server startup with the iroh feature when Endpoint::bind() fails: no network interface, DNS/resolver issues reaching n0 discovery, invalid secret key, port/socket unavailable.","commonSituations":"Firewalled or offline environments; corporate proxies blocking the n0 discovery/relay; misconfigured secret key material; iroh crate version mismatch.","solutions":["Verify the machine has working network access and UDP connectivity for iroh","Check that the provided secret key is a valid key (from the secret source) and not corrupted/misloaded","Test reachability of the n0 discovery/relay services from your environment","Retry the bind; transient DNS or network failures at startup resolve on retry"],"exampleFix":"// before\nlet endpoint = Endpoint::builder(presets::N0)\n    .secret_key(secret.secret_key())\n    .alpns(vec![BURN_REMOTE_ALPN.to_vec()])\n    .bind()\n    .await\n    .expect(\"Can bind the Burn Remote server endpoint\");\n// after\nlet endpoint = Endpoint::builder(presets::N0)\n    .secret_key(secret.secret_key())\n    .alpns(vec![BURN_REMOTE_ALPN.to_vec()])\n    .bind()\n    .await\n    .unwrap_or_else(|e| panic!(\"iroh bind failed: {e}; check network/UDP and secret key\"));","handlingStrategy":"retry","validationCode":"// Check UDP/network availability before binding the iroh endpoint\nif std::net::UdpSocket::bind((\"0.0.0.0\", 0)).is_err() {\n    return Err(anyhow!(\"no UDP network available for iroh endpoint\"));\n}","typeGuard":null,"tryCatchPattern":"for attempt in 0..3 {\n    match Endpoint::builder(presets::N0).secret_key(secret.secret_key()).alpns(vec![BURN_REMOTE_ALPN.to_vec()]).bind().await {\n        Ok(ep) => break ep,\n        Err(e) if attempt < 2 => tokio::time::sleep(Duration::from_secs(2)).await,\n        Err(e) => return Err(anyhow!(\"iroh bind failed: {e}\")),\n    }\n}","preventionTips":["Verify UDP connectivity and n0 discovery/relay reachability before startup","Validate the secret key material loads correctly","Retry transient startup network failures with backoff"],"tags":["network","iroh","server","endpoint"],"backgroundTag":"endpoint-bind-failed","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"}