since 2 weeks, we are having this problem while trying to flush new elements:
CRITICAL: Doctrine\\ORM\\ORMInvalidArgumentException: A new
CRITICAL: Doctrine\\ORM\\ORMInvalidArgumentException:
A new
In my case a too early call of
$this->entityManager->clear();
caused the problem. It also disappeared by only doing a clear on the recent object, like
$this->entityManager->clear($capture);