{"record":{"id":"260e0215e1d13db1","repo":"appwrite/appwrite","slug":"database-migration-failed","errorCode":null,"errorMessage":"Database migration failed","messagePattern":"Database migration failed","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/Appwrite/Platform/Tasks/Install.php","lineNumber":851,"sourceCode":"            ];\n        } else {\n            $command = ['docker', 'exec', 'appwrite', 'migrate'];\n        }\n        $commandLine = implode(' ', array_map(escapeshellarg(...), $command));\n\n        $output = [];\n        \\exec($commandLine . ' 2>&1', $output, $exit);\n\n        if ($exit !== 0) {\n            $message = trim(implode(\"\\n\", $output));\n            $this->updateProgress(\n                $progress,\n                InstallerServer::STEP_MIGRATION,\n                InstallerServer::STATUS_ERROR,\n                details: ['output' => $message],\n                messageOverride: 'Migration failed: ' . ($message ?: 'exit code ' . $exit)\n            );\n            throw new \\RuntimeException('Database migration failed', 0, $message !== '' ? new \\RuntimeException($message) : null);\n        }\n\n        $this->updateProgress(\n            $progress,\n            InstallerServer::STEP_MIGRATION,\n            InstallerServer::STATUS_COMPLETED,\n            messageOverride: 'Database migration completed'\n        );\n    }\n\n    private function trackSelfHostedInstall(array $input, bool $isUpgrade, string $version, array $account): void\n    {\n        if ($this->isLocalInstall()) {\n            return;\n        }\n\n        // Opt out via DO_NOT_TRACK (https://donottrack.sh/)\n        $doNotTrack = \\strtolower((string) System::getEnv('DO_NOT_TRACK', ''));","sourceCodeStart":833,"sourceCodeEnd":869,"githubUrl":"https://github.com/appwrite/appwrite/blob/a1d520eea492ebd1da1ef2dc8db5b2b34e277dce/src/Appwrite/Platform/Tasks/Install.php#L833-L869","documentation":"Error \"Database migration failed\" thrown in appwrite/appwrite.","triggerScenarios":"Thrown at src/Appwrite/Platform/Tasks/Install.php:851 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the Appwrite container logs for the specific migration error, fix the underlying database issue, and re-run the install.","Verify the database container is healthy and reachable before running the installer, and ensure enough disk space is available."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a1d520eea492ebd1da1ef2dc8db5b2b34e277dce","analyzedAt":"2026-08-18T21:34:56.994Z","contentChangedAt":"2026-08-18T21:34:56.994Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}