{"record":{"id":"31cbf96402bf3ada","repo":"BloopAI/vibe-kanban","slug":"migration-failed","errorCode":null,"errorMessage":"Migration failed: {}","messagePattern":"Migration failed: (.+?)","errorType":"exception","errorClass":"DeploymentError","httpStatus":null,"severity":"critical","filePath":"crates/local-deployment/src/lib.rs","lineNumber":96,"sourceCode":"    webrtc_host: OnceLock<Arc<WebRtcHost>>,\n    ssh_config: Arc<russh::server::Config>,\n    pty: PtyService,\n    pr_sync_notify: Arc<Notify>,\n}\n\n#[derive(Debug, Clone)]\nstruct PendingHandoff {\n    provider: String,\n    app_verifier: String,\n}\n\n#[async_trait]\nimpl Deployment for LocalDeployment {\n    async fn new(shutdown: CancellationToken) -> Result<Self, DeploymentError> {\n        // Run one-time process logs migration from DB to filesystem\n        services::services::execution_process::migrate_execution_logs_to_files()\n            .await\n            .map_err(|e| DeploymentError::Other(anyhow::anyhow!(\"Migration failed: {}\", e)))?;\n\n        let mut raw_config = load_config_from_file(&config_path()).await;\n\n        let profiles = ExecutorConfigs::get_cached();\n        if !raw_config.onboarding_acknowledged\n            && let Ok(recommended_executor) = profiles.get_recommended_executor_profile().await\n        {\n            raw_config.executor_profile = recommended_executor;\n        }\n\n        // Check if app version has changed and set release notes flag\n        {\n            let current_version = utils::version::APP_VERSION;\n            let stored_version = raw_config.last_app_version.as_deref();\n\n            if stored_version != Some(current_version) {\n                // Show release notes only if this is an upgrade (not first install)\n                raw_config.show_release_notes = stored_version.is_some();","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/BloopAI/vibe-kanban/blob/4deb7eca8f381f7cbc1f9d15515a9ab8f8009053/crates/local-deployment/src/lib.rs#L78-L114","documentation":"LocalDeployment::new runs a one-time migration that moves execution process logs from the database to filesystem files. If migrate_execution_logs_to_files fails, deployment initialization aborts with 'Migration failed: {e}'. Since it runs at startup, a failure here prevents the whole local deployment from starting.","triggerScenarios":"Starting the local deployment when the log migration cannot complete: DB read failures on execution_process rows, unwritable log directory, disk full, or partial prior migration state causing conflicts.","commonSituations":"Read-only or permission-denied log directory (e.g. after changing CODE_HOME or running under a different user); corrupted DB rows with oversized/binary log content; interrupted previous migration leaving half-written files; disk quota exceeded.","solutions":["Read the wrapped '{e}' message to identify whether it is a DB error or a filesystem write error, and fix that root cause.","Check the log storage directory exists and is writable by the process user (mkdir/chown as needed).","Free disk space if the write failed due to quota/disk-full.","Restore DB connectivity (check DATABASE_URL / sqlite file) and restart the deployment; the migration is one-time and will re-run."],"exampleFix":"// before (diagnostic)\nmigrate_execution_logs_to_files().await.map_err(|e| ...)?;\n// after: pre-flight check\nservices::services::execution_process::migrate_execution_logs_to_files()\n    .await\n    .inspect_err(|e| tracing::error!(?e, \"log migration failed; check log dir permissions and disk space\"))\n    .map_err(|e| DeploymentError::Other(anyhow::anyhow!(\"Migration failed: {}\", e)))?;","handlingStrategy":"try-catch","validationCode":"// pre-flight before deployment init\nlet log_dir = logs_base_dir();\nif !log_dir.exists() {\n    std::fs::create_dir_all(&log_dir)?;\n}\nlet probe = log_dir.join(\".write-probe\");\nstd::fs::write(&probe, b\"ok\")?;\nstd::fs::remove_file(&probe)?;","typeGuard":null,"tryCatchPattern":"match LocalDeployment::new(shutdown).await {\n    Err(DeploymentError::Other(e)) if e.to_string().starts_with(\"Migration failed\") => {\n        tracing::error!(%e, \"fix log dir permissions/DB, then restart deployment\");\n    }\n    other => other?,\n}","preventionTips":["Ensure the log storage directory exists and is writable by the service user.","Monitor disk space on the host running local deployment.","Don't change CODE_HOME/user between runs without migrating the log dir.","Verify DB connectivity before deployment startup."],"tags":["migration","startup","database","filesystem"],"backgroundTag":"migration-failed","analyzedSha":"4deb7eca8f381f7cbc1f9d15515a9ab8f8009053","analyzedAt":"2026-08-29T09:24:13.446Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}