phacility/phabricator · error · Exception
Credential "%s" is of unknown type "%s"!
Error message
Credential "%s" is of unknown type "%s"!
What it means
Thrown by PassphraseAbstractKey::validateCredential() when a successfully loaded credential's stored type constant fails to resolve to an implementation via getImplementation(). Unlike the load failure, the row exists and is visible to the viewer, but its type class is not registered in this install — almost always an uninstalled, renamed, or broken custom credential type. The message helpfully includes both the monogram and the offending constant.
Source
Thrown at src/applications/passphrase/keys/PassphraseAbstractKey.php:38
->withPHIDs(array($phid))
->needSecrets(true)
->executeOne();
if (!$credential) {
throw new Exception(pht('Failed to load credential "%s"!', $phid));
}
return $credential;
}
private function validateCredential(
PassphraseCredential $credential,
$provides_type) {
$type = $credential->getImplementation();
if (!$type) {
throw new Exception(
pht(
'Credential "%s" is of unknown type "%s"!',
$credential->getMonogram(),
$credential->getCredentialType()));
}
if ($type->getProvidesType() !== $provides_type) {
throw new Exception(
pht(
'Credential "%s" must provide "%s", but provides "%s"!',
$credential->getMonogram(),
$provides_type,
$type->getProvidesType()));
}
}
protected function loadAndValidateFromPHID(
$phid,View on GitHub (pinned to 5720a38cfe)
Solutions
- List registered implementations with PassphraseCredentialType::getAllTypes() and compare with the constant in the error message.
- Re-enable or reinstall the extension providing that constant.
- Migrate the credential to a standard type, or destroy it and create a replacement of a supported type.
Defensive patterns
Strategy: validation
Validate before calling
$all = PassphraseCredentialType::getAllTypes();
if (empty($all[$credential->getCredentialType()])) {
// extension missing: reinstall it, migrate, or destroy the credential
} Type guard
function credential_type_is_installed($credential) {
$all = PassphraseCredentialType::getAllTypes();
return isset($all[$credential->getCredentialType()]);
} Try / catch
try {
$key = PassphraseSSHKey::loadFromPHID($phid, $viewer);
} catch (Exception $ex) {
if (preg_match('/unknown type/', $ex->getMessage())) {
// reinstall the owning extension or replace the credential
}
} Prevention
- Keep custom PassphraseCredentialType classes installed wherever their credentials exist.
- Rename type constants only with a matching data migration.
- Audit stored constants against getAllTypes() after every extension change.
When it happens
Trigger: Loading a key through loadAndValidateFromPHID() for a credential whose type constant came from a disabled extension; a type class renamed between versions while old rows kept the old constant.
Common situations: Disabling a site extension that provided a PassphraseCredentialType; copying a database between installs with different extension sets; upgrading code that changed a type constant without a storage patch.
Related errors
- Credential has invalid type "%s"!
- Credential has invalid type "%s"!
- Credential has invalid type "%s"!
- Credential has invalid type "%s"!
- Credential has invalid type "%s"!
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/7ba470eb389fa790.
Report an issue: GitHub.