import icon indicating copy to clipboard operation
import copied to clipboard

Circular reference detected for service "import_app_simple.simple"

Open David-Magebinary opened this issue 5 years ago • 9 comments

** Exception that I got ** [Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException] Circular reference detected for service "import_app_simple.simple", path: "import_app_simple.simple -> import.modules -> import.module.plugin".

How to reproduce the issue: After generating the ok file, was trying to import the stock information.

./vendor/bin/import-simple import:products:inventory:msi --magento-edition CE --magento-version 2.3.3 --db-pdo-dsn mysql:host=172.17.0.1\;port=3306\;dbname=biv_m2 --db-username root --db-password xxxxx --source-dir /xx/xxxx

** Dirty fix solution:**

  1. Comment <argument type="service" id="import_app_simple.simple"/> in the file /vendor/techdivision/import/symfony/Resources/config/services.xml
  2. Remove all the application related code in the TechDivision\Import\Modules\PluginModule class

I did not use Symfony before, not really sure what the error is related to. Looks like it is a looping injecting issue. eg. parent -> child -> child -> parent

David-Magebinary avatar Feb 20 '20 21:02 David-Magebinary

Hi @David-Magebinary I'll check this issue and keep you updated. Thanks for reporting.

wagnert avatar Feb 21 '20 09:02 wagnert

@David-Magebinary I've tested it with version 3.8.7 with the following command

~/workspace/techdivision/import-cli-simple/bin/import-simple import:create:ok-file \
  && ~/workspace/techdivision/import-cli-simple/bin/import-simple \
    import:products:inventory:msi \
    --magento-edition=EE \
    --magento-version=2.3.4 \
    --db-pdo-dsn="mysql:host=127.0.0.1;dbname=magento_ee_234;charset=utf8" \
    --db-username=root \
    --db-password=xxxx \
    --source-dir=var/importexport

from within the Magento installation directory, and it works without any problem. So I've some questions:

  • Which PHP version are you using
  • Which M2IF version are you using
  • From which directory do you invoke the commands (inside or outside the Magento installation directory)

Hope your answers will help me to allow me to reproduce the issue.

Thanks for supporting Tim

wagnert avatar Feb 21 '20 09:02 wagnert

@wagnert PHP version: 7.4.2 M2IF version: "require": { "php": ">=7.1.0", "techdivision/import": "15.0.3", "techdivision/import-cli": "9.0.2", "techdivision/import-app-simple": "16.0.0", "techdivision/import-configuration-jms": "15.0.3", "techdivision/import-ee": "14.0.0", "techdivision/import-attribute": "17.0.1", "techdivision/import-attribute-set": "12.0.0", "techdivision/import-customer": "14.0.0", "techdivision/import-customer-address": "14.0.1", "techdivision/import-category": "17.0.2", "techdivision/import-category-ee": "18.0.1", "techdivision/import-product": "19.0.1", "techdivision/import-product-msi": "14.0.0", "techdivision/import-product-tier-price": "12.0.0", "techdivision/import-product-url-rewrite": "18.0.2", "techdivision/import-product-link": "19.0.0", "techdivision/import-product-media": "19.0.0", "techdivision/import-product-bundle": "19.0.0", "techdivision/import-product-variant": "19.0.0", "techdivision/import-product-grouped": "13.0.0", "techdivision/import-product-ee": "19.0.0", "techdivision/import-product-link-ee": "20.0.0", "techdivision/import-product-media-ee": "19.0.0", "techdivision/import-product-bundle-ee": "20.0.0", "techdivision/import-product-variant-ee": "20.0.0", "techdivision/import-product-grouped-ee": "14.0.0", "techdivision/import-converter": "9.0.0", "techdivision/import-converter-ee": "9.0.0", "techdivision/import-converter-product-category": "1.0.0", "techdivision/import-converter-product-attribute": "1.0.0" }

Outside of the Magento installation directory

David-Magebinary avatar Feb 26 '20 21:02 David-Magebinary

@David-Magebinary As M2IF was usually optimized within the Magento PHP environment, it has not been ready for PHP 7.4, as Magento itself, yet. We're working on this, but it'll take some time to make it work.

wagnert avatar Mar 10 '20 19:03 wagnert

@wagnert Do you have a solution or the cause of the issue in your mind? I can submit a pull request but I have to know what is your preferred solution for fixing this issue.

David-Magebinary avatar Mar 15 '20 08:03 David-Magebinary

@David-Magebinary I need to investigate more into the PHP 7.4 problems (there are several others). Did you try the PHAR file?

wagnert avatar Mar 15 '20 10:03 wagnert

@David-Magebinary Did you found the time to test the PHAR file meanwhile? :-)

wagnert avatar Mar 20 '20 19:03 wagnert

Hello @wagnert ,

David is away for a few months. I can test it for you or provide you with the docker container if that's helpful.

Thanks, Adel.

Adel-Magebinary avatar May 05 '20 04:05 Adel-Magebinary

@Adel-Magebinary This would be awesome 🙂 Thanks

wagnert avatar May 05 '20 05:05 wagnert