nextcloud/all-in-one · warning · \Exception

Please provide a valid email address.

Error message

Please provide a valid email address.

What it means

Thrown by DesecManager::validateEmail when the trimmed email is empty or fails PHP's FILTER_VALIDATE_EMAIL. The email is the deSEC account identity used for login and verification links, so a syntactically invalid address is rejected before any API call is made.

Source

Thrown at php/src/Desec/DesecManager.php:160

        $this->configurationManager->desecEmail    = $validatedEmail;
        $this->configurationManager->commitTransaction();

        // This is not an error: the account was requested successfully and we now wait for
        // the user to verify their email. Signal it with an empty token so register() can
        // stop cleanly and the caller can re-render the awaiting-verification UI (which
        // already explains the next step) instead of surfacing an error toast.
        return ['', true];
    }

    /**
     * Validates an email address string.
     *
     * @throws \Exception if the email is empty or syntactically invalid
     */
    private function validateEmail(string $email): string {
        $email = trim($email);
        if ($email === '' || filter_var($email, FILTER_VALIDATE_EMAIL) === false) {
            throw new \Exception('Please provide a valid email address.');
        }
        return $email;
    }

    /**
     * Validates an optional subdomain slug.
     * Returns an empty string when the caller wants a randomly generated slug.
     *
     * @throws \Exception if the slug is non-empty but does not match the allowed pattern
     */
    private function validateSlug(string $slug): string {
        $slug = trim($slug);
        if ($slug !== '' && !preg_match(self::SLUG_PATTERN, $slug)) {
            throw new \Exception(
                'The desired subdomain must contain only lowercase letters, digits and hyphens, '
                . 'be between 1 and 63 characters long, and must not start or end with a hyphen.'
            );
        }

View on GitHub (pinned to 6b788eec5e)

Solutions

  1. Provide a standard, fully qualified address like 'user@example.com'.
  2. Trim whitespace client-side before submitting.
  3. If using an exotic address that PHP rejects, register the deSEC account manually in the browser and choose a different domain-connection method in AIO.

Example fix

// before
$email = 'not-an-email';

// after
$email = 'admin@example.com';
if (filter_var($email, FILTER_VALIDATE_EMAIL) === false) { /* fix input */ }
Defensive patterns

Strategy: validation

Validate before calling

$email = trim($email);
if ($email === '' || filter_var($email, FILTER_VALIDATE_EMAIL) === false) {
    // reject before calling register()
}

Prevention

When it happens

Trigger: Calling register() with an empty email, an email missing '@' or TLD ('user@localhost', 'user@@example.com'), or one with surrounding characters that fail the filter; the address is trimmed before validation so whitespace-only input is treated as empty.

Common situations: Form automation sending placeholder values; users entering the deSEC subdomain into the email field; addresses with unusual-but-valid new TLDs occasionally failing older FILTER_VALIDATE_EMAIL behavior before PHP 8.0; trailing punctuation from copy-paste.

Related errors


AI-assisted analysis of nextcloud/all-in-one@6b788eec5e (2026-08-21). Data as JSON: /api/errors/38af105bb0100f76. Report an issue: GitHub.