phacility/phabricator · error · Exception
Almanac service, device, property, network and namespace nam
Error message
Almanac service, device, property, network and namespace names may not be more than 100 characters long.
What it means
Second rule of AlmanacNames::validateName(): names may not exceed 100 characters. The cap keeps names usable in DNS-like contexts, database indexes, and UI display; longer inputs are rejected before any record is created.
Source
Thrown at src/applications/almanac/util/AlmanacNames.php:14
<?php
final class AlmanacNames extends Phobject {
public static function validateName($name) {
if (strlen($name) < 3) {
throw new Exception(
pht(
'Almanac service, device, property, network and namespace names '.
'must be at least 3 characters long.'));
}
if (strlen($name) > 100) {
throw new Exception(
pht(
'Almanac service, device, property, network and namespace names '.
'may not be more than 100 characters long.'));
}
if (!preg_match('/^[a-z0-9.-]+\z/', $name)) {
throw new Exception(
pht(
'Almanac service, device, property, network and namespace names '.
'may only contain lowercase letters, numbers, hyphens, and '.
'periods.'));
}
if (preg_match('/(^|\\.)\d+(\z|\\.)/', $name)) {
throw new Exception(
pht(
'Almanac service, device, network, property and namespace names '.
'may not have any segments containing only digits.'));View on GitHub (pinned to 5720a38cfe)
Solutions
- Shorten the name below 101 characters, e.g. use the short hostname instead of the full FQDN.
- Fix the template that assembles names in your provisioning code and add a length check before calling the API.
- Move descriptive detail into Almanac properties or the description field rather than the name.
Example fix
// before
$name = 'repo-node-eu-west-1-'.implode('-', $longTagList); // 120+ chars -> throws
// after
$name = 'repo-euw1-007'; // short, still unique Defensive patterns
Strategy: validation
Validate before calling
if (strlen($name) > 100) {
throw new Exception('Almanac names must be at most 100 characters (got '.strlen($name).').');
}
AlmanacNames::validateName($name); Type guard
function isWithinAlmanacNameLengthLimit($name) {
return strlen($name) <= 100;
} Try / catch
try {
AlmanacNames::validateName($name);
} catch (Exception $ex) {
if (preg_match('/more than 100 characters/', $ex->getMessage())) {
$name = substr($name, 0, 100); // then re-run ALL rules before retrying
AlmanacNames::validateName($name);
} else {
throw $ex;
}
} Prevention
- Enforce a max length in name-generating templates, well under 100 chars.
- Store long descriptions in properties/description fields, not in the name.
- Add a unit test over your name builder asserting strlen < 101.
When it happens
Trigger: Creating or renaming a service/device/network/property/namespace with strlen($name) > 100, typically machine-generated names (full hostnames, auto-built property keys) pasted or templated into the name field.
Common situations: Automation constructing names from concatenated templates ('team-' + env + region + role + index...) that overshoot 100 chars; importing FQDNs as device names.
Related errors
- Almanac service, device, property, network and namespace nam
- Almanac service, device, property, network and namespace nam
- Almanac service, device, network, property and namespace nam
- Almanac service, device, property, network and namespace nam
- Almanac service, device, property, network and namespace nam
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/5d4cf240dd1018a7.
Report an issue: GitHub.