{"record":{"id":"aa4f1d2204a16f7a","repo":"phacility/phabricator","slug":"interfaces-must-have-a-unique-combination-of-netwo","errorCode":null,"errorMessage":"Interfaces must have a unique combination of network, device, address, and port.","messagePattern":"Interfaces must have a unique combination of network, device, address, and port\\.","errorType":"validation","errorClass":"PhabricatorApplicationTransactionValidationException","httpStatus":null,"severity":"error","filePath":"src/applications/almanac/editor/AlmanacInterfaceEditor.php","lineNumber":33,"sourceCode":"    return pht('%s created %s.', $author, $object);\n  }\n\n  protected function didCatchDuplicateKeyException(\n    PhabricatorLiskDAO $object,\n    array $xactions,\n    Exception $ex) {\n\n    $errors = array();\n\n    $errors[] = new PhabricatorApplicationTransactionValidationError(\n      null,\n      pht('Invalid'),\n      pht(\n        'Interfaces must have a unique combination of network, device, '.\n        'address, and port.'),\n      null);\n\n    throw new PhabricatorApplicationTransactionValidationException($errors);\n  }\n\n}\n","sourceCodeStart":15,"sourceCodeEnd":37,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/almanac/editor/AlmanacInterfaceEditor.php#L15-L37","documentation":"Thrown by PhabricatorRepository::assertValidRepositorySlug() when a repository short name does not start with a letter or number. Leading periods, hyphens, or underscores are rejected because they create hidden files ('.name'), break URI parsing, or cause path/tooling quirks. The rule is enforced by the preg_match('/^[a-zA-Z0-9]/', $slug) check when a short name is set via the UI or 'repository.edit'.","triggerScenarios":"Setting a short name like '-utils' or '.internal': the start-anchor regex at PhabricatorRepository.php:395 fails to find an initial letter/digit and throws.","commonSituations":"Convention-based naming with leading underscores or hyphens for 'internal' repos; auto-generated slugs that begin with a separator after sanitization stripped leading characters (e.g. '###repo' -> '-repo'); dotfile-style naming habits.","solutions":["Start the short name with a letter or digit ('_utils' -> 'utils', '.internal' -> 'internal').","After sanitizing generated names, trim leading separators: ltrim($slug, '._-').","Validate with PhabricatorRepository::isValidRepositorySlug() before submitting."],"exampleFix":"// before\n$slug = '_internal_tools';\n\n// after\n$slug = ltrim(preg_replace('/[^a-zA-Z0-9._-]+/', '-', '_internal_tools'), '._-'); // 'internal_tools'","handlingStrategy":"type-guard","validationCode":"$slug = ltrim($slug, '._-');","typeGuard":"function isValidShortName($slug) {\n  return PhabricatorRepository::isValidRepositorySlug((string)$slug);\n}","tryCatchPattern":"try {\n  PhabricatorRepository::assertValidRepositorySlug($slug);\n} catch (Exception $ex) {\n  // strip leading separators and revalidate, or reject\n}","preventionTips":["Trim leading '._-' after any sanitization or truncation step.","Begin slug conventions with a letter or digit."],"tags":["phabricator","php","validation","repository-shortname","naming-rules"],"backgroundTag":"invalid-identifier-prefix","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}