How do i get create a "Mautic\CoreBundle\Entity\IpAddress" object

I either want to create one from scratch or get one based on a record from the database.

when i do

$ip = "";

        $IpAddressObject = new IpAddress();


i get error

[2022-01-18 08:07:20] mautic.CRITICAL: Uncaught PHP Exception Doctrine\ORM\ORMException: 
"The EntityManager is closed." at /home/csanewsc/public_html/crm/vendor/doctrine/orm/lib
/Doctrine/ORM/ORMException.php line 145 {"exception":"[object] (Doctrine\\ORM
\\ORMException(code: 0): The EntityManager is closed. at /home/csanewsc/public_html/crm/vendor
/doctrine/orm/lib/Doctrine/ORM/ORMException.php:145)"} []