{"record":{"id":"ed63d125ddc3c998","repo":"spacedriveapp/spacedrive","slug":"failed-to-finish-stream-ed63d1","errorCode":null,"errorMessage":"Failed to finish stream: {}","messagePattern":"Failed to finish stream: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"core/src/service/network/protocol/sync/transport.rs","lineNumber":95,"sourceCode":"\t\t\t})?;\n\n\t\t// Open a unidirectional stream and send the message\n\t\tlet mut send = conn\n\t\t\t.open_uni()\n\t\t\t.await\n\t\t\t.map_err(|e| anyhow::anyhow!(\"Failed to open stream: {}\", e))?;\n\n\t\tsend.write_all(&bytes).await.map_err(|e| {\n\t\t\twarn!(\n\t\t\t\tdevice_uuid = %target_device,\n\t\t\t\terror = %e,\n\t\t\t\t\"Failed to write sync message to stream\"\n\t\t\t);\n\t\t\tanyhow::anyhow!(\"Failed to write message: {}\", e)\n\t\t})?;\n\n\t\tsend.finish()\n\t\t\t.map_err(|e| anyhow::anyhow!(\"Failed to finish stream: {}\", e))?;\n\n\t\tdebug!(\n\t\t\tdevice_uuid = %target_device,\n\t\t\tnode_id = %node_id,\n\t\t\tbytes_sent = bytes.len(),\n\t\t\t\"Sync message sent successfully\"\n\t\t);\n\n\t\tOk(())\n\t}\n\n\t/// Send a sync request and wait for response\n\t///\n\t/// Uses bidirectional streams for proper request/response pattern (Iroh best practice)\n\tasync fn send_sync_request(\n\t\t&self,\n\t\ttarget_device: Uuid,\n\t\trequest: SyncMessage,","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/spacedriveapp/spacedrive/blob/6dfeccf2113039e35f2ce735f945e70dc3e4ea45/core/src/service/network/protocol/sync/transport.rs#L77-L113","documentation":"Error \"Failed to finish stream: {}\" thrown in spacedriveapp/spacedrive.","triggerScenarios":"Thrown at core/src/service/network/protocol/sync/transport.rs:95 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6dfeccf2113039e35f2ce735f945e70dc3e4ea45","analyzedAt":"2026-08-16T11:26:17.074Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}