nextcloud/all-in-one · warning · InvalidSettingConfigurationException

The entered timezone does not seem to be a valid timezone!

Error message

The entered timezone does not seem to be a valid timezone!

What it means

Thrown by validateTimezone when the string does not match ^[a-zA-Z0-9_-/+]+$. This is a loose syntactic whitelist for IANA identifiers (e.g. 'America/Argentina/Buenos_Aires', 'Etc/GMT+5'), not a check that the timezone exists; unusual but real identifiers with other characters would also be rejected.

Source

Thrown at php/src/Data/ConfigurationManager.php:1026

        $additionalBackupDirectoriesArray = explode("\n", $additionalBackupDirectories);
        $additionalBackupDirectoriesArray = array_unique($additionalBackupDirectoriesArray, SORT_REGULAR);
        return $additionalBackupDirectoriesArray;
    }

    public function isDailyBackupRunning() : bool {
        return file_exists(DataConst::GetDailyBackupBlockFile());
    }

    /**
     * @throws InvalidSettingConfigurationException
     */
    private function validateTimezone(string $timezone) : void {
        if ($timezone === "") {
            throw new InvalidSettingConfigurationException("The timezone must not be empty!");
        }

        if (!preg_match("#^[a-zA-Z0-9_\-\/\+]+$#", $timezone)) {
            throw new InvalidSettingConfigurationException("The entered timezone does not seem to be a valid timezone!");
        }
    }

    /**
     * Provide an extra method since our `timezone` attribute setter prevents setting an empty timezone.
     */
    public function deleteTimezone() : void {
        $this->set('timezone', '');
    }

    public function shouldDomainValidationBeSkipped(bool $skipDomainValidation) : bool {
        if ($skipDomainValidation || getenv('SKIP_DOMAIN_VALIDATION') === 'true') {
            return true;
        }
        return false;
    }

    public function getApacheAdditionalNetwork() : string {

View on GitHub (pinned to 6b788eec5e)

Solutions

  1. Use a canonical IANA zone name; list candidates with PHP's DateTimeZone::listIdentifiers().
  2. For UTC use 'UTC'; for fixed offsets use an 'Etc/GMT+5'-style identifier (note the inverted sign), never 'UTC+2'.
  3. Trim whitespace and drop any Windows/CLR-style display formatting before submitting.

Example fix

// before
$timezone = 'GMT+02:00';

// after
$timezone = 'Europe/Berlin';
Defensive patterns

Strategy: validation

Validate before calling

if (!preg_match('#^[a-zA-Z0-9_\\-/\\+]+$#', $timezone) || !in_array($timezone, DateTimeZone::listIdentifiers(), true)) {
    // reject before assigning configurationManager->timezone
}

Type guard

function isValidIanaTimezone(string $tz): bool
{
    return in_array($tz, DateTimeZone::listIdentifiers(DateTimeZone::ALL), true);
}

Prevention

When it happens

Trigger: Submitting a timezone containing spaces, commas, parentheses or dots: 'GMT+02:00', 'UTC+2', '(UTC+01:00) Brussels', 'America/Indiana/Indianapolis.' with trailing punctuation.

Common situations: See trigger scenarios.

Related errors


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