nextcloud/all-in-one · error · InvalidSettingConfigurationException
Domain must not contain slashes!
Error message
Domain must not contain slashes!
What it means
Second check in ConfigurationManager::setDomain(): the domain string must not contain any '/'. Users hit it by pasting a full URL or a URL-with-path instead of a bare hostname. It throws InvalidSettingConfigurationException → HTTP 422 with this message shown in the AIO interface. The check runs before hostname-format validation and cannot be skipped.
Source
Thrown at php/src/Data/ConfigurationManager.php:604
return trim((string)file_get_contents($path));
}
return '';
}
/**
* @throws InvalidSettingConfigurationException
*
* We can't turn this into a private validation method because of the second argument.
*/
public function setDomain(string $domain, bool $skipDomainValidation) : void {
// Validate that at least one dot is contained
if (!str_contains($domain, '.')) {
throw new InvalidSettingConfigurationException("Domain must contain at least one dot!");
}
// Validate that no slashes are contained
if (str_contains($domain, '/')) {
throw new InvalidSettingConfigurationException("Domain must not contain slashes!");
}
// Validate that no colons are contained
if (str_contains($domain, ':')) {
throw new InvalidSettingConfigurationException("Domain must not contain colons!");
}
// Validate domain
if (filter_var($domain, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME) === false) {
throw new InvalidSettingConfigurationException("Domain is not a valid domain!");
}
// Validate that it is not an IP-address
if(filter_var($domain, FILTER_VALIDATE_IP)) {
throw new InvalidSettingConfigurationException("Please enter a domain and not an IP-address!");
}
// Skip domain validation if opted in to do soView on GitHub (pinned to 6b788eec5e)
Solutions
- Enter only the bare hostname: 'cloud.example.com' — no scheme, no path, no trailing slash
- If scripting, extract the host first: $host = parse_url($url, PHP_URL_HOST);
- Leave out 'https://' — AIO constructs URLs itself in later validation steps
Example fix
// before domain = 'https://cloud.example.com/nextcloud' // after domain = 'cloud.example.com'
Defensive patterns
Strategy: validation
Validate before calling
// Strip pasted URLs down to the host before submitting
if (str_contains($domain, '/')) {
$domain = parse_url($domain, PHP_URL_HOST) ?? $domain;
}
if (str_contains($domain, '/')) {
$errors[] = 'Submit a bare hostname without scheme or path';
} Try / catch
use AIO\Data\InvalidSettingConfigurationException;
try {
$configurationManager->setDomain($domain, $skipDomainValidation);
} catch (InvalidSettingConfigurationException $e) {
$formErrors[] = $e->getMessage(); // safe to display verbatim
} Prevention
- Normalize input with parse_url(..., PHP_URL_HOST) before storing or posting
- Keep the domain field a plain text input without URL autofill
- Trim whitespace from pasted values
When it happens
Trigger: domain='https://cloud.example.com' (scheme pasted); domain='cloud.example.com/' (trailing slash); domain='cloud.example.com/nextcloud' (path appended); browser autofill inserting the full URL into the domain field.
Common situations: Copy-pasting from the browser address bar; users assuming the field wants a URL; scripts forwarding a URL variable straight into the domain setting.
Related errors
- Domain must contain at least one dot!
- Domain must not contain colons!
- Domain is not a valid domain!
- Please enter a domain and not an IP-address!
- DNS config is not set for this domain or the domain is not a
AI-assisted analysis of nextcloud/all-in-one@6b788eec5e (2026-08-21).
Data as JSON: /api/errors/bfdcca5ebf65ae8f.
Report an issue: GitHub.