Calling Developers!
We are reenergizing our code contribution process! Learn More

What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hi I'm learning the data import mechanism. I tried the combined importer for a single shop but I get

Options
U03T08LE3CP
U03T08LE3CP Posts: 185 🧑🏻‍🚀 - Cadet

Hi I'm learning the data import mechanism. I tried the combined importer for a single shop but I get the following error:

$ docker/sdk console data:import --config=data/import/common/DE/DE.yml -t -o 2 -l 1 
-->  DEVELOPMENT MODE   
Store: DE | Environment: docker.dev
Starting import with data/import/common/DE/DE.yml configuration file.
ErrorException - Exception: array_values() expects parameter 1 to be array, bool given 
in /data/vendor/spryker/data-import/src/Spryker/Zed/DataImport/Business/Model/DataReader/CsvReader/CsvReader.php (180)

Command: /data/vendor/bin/console data:import --config=data/import/common/DE/DE.yml -t -o 2 -l 1

Trace: 
#0 [internal function]: Spryker\Shared\ErrorHandler\ErrorHandlerEnvironment->Spryker\Shared\ErrorHandler\{closure}(2, 'array_values() ...', '/data/vendor/sp...', 180, Array)

Comments

  • U03T08LE3CP
    U03T08LE3CP Posts: 185 🧑🏻‍🚀 - Cadet
    Options

    Fiddling with the CsvReader the underlying error is:

    Starting import with data/import/common/DE/DE.yml configuration file.
    Spryker\Zed\DataImport\Business\Exception\DataSetWithHeaderCombineFailedException - Exception: Can not combine data set header with current data set. Keys: "category_key, included_store_names, excluded_store_names", Values "" 
    
  • U021QH3GDGV
    U021QH3GDGV Posts: 17 🧑🏻‍🚀 - Cadet
    Options

    It depends on more things. You have defined in DE.yml file what CSV files you are importing for specific data-entity. Example: Importing product data into customer table. It looks to me like you are tying to import categories. It could be that for data_entity: category path of desired CSV file is wrong.
    Other thing could be that you CSV file is empty or is not valid or wrongly populated (has more headlines that data etc. -> use some CSV validator to show you if your csv file is ok).

  • U03T08LE3CP
    U03T08LE3CP Posts: 185 🧑🏻‍🚀 - Cadet
    Options

    this is the stock DE file in the demo shop

  • U03T08LE3CP
    U03T08LE3CP Posts: 185 🧑🏻‍🚀 - Cadet
    Options

    no changes in the data have been made

  • U021QH3GDGV
    U021QH3GDGV Posts: 17 🧑🏻‍🚀 - Cadet
    Options

    And what of the content in your csv file

  • U03T08LE3CP
    U03T08LE3CP Posts: 185 🧑🏻‍🚀 - Cadet
    Options

    whatever that yml points to, in the demo shop

  • U03T08LE3CP
    U03T08LE3CP Posts: 185 🧑🏻‍🚀 - Cadet
    Options

    all the csv in that same directory

  • U021QH3GDGV
    U021QH3GDGV Posts: 17 🧑🏻‍🚀 - Cadet
    Options

    And is it empty or populated ?

  • U03T08LE3CP
    U03T08LE3CP Posts: 185 🧑🏻‍🚀 - Cadet
    Options

    the database? It's populated

  • U021QH3GDGV
    U021QH3GDGV Posts: 17 🧑🏻‍🚀 - Cadet
    Options

    CSV file

  • U03T08LE3CP
    U03T08LE3CP Posts: 185 🧑🏻‍🚀 - Cadet
    Options
  • U03T08LE3CP
    U03T08LE3CP Posts: 185 🧑🏻‍🚀 - Cadet
    Options

    oh sorry that is the marketplace demo but the shop demo is in use (the files are identical) https://github.com/spryker-shop/b2b-demo-shop/tree/master/data/import/common/DE

  • U03T08LE3CP
    U03T08LE3CP Posts: 185 🧑🏻‍🚀 - Cadet
    edited August 2022
    Options

    Does the demo shop have combined product importer installed? I'm trying to verify and it looks like it. Running the whole importer

    docker/sdk console data:import --config=data/import/common/DE/DE.yml -t
    -->  DEVELOPMENT MODE   
    Store: DE | Environment: docker.dev
    Starting import with data/import/common/DE/DE.yml configuration file.
    Spryker\Zed\DataImport\Business\Exception\DataImportException - Exception: Unable to execute INSERT statement [INSERT INTO spy_url (id_url, fk_locale, fk_resource_product_abstract, url) VALUES (:p0, :p1, :p2, :p3)]
    
    DataImport for "combined-product-abstract" at data set position "2" has an error.
    
    For debugging execute "vendor/bin/console data:import:combined-product-abstract -o 2 -l 1 -t"
    
    /data/src/Orm/Zed/Url/Persistence/Base/SpyUrl.php:1208 
    
    #0 /data/src/Orm/Zed/Url/Persistence/Base/SpyUrl.php(1092): Orm\Zed\Url\Persistence\Base\SpyUrl->doInsert(Object(Propel\Runtime\Connection\ConnectionWrapper))
    #1 /data/src/Orm/Zed/Url/Persistence/Base/SpyUrl.php(995): Orm\Zed\Url\Persistence\Base\SpyUrl->doSave(Object(Propel\Runtime\Connection\ConnectionWrapper))
    #2 /data/vendor/propel/propel/src/Propel/Runtime/Connection/TransactionTrait.php(35): Orm\Zed\Url\Persistence\Base\SpyUrl->Orm\Zed\Url\Persistence\Base\{closure}()
    
  • U03T08LE3CP
    U03T08LE3CP Posts: 185 🧑🏻‍🚀 - Cadet
    Options

    But then:

    docker/sdk console data:import:combined-product-abstract -o 2 -l 1 -t
    -->  DEVELOPMENT MODE   
    Store: DE | Environment: docker.dev
    Symfony\Component\Console\Exception\CommandNotFoundException - Exception: Command "data:import:combined-product-abstract" is not defined.
    
  • U03T08LE3CP
    U03T08LE3CP Posts: 185 🧑🏻‍🚀 - Cadet
    Options

    debugging more, this line has something wrong int he demo data:

    999,999_25880805,DE,tablets,10,#000000,Communication Electronics,2020-05-01 0:00:00,2020-05-01 0:00:00,Neu HP Slate 10 Pro EExx,New HP Slate 10 Pro EExx,"Für Schulen entwickelt Stellen Sie ein Tablet bereit, das speziell für die hohen Anforderungen im Schulalltag entwickelt wurde und dank Intel® Quad-Core-Pr",Let tablet Improve 1:1 learning and elevate student engagement with the Android™ tablet built for schools. The mobility and durability of the HP Pro Slate,"HP,Communication Electronics","HP,Communication Electronics",/de/hp-slate-10-pro-ee-169,/en/hp-slate-10-pro-ee-169,,,1,1,both,Neu HP Slate 10 Pro EExx,New HP Slate 10 Pro EExx,"Für Schulen entwickelt Stellen Sie ein Tablet bereit, das speziell für die hohen Anforderungen im Schulalltag entwickelt wurde und dank Intel® Quad-Core-Prozessor, einem entspiegelten HD Touch-Display mit 25,65 cm (10 Zoll) Diagonale und Handschriftunterstützung (mit optimalem Eingabestift) ein 1:1-Lernerlebnis zu einem erschwinglichen Preis bietet.      Erzielen Sie ein 1:1-Lernerlebnis und steigern Sie das Engagement der Schüler mit diesem Android™-Tablet, das speziell für Schulen entwickelt wurde. Das zuverlässige und robuste HP Pro Tablet 10 EE umfasst Lerntools und flexible Konnektivitätsoptionen für ein Lernerlebnis über das Klassenzimmer hinweg. Darüber hinaus unterstützen professionelle Support- und Serviceleistungen das Lehrpersonal bei der Einbindung neuer IT-Komponenten.","Let tablet Improve 1:1 learning and elevate student engagement with the Android™ tablet built for schools. The mobility and durability of the HP Pro Slate 10 EE includes learning tools and flexible connectivity to expand education beyond the walls of the classroom, plus professional support and services to help educators confidently incorporate new IT.  ",internal_storage_capacity,32 GB,,,,,processor_cache,2 MB,,,,,display_technology,IPS,,,,,touch_technology,Mulit-touch,,,,,brand,HP,,,color,Schwarz,color,Black,Warehouse1,12,0,0,,,abstract,DEFAULT,DE,EUR,199,210,,abstract,default,<https://images.icecat.biz/img/norm/high/25904145-Sony.jpg,https://images.icecat.biz/img/norm/medium/25904145-Sony.jpg,de_DE,0,product_image_194>,