{"record":{"id":"dce7a5276fd4e761","repo":"coollabsio/coolify","slug":"hostname-must-include-a-registrable-domain","errorCode":null,"errorMessage":"Hostname must include a registrable domain.","messagePattern":"Hostname must include a registrable domain\\.","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"app/Support/DomainConnect/CloudflareDomainConnect.php","lineNumber":156,"sourceCode":"    public static function splitHostname(string $hostname): array\n    {\n        $hostname = strtolower(trim($hostname));\n        $hostname = preg_replace('#^https?://#', '', $hostname) ?? $hostname;\n        $hostname = explode('/', $hostname)[0] ?? $hostname;\n        $hostname = explode(':', $hostname)[0] ?? $hostname;\n        $hostname = rtrim($hostname, '.');\n\n        $labels = array_values(array_filter(explode('.', $hostname), fn (string $p) => $p !== ''));\n\n        if (count($labels) < 2) {\n            throw new InvalidArgumentException('Hostname must include a domain (e.g. example.com or app.example.com).');\n        }\n\n        $suffixLabelCount = self::publicSuffixLabelCount($labels);\n        $registrableLabelCount = $suffixLabelCount + 1;\n\n        if (count($labels) < $registrableLabelCount) {\n            throw new InvalidArgumentException('Hostname must include a registrable domain.');\n        }\n\n        $domain = implode('.', array_slice($labels, -$registrableLabelCount));\n        $hostLabels = array_slice($labels, 0, -$registrableLabelCount);\n        $host = implode('.', $hostLabels);\n\n        return ['domain' => $domain, 'host' => $host];\n    }\n\n    /**\n     * How many trailing labels form the public suffix (effective TLD).\n     *\n     * @param  list<string>  $labels\n     */\n    protected static function publicSuffixLabelCount(array $labels): int\n    {\n        $count = count($labels);\n","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/coollabsio/coolify/blob/70b9acc42467278373e00de77abb40684e25b395/app/Support/DomainConnect/CloudflareDomainConnect.php#L138-L174","documentation":"Error \"Hostname must include a registrable domain.\" thrown in coollabsio/coolify.","triggerScenarios":"Thrown at app/Support/DomainConnect/CloudflareDomainConnect.php:156 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"70b9acc42467278373e00de77abb40684e25b395","analyzedAt":"2026-08-17T01:41:01.313Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}