nextcloud/all-in-one · error · \Exception
"{domain}" is already taken. Please choose a different subdo
Error message
"{domain}" is already taken. Please choose a different subdomain and try again. What it means
POST /domains/ returned 400 or 409 for a user-chosen slug, and the follow-up GET /domains/{name}/ returned 404, proving the account does not already own it. The dedyn.io subdomain is registered to someone else (409 collision) or the name failed validation (400).
Source
Thrown at php/src/Desec/DesecManager.php:320
if ($code === 201) {
return $domain;
}
// For a user-specified slug, the name may be unavailable (400/409) or the account's
// domain limit may be reached (403) precisely because the user already owns this
// domain. Reuse it rather than failing.
if (!$random && ($code === 400 || $code === 403 || $code === 409)) {
if ($this->ownsDomain($token, $domain)) {
return $domain;
}
if ($code === 403) {
throw new \Exception(
'Your deSEC account has reached its domain limit and "' . $domain . '" is not '
. 'one of your existing domains. Remove an unused domain at desec.io, or contact '
. 'deSEC support to raise the limit, then try again.'
);
}
throw new \Exception('"' . $domain . '" is already taken. Please choose a different subdomain and try again.');
}
if ($code === 409) {
// Random slug collided with an existing name — try another.
continue;
}
throw new \Exception('Unexpected response from deSEC during domain registration (HTTP ' . $code . '): ' . $res->getBody()->getContents());
}
throw new \Exception('Could not register a free dedyn.io domain after ' . self::MAX_SLUG_ATTEMPTS . ' attempts. Please try again.');
}
/**
* Checks whether the authenticated account already owns the given domain.
*
* Used to recover from a failed creation when the user is reusing a slug they
* registered earlier: GET /domains/{name}/ returns 200 only for a domain theView on GitHub (pinned to 6b788eec5e)
Solutions
- Choose a different, more unique subdomain
- Check slug syntax: lowercase letters, digits, hyphens, must start and end alphanumerically
- If you believe you own it, confirm you authenticated with the same deSEC account that registered it — ownership is per-account
Defensive patterns
Strategy: try-catch
Validate before calling
// Cheap pre-check: if the account already owns the slug, creation will self-heal;
// validate slug syntax client-side to avoid the 400 variant
if (!preg_match('/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/', $slug)) {
throw new \InvalidArgumentException('Slug must be lowercase letters, digits, hyphens; no leading/trailing hyphen.');
} Try / catch
try {
$domain = $manager->registerDomain($token, $slug);
} catch (\Exception $e) {
if (str_contains($e->getMessage(), 'is already taken')) {
showFieldError('slug', 'That subdomain is taken — pick another or leave blank for a random one');
return;
}
throw $e;
} Prevention
- Validate slug syntax client-side before submitting (lowercase alphanumeric + inner hyphens)
- Default to a random slug; user-chosen slugs are mostly taken already
- Prefer longer unique slugs (hostnames, project names) over generic words
When it happens
Trigger: Another deSEC user already registered <slug>.dedyn.io; the slug violates the naming rules so deSEC rejects it with 400 and it is not owned by this account.
Common situations: Short popular slugs like 'cloud' or 'nextcloud' are long taken; user types an invalid name; user previously registered the slug under a different deSEC account.
Related errors
- Your deSEC account has reached its domain limit and "{domain
- Unexpected response from deSEC during domain registration (H
- Could not register a free dedyn.io domain after {maxSlugAtte
- Unexpected response from deSEC while checking domain ownersh
- A domain is already configured. Reset the AIO instance first
AI-assisted analysis of nextcloud/all-in-one@6b788eec5e (2026-08-21).
Data as JSON: /api/errors/31dae9ca5bd1f76c.
Report an issue: GitHub.