outline/outline · error · Error
Must be a fully qualified domain name
Error message
Must be a fully qualified domain name
What it means
The IsFQDN decorator uses class-validator's isFQDN to ensure a model column holds a fully qualified domain name (e.g. sub.example.com). If the value fails FQDN rules (no dot, invalid chars, leading hyphen, etc.) the validator throws at save time.
Source
Thrown at server/models/validators/IsFQDN.ts:12
import { isFQDN } from "class-validator";
import { addAttributeOptions } from "sequelize-typescript";
/**
* A decorator that validates that a string is a fully qualified domain name.
*/
export default function IsFQDN(target: object, propertyName: string) {
return addAttributeOptions(target, propertyName, {
validate: {
validDomain(value: string) {
if (!isFQDN(value)) {
throw new Error("Must be a fully qualified domain name");
}
},
},
});
}
View on GitHub (pinned to 935a44d4c0)
Solutions
- Provide a valid FQDN with at least one dot and a TLD (e.g. docs.example.com).
- Validate the domain client-side with a regex or the same isFQDN before submitting.
- Strip protocol/path (https://) from the input so only the host remains.
Example fix
// before domain.host = 'https://docs.example.com/'; // after domain.host = 'docs.example.com';
Defensive patterns
Strategy: validation
Validate before calling
import { isFQDN } from 'class-validator';
if (!isFQDN(host)) {
throw new ValidationError('Must be a fully qualified domain name');
} Type guard
import { isFQDN } from 'class-validator';
const isFqdn = (v: string): v is string => isFQDN(v); Prevention
- Strip protocol and path before storing a host.
- Validate with isFQDN on the client.
- Reject single-label hostnames and IP literals unless explicitly allowed.
When it happens
Trigger: Saving a model column decorated with @IsFQDN (commonly allowed domains / custom hostnames) with a non-domain string like 'localhost', 'my domain', 'a_b', or an IP address.
Common situations: Configuring a custom domain/subdomain feature with an invalid hostname; user-supplied domain input not sanitized; entering a bare TLD or single label.
Related errors
AI-assisted analysis of outline/outline@935a44d4c0 (2026-08-12).
Data as JSON: /api/errors/9671de4efadfee2b.
Report an issue: GitHub.