{"record":{"id":"2d692814b231a96c","repo":"BloopAI/vibe-kanban","slug":"container-reference-not-found","errorCode":null,"errorMessage":"Container reference not found","messagePattern":"Container reference not found","errorType":"exception","errorClass":"ContainerError","httpStatus":null,"severity":"error","filePath":"crates/local-deployment/src/container.rs","lineNumber":1568,"sourceCode":"        // Merge all streams into one\n        Ok(Box::pin(futures::stream::select_all(streams)))\n    }\n\n    async fn try_commit_changes(&self, ctx: &ExecutionContext) -> Result<bool, ContainerError> {\n        if !matches!(\n            ctx.execution_process.run_reason,\n            ExecutionProcessRunReason::CodingAgent | ExecutionProcessRunReason::CleanupScript,\n        ) {\n            return Ok(false);\n        }\n\n        let message = self.get_commit_message(ctx).await;\n\n        let container_ref = ctx\n            .workspace\n            .container_ref\n            .as_ref()\n            .ok_or_else(|| ContainerError::Other(anyhow!(\"Container reference not found\")))?;\n        let workspace_root = PathBuf::from(container_ref);\n\n        let repos_with_changes = self.check_repos_for_changes(&workspace_root, &ctx.repos)?;\n        if repos_with_changes.is_empty() {\n            tracing::debug!(\"No changes to commit in any repository\");\n            return Ok(false);\n        }\n\n        Ok(self.commit_repos(repos_with_changes, &message))\n    }\n\n    /// Copy files from the original project directory to the worktree.\n    /// Skips files that already exist at target with same size.\n    async fn copy_project_files(\n        &self,\n        source_dir: &Path,\n        target_dir: &Path,\n        copy_files: &str,","sourceCodeStart":1550,"sourceCodeEnd":1586,"githubUrl":"https://github.com/BloopAI/vibe-kanban/blob/4deb7eca8f381f7cbc1f9d15515a9ab8f8009053/crates/local-deployment/src/container.rs#L1550-L1586","documentation":"In try_commit_changes, the code reads ctx.workspace.container_ref and errors out if it is None. container_ref is the filesystem path of the workspace container; local deployments always set it, so None means the workspace record lacks a valid container reference. The commit of pending changes cannot proceed without a path to inspect git repositories.","triggerScenarios":"Calling try_commit_changes (via spawn_exit_monitor) for a workspace whose container_ref field is null/None in the database, or a workspace created without a container ever being started/registered.","commonSituations":"Workspaces created by a remote/different deployment context being committed locally; corrupted or partially-migrated DB rows; trying to commit after a container was deleted; workspace creation failed midway so container_ref was never populated.","solutions":["Verify the workspace row in the DB has container_ref set; re-create or re-attach the workspace so the container is provisioned.","Ensure the container/workspace startup flow completed before triggering commit (don't call try_commit_changes for never-started workspaces).","Check for migrations or cleanup jobs that null out container_ref and restore the correct path.","Guard the call site: skip committing when ctx.workspace.container_ref is None."],"exampleFix":"// before\nlet container_ref = ctx.workspace.container_ref.as_ref().ok_or_else(...)?;\n// after\nif ctx.workspace.container_ref.is_none() {\n    tracing::warn!(workspace_id = %ctx.workspace.id, \"no container_ref; skipping commit\");\n    return Ok(false);\n}\nlet container_ref = ctx.workspace.container_ref.as_ref().unwrap();","handlingStrategy":"validation","validationCode":"if ctx.workspace.container_ref.is_none() {\n    return Err(anyhow!(\"workspace {} has no container_ref; start the container first\", ctx.workspace.id));\n}","typeGuard":"fn has_container_ref(ctx: &Context) -> bool {\n    ctx.workspace.container_ref.as_deref().map(|p| !p.is_empty()).unwrap_or(false)\n}","tryCatchPattern":"match try_commit_changes(ctx).await {\n    Err(ContainerError::Other(e)) if e.to_string().contains(\"Container reference not found\") => {\n        tracing::warn!(\"skipping commit: no container ref\");\n    }\n    other => other?,\n}","preventionTips":["Only schedule try_commit_changes for workspaces whose container finished provisioning.","Validate workspace rows have container_ref before enqueueing commit work.","Monitor for workspaces stuck without container_ref after creation."],"tags":["workspace","container","git","missing-field"],"backgroundTag":"container-ref-missing","analyzedSha":"4deb7eca8f381f7cbc1f9d15515a9ab8f8009053","analyzedAt":"2026-08-29T09:24:13.446Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}