{"record":{"id":"8fd8ce5c24277682","repo":"nextcloud/all-in-one","slug":"domain-must-not-contain-colons","errorCode":null,"errorMessage":"Domain must not contain colons!","messagePattern":"Domain must not contain colons!","errorType":"validation","errorClass":"InvalidSettingConfigurationException","httpStatus":422,"severity":"error","filePath":"php/src/Data/ConfigurationManager.php","lineNumber":609,"sourceCode":"    /**\n     * @throws InvalidSettingConfigurationException\n     *\n     * We can't turn this into a private validation method because of the second argument.\n     */\n    public function setDomain(string $domain, bool $skipDomainValidation) : void {\n        // Validate that at least one dot is contained\n        if (!str_contains($domain, '.')) {\n            throw new InvalidSettingConfigurationException(\"Domain must contain at least one dot!\");\n        }\n\n        // Validate that no slashes are contained\n        if (str_contains($domain, '/')) {\n            throw new InvalidSettingConfigurationException(\"Domain must not contain slashes!\");\n        }\n\n        // Validate that no colons are contained\n        if (str_contains($domain, ':')) {\n            throw new InvalidSettingConfigurationException(\"Domain must not contain colons!\");\n        }\n\n        // Validate domain\n        if (filter_var($domain, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME) === false) {\n            throw new InvalidSettingConfigurationException(\"Domain is not a valid domain!\");\n        }\n\n        // Validate that it is not an IP-address\n        if(filter_var($domain, FILTER_VALIDATE_IP)) {\n            throw new InvalidSettingConfigurationException(\"Please enter a domain and not an IP-address!\");\n        }\n\n        // Skip domain validation if opted in to do so\n        if ($this->shouldDomainValidationBeSkipped($skipDomainValidation)) {\n            error_log('Skipping domain validation');\n        } else {\n            $dnsRecordIP = gethostbyname($domain);\n            if ($dnsRecordIP === $domain) {","sourceCodeStart":591,"sourceCodeEnd":627,"githubUrl":"https://github.com/nextcloud/all-in-one/blob/6b788eec5e61733cf03ed380a3572e43ae3f11ce/php/src/Data/ConfigurationManager.php#L591-L627","documentation":"Third check in ConfigurationManager::setDomain(): the domain must not contain ':'. In practice this means a port suffix was included, e.g. 'cloud.example.com:8443' (a scheme like 'https://' would already have been rejected by the earlier slash check). Throws InvalidSettingConfigurationException → HTTP 422 shown in the AIO UI. Ports are not part of the domain setting; the listen port is controlled separately via the mastercontainer's APACHE_PORT environment variable.","triggerScenarios":"domain='cloud.example.com:443' or 'cloud.example.com:8443'; scripts concatenating host and port into one variable; copy-pasting 'host:port' from a tutorial into the domain field.","commonSituations":"Reverse-proxy installs where AIO listens on a non-443 port and users append the port to the domain instead of setting APACHE_PORT; SSH-style 'host:port' habits.","solutions":["Remove the port from the domain field — enter 'cloud.example.com' only","If AIO must listen on another port, set the APACHE_PORT environment variable on the mastercontainer (and point the reverse proxy at it), not in the domain field","For scripted configs, split host and port before submitting, e.g. with parse_url()"],"exampleFix":"// before\ndomain = 'cloud.example.com:8443'\n// after\ndomain = 'cloud.example.com'\n// (and configure -e APACHE_PORT=8443 on the mastercontainer instead)","handlingStrategy":"validation","validationCode":"// Ports belong in APACHE_PORT, not in the domain: split them off\n$host = parse_url('//' . $domain, PHP_URL_HOST) ?? $domain;\nif (str_contains($host, ':')) {\n    $errors[] = 'Remove the port from the domain; configure APACHE_PORT instead';\n}","typeGuard":null,"tryCatchPattern":"use AIO\\Data\\InvalidSettingConfigurationException;\n\ntry {\n    $configurationManager->setDomain($domain, $skipDomainValidation);\n} catch (InvalidSettingConfigurationException $e) {\n    $formErrors[] = $e->getMessage();\n}","preventionTips":["Keep host and port in separate variables/config keys","For non-443 installs set APACHE_PORT on the mastercontainer instead of appending ':port' to the domain","Reject ':' in client-side domain validation"],"tags":["php","nextcloud-aio","domain-validation","configuration","input-validation"],"backgroundTag":"invalid-domain-format","analyzedSha":"6b788eec5e61733cf03ed380a3572e43ae3f11ce","analyzedAt":"2026-08-21T05:47:24.382Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}