flarum/framework · error · ValidationFailed

The admin password did not match its confirmation.

Error message

The admin password did not match its confirmation.

What it means

InstallController::getConfirmedAdminPassword() compares 'adminPassword' and 'adminPasswordConfirmation' from the submitted installer form and throws ValidationFailed when they differ, preventing an admin account from being created with a mistyped password.

Solutions

  1. Re-enter the same password in both fields and resubmit
  2. Clear autofilled password fields and type manually
  3. Pre-check equality in client-side validation before form submission

Example fix

// before
adminPassword: 'S3cret!', adminPasswordConfirmation: 's3cret!'
// after
adminPassword: 'S3cret!', adminPasswordConfirmation: 'S3cret!'
Defensive patterns

Strategy: validation

Validate before calling

if (($input['adminPassword'] ?? null) !== ($input['adminPasswordConfirmation'] ?? null)) {
    throw new ValidationFailed('The admin password did not match its confirmation.');
}
if (($input['adminPassword'] ?? '') === '') {
    throw new ValidationFailed('The admin password is required.');
}

Try / catch

try {
    $password = $controller->getConfirmedAdminPassword($input);
} catch (ValidationFailed $e) {
    return redirect()->back()->withErrors(['adminPassword' => $e->getMessage()]);
}

Prevention

When it happens

Trigger: Submitting the web installer form with mismatched password/confirmation fields; one field left blank while the other is filled (via Arr::get returning null).

Common situations: Typos or case/caps-lock differences between the two password boxes; browser autofill filling only one field; truncated paste into the confirmation box.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of flarum/framework@4b939f6853 (2026-09-15). Data as JSON: /api/errors/8ea24a405caa4e69. Report an issue: GitHub.

Appendix: source

Thrown at framework/core/src/Install/Controller/InstallController.php:121

    /**
     * @throws ValidationFailed
     */
    private function makeAdminUser(array $input): AdminUser
    {
        return new AdminUser(
            Arr::get($input, 'adminUsername'),
            $this->getConfirmedAdminPassword($input),
            Arr::get($input, 'adminEmail')
        );
    }

    private function getConfirmedAdminPassword(array $input): string
    {
        $password = Arr::get($input, 'adminPassword');
        $confirmation = Arr::get($input, 'adminPasswordConfirmation');

        if ($password !== $confirmation) {
            throw new ValidationFailed('The admin password did not match its confirmation.');
        }

        return $password;
    }
}

View on GitHub (pinned to 4b939f6853)