[Doctrine\\ORM\\ORMException]
The EntityManager is closed.
After I get a DBAL exception when inserting data, EntityManager closes and I\'m not
For what it's worth I found this issue was happening in a batch import command because of a try/catch loop catching an SQL error (with em->flush()) that I didn't do anything about. In my case it was because I was trying to insert a record with a non-nullable property left as null.
Typically this would cause a critical exception to happen and the command or controller to halt, but I was just logging this problem instead and carrying on. The SQL error had caused the entity manager to close.
Check your dev.log file for any silly SQL errors like this as it could be your fault. :)