appwrite/appwrite · error · RuntimeException

Database migration failed

Error message

Database migration failed

What it means

Error "Database migration failed" thrown in appwrite/appwrite.

Source

Thrown at src/Appwrite/Platform/Tasks/Install.php:851

            ];
        } else {
            $command = ['docker', 'exec', 'appwrite', 'migrate'];
        }
        $commandLine = implode(' ', array_map(escapeshellarg(...), $command));

        $output = [];
        \exec($commandLine . ' 2>&1', $output, $exit);

        if ($exit !== 0) {
            $message = trim(implode("\n", $output));
            $this->updateProgress(
                $progress,
                InstallerServer::STEP_MIGRATION,
                InstallerServer::STATUS_ERROR,
                details: ['output' => $message],
                messageOverride: 'Migration failed: ' . ($message ?: 'exit code ' . $exit)
            );
            throw new \RuntimeException('Database migration failed', 0, $message !== '' ? new \RuntimeException($message) : null);
        }

        $this->updateProgress(
            $progress,
            InstallerServer::STEP_MIGRATION,
            InstallerServer::STATUS_COMPLETED,
            messageOverride: 'Database migration completed'
        );
    }

    private function trackSelfHostedInstall(array $input, bool $isUpgrade, string $version, array $account): void
    {
        if ($this->isLocalInstall()) {
            return;
        }

        // Opt out via DO_NOT_TRACK (https://donottrack.sh/)
        $doNotTrack = \strtolower((string) System::getEnv('DO_NOT_TRACK', ''));

View on GitHub (pinned to a1d520eea4)

Solutions

  1. Check the Appwrite container logs for the specific migration error, fix the underlying database issue, and re-run the install.
  2. Verify the database container is healthy and reachable before running the installer, and ensure enough disk space is available.

When it happens

Trigger: Thrown at src/Appwrite/Platform/Tasks/Install.php:851 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of appwrite/appwrite@a1d520eea4 (2026-08-18). Data as JSON: /api/errors/260e0215e1d13db1. Report an issue: GitHub.