Shopware client import error: EntityManager closed

When importing a bulk client into Shopware, only the first line from the imported CSV then throws an error

"EntityManager closed."

If I try to use only single data, it imports the client, but also generates the same "EntityManager closed" error.

Tested core_production_date.log

and importexport.log

in shopware/var/log/

there there.

Also marked Configureation->logfile

, there is nothing there.

How can I get the actual error log, why is this happening? Please let me know if anyone can help.

Store version - 5.2.27

Thank.

+3


source to share


2 answers


Closing the EntityManager occurs when the Query Database Context has been closed due to some SQL Exception. In my project this happened when using the Shopware Resource API, which can also be used by the Importer. The resource is catching the error, so it won't show up in the logs. The object manager is closed, although, according to the teachings, due to a SQL error, it cannot be reopened in the same query. Thus, any call after that will end with the message "EntityManager is closed".



It helps if you find a way to run the import in the console where the error will show at least as a console log. You can also take a look at the resource itself to see what data might be wrong or missing.

+1


source


You can use try..catch and reset the EntityManager in the catch clause if it is closed (you have to extend your API class), for example:



try {
 ... you code ...
} catch (\Exception $e) {
    if (!$this->getManager()->isOpen()) {
        $this->resetEntityManager();
    }
...
}

      

0


source







All Articles