{"record":{"id":"0e6cad2f7d30b90f","repo":"coollabsio/coolify","slug":"error","errorCode":null,"errorMessage":"{$error}","messagePattern":"\\{\\$error\\}","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"warning","filePath":"app/Livewire/Project/Application/PreviewsCompose.php","lineNumber":73,"sourceCode":"            $applicationDomains = json_decode($this->preview->application->docker_compose_domains ?: '[]', true) ?: [];\n            $domain_string = getComposeServiceDomainString($applicationDomains, (string) $this->serviceName);\n\n            // If no domain is set in the main application, generate a default domain\n            if (empty($domain_string)) {\n                $server = $this->preview->application->destination->server;\n                $template = $this->preview->application->preview_url_template;\n                $random = new_public_id();\n\n                // Generate a unique domain like main app services do\n                $generated_fqdn = generateUrl(server: $server, random: $random);\n\n                $preview_fqdn = str_replace('{{random}}', $random, $template);\n                $preview_fqdn = str_replace('{{domain}}', str($generated_fqdn)->after('://'), $preview_fqdn);\n                $preview_fqdn = str_replace('{{pr_id}}', $this->preview->pull_request_id, $preview_fqdn);\n                $preview_fqdn = str($generated_fqdn)->before('://').'://'.$preview_fqdn;\n            } else {\n                foreach (ValidationPatterns::validateApplicationDomains($domain_string) as $error) {\n                    throw new \\InvalidArgumentException($error);\n                }\n\n                // Use the existing domain from the main application\n                // Handle multiple domains separated by commas\n                $domain_list = ValidationPatterns::applicationDomainList($domain_string);\n                $preview_fqdns = [];\n                $template = $this->preview->application->preview_url_template;\n                $random = new_public_id();\n\n                foreach ($domain_list as $single_domain) {\n                    $single_domain = trim($single_domain);\n                    if (empty($single_domain)) {\n                        continue;\n                    }\n\n                    $url = Url::fromString($single_domain);\n                    $host = $url->getHost();\n                    $schema = $url->getScheme();","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/coollabsio/coolify/blob/70b9acc42467278373e00de77abb40684e25b395/app/Livewire/Project/Application/PreviewsCompose.php#L55-L91","documentation":"When saving custom domains for a compose-based PR preview, each submitted domain is run through ValidationPatterns::validateApplicationDomains(); every violation message is thrown verbatim as an InvalidArgumentException. The message you see is dynamic - it is the domain validation error text (invalid FQDN, bad scheme, disallowed characters, etc.), not a fixed string.","triggerScenarios":"Submitting a preview domain string that fails the domain rules: wrong format, missing or wrong scheme, invalid hostname characters, path or query segments, or an entry in the comma-separated list that is not a valid domain.","commonSituations":"Pasting full URLs with paths; trailing spaces or empty entries between commas; wildcards where not permitted; copy-pasting from a browser address bar; using a template placeholder that did not get substituted.","solutions":["Match the format the main application domains use - scheme + valid hostname (see ValidationPatterns::applicationDomainRules())","Separate multiple domains with commas, trim whitespace, and strip paths/ports/query strings","If a generated preview URL is acceptable, leave the domain empty and let Coolify derive it from the preview URL template"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// validate before submitting the form, using the same rule set\nuse App\\Support\\ValidationPatterns;\n\n$errors = ValidationPatterns::validateApplicationDomains($domainString);\nif ($errors !== []) {\n    // show $errors inline; do not submit\n}","typeGuard":"function isValidApplicationDomain(string $domain): bool\n{\n    return ValidationPatterns::validateApplicationDomains($domain) === [];\n}","tryCatchPattern":null,"preventionTips":["Mirror the main application's domain format: scheme + hostname, comma-separated for multiple","Trim whitespace and strip paths/ports before submitting","Prefer the generated preview URL template over hand-typed domains when in doubt"],"tags":["livewire","preview","domain-validation","docker-compose"],"backgroundTag":"domain-validation-failed","analyzedSha":"70b9acc42467278373e00de77abb40684e25b395","analyzedAt":"2026-08-17T01:41:01.313Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}