{"record":{"id":"5551b18e645175f9","repo":"BloopAI/vibe-kanban","slug":"copy-files-task-failed-e","errorCode":null,"errorMessage":"Copy files task failed: {e}","messagePattern":"Copy files task failed: (.+?)","errorType":"exception","errorClass":"ContainerError","httpStatus":null,"severity":"error","filePath":"crates/local-deployment/src/container.rs","lineNumber":1600,"sourceCode":"    async fn copy_project_files(\n        &self,\n        source_dir: &Path,\n        target_dir: &Path,\n        copy_files: &str,\n    ) -> Result<(), ContainerError> {\n        let source_dir = source_dir.to_path_buf();\n        let target_dir = target_dir.to_path_buf();\n        let copy_files = copy_files.to_string();\n\n        tokio::time::timeout(\n            std::time::Duration::from_secs(30),\n            tokio::task::spawn_blocking(move || {\n                copy::copy_project_files_impl(&source_dir, &target_dir, &copy_files)\n            }),\n        )\n        .await\n        .map_err(|_| ContainerError::Other(anyhow!(\"Copy project files timed out after 30s\")))?\n        .map_err(|e| ContainerError::Other(anyhow!(\"Copy files task failed: {e}\")))?\n    }\n\n    async fn kill_all_running_processes(&self) -> Result<(), ContainerError> {\n        tracing::info!(\"Killing all running processes\");\n        let running_processes = ExecutionProcess::find_running(&self.db.pool).await?;\n\n        tracing::info!(\n            \"Found {} running processes to kill\",\n            running_processes.len()\n        );\n\n        for process in running_processes {\n            tracing::info!(\n                \"Killing process: id={}, run_reason={:?}\",\n                process.id,\n                process.run_reason\n            );\n            if let Err(error) = self","sourceCodeStart":1582,"sourceCodeEnd":1618,"githubUrl":"https://github.com/BloopAI/vibe-kanban/blob/4deb7eca8f381f7cbc1f9d15515a9ab8f8009053/crates/local-deployment/src/container.rs#L1582-L1618","documentation":"This error wraps the JoinError or inner error from the spawned blocking copy task: if the spawned task panicked or was cancelled before completing, JoinError yields 'Copy files task failed: {e}'. (The inner copy error itself is propagated separately.) It means the background copy task died abnormally.","triggerScenarios":"copy_project_files_impl panics inside spawn_blocking (e.g. unexpected filesystem state, invalid UTF-8 assumptions), or the blocking task is cancelled (e.g. by the 30s timeout in [131] racing, or runtime shutdown).","commonSituations":"Bug-triggered panics in the copy implementation on exotic paths (symlinks, permission-denied dirs handled with unwrap); shutting down the runtime mid-copy; a panic in a nested copy helper.","solutions":["Read the wrapped '{e}' message to find the underlying panic or join error and fix the root cause in copy_project_files_impl.","Fix filesystem-level issues (permissions, broken symlinks) in the source directory before copying.","Retry the copy operation; transient cancellations may succeed on a second attempt.","Harden copy_project_files_impl to return errors instead of panicking on edge-case paths."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// sanity-check inputs before spawning the blocking task\nif !source_dir.is_dir() {\n    return Err(anyhow!(\"source dir missing: {}\", source_dir.display()));\n}","typeGuard":null,"tryCatchPattern":"match copy_project_files(...).await {\n    Err(ContainerError::Other(e)) if e.to_string().starts_with(\"Copy files task failed\") => {\n        tracing::error!(%e, \"copy task panicked/cancelled; inspect root cause\");\n    }\n    other => other?,\n}","preventionTips":["Avoid unwrap/expect in copy_project_files_impl; return Results instead.","Pre-check permissions and symlink validity in the source tree.","Avoid cancelling the runtime while copies are in flight."],"tags":["panic","tokio","filesystem","task-join"],"backgroundTag":"background-task-panicked","analyzedSha":"4deb7eca8f381f7cbc1f9d15515a9ab8f8009053","analyzedAt":"2026-08-29T09:24:13.446Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}