{"record":{"id":"7901c26b84cdb480","repo":"spacedriveapp/spacedrive","slug":"both-source-and-target-must-be-directories","errorCode":null,"errorMessage":"Both source and target must be directories","messagePattern":"Both source and target must be directories","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/src/service/file_sync/conduit.rs","lineNumber":38,"sourceCode":"\t\t&self,\n\t\tsource_entry_id: i32,\n\t\ttarget_entry_id: i32,\n\t\tmode: sync_conduit::SyncMode,\n\t\tschedule: String,\n\t) -> Result<sync_conduit::Model> {\n\t\t// Validate entries exist and are directories\n\t\tlet source = entry::Entity::find_by_id(source_entry_id)\n\t\t\t.one(&*self.db)\n\t\t\t.await?\n\t\t\t.ok_or_else(|| anyhow::anyhow!(\"Source entry not found\"))?;\n\n\t\tlet target = entry::Entity::find_by_id(target_entry_id)\n\t\t\t.one(&*self.db)\n\t\t\t.await?\n\t\t\t.ok_or_else(|| anyhow::anyhow!(\"Target entry not found\"))?;\n\n\t\tif source.kind != 1 || target.kind != 1 {\n\t\t\treturn Err(anyhow::anyhow!(\n\t\t\t\t\"Both source and target must be directories\"\n\t\t\t));\n\t\t}\n\n\t\t// Check for duplicate conduits\n\t\tlet existing = sync_conduit::Entity::find()\n\t\t\t.filter(sync_conduit::Column::SourceEntryId.eq(source_entry_id))\n\t\t\t.filter(sync_conduit::Column::TargetEntryId.eq(target_entry_id))\n\t\t\t.one(&*self.db)\n\t\t\t.await?;\n\n\t\tif existing.is_some() {\n\t\t\treturn Err(anyhow::anyhow!(\n\t\t\t\t\"Conduit already exists between these entries\"\n\t\t\t));\n\t\t}\n\n\t\t// Create conduit","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/spacedriveapp/spacedrive/blob/6dfeccf2113039e35f2ce735f945e70dc3e4ea45/core/src/service/file_sync/conduit.rs#L20-L56","documentation":"Error \"Both source and target must be directories\" thrown in spacedriveapp/spacedrive.","triggerScenarios":"Thrown at core/src/service/file_sync/conduit.rs:38 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"}