doctrine/orm · error · InvalidArgumentException
Could not find any mapped Entity classes matching "%s"
Error message
Could not find any mapped Entity classes matching "%s"
What it means
Error "Could not find any mapped Entity classes matching "%s"" thrown in doctrine/orm.
Source
Thrown at src/Tools/Console/Command/MappingDescribeCommand.php:247
*
* @param string $entityName Full or partial entity name
*/
private function getClassMetadata(
string $entityName,
EntityManagerInterface $entityManager,
): ClassMetadata {
try {
return $entityManager->getClassMetadata($entityName);
} catch (MappingException) {
}
$matches = array_filter(
$this->getMappedEntities($entityManager),
static fn ($mappedEntity) => preg_match('{' . preg_quote($entityName) . '}', $mappedEntity),
);
if (! $matches) {
throw new InvalidArgumentException(sprintf(
'Could not find any mapped Entity classes matching "%s"',
$entityName,
));
}
if (count($matches) > 1) {
throw new InvalidArgumentException(sprintf(
'Entity name "%s" is ambiguous, possible matches: "%s"',
$entityName,
implode(', ', $matches),
));
}
return $entityManager->getClassMetadata(current($matches));
}
/**
* Format the given value for console outputView on GitHub (pinned to d9b9ff7301)
When it happens
Trigger: Thrown at src/Tools/Console/Command/MappingDescribeCommand.php:247 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of doctrine/orm@d9b9ff7301 (2026-08-21).
Data as JSON: /api/errors/9f3478c7ab9a2a89.
Report an issue: GitHub.