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 everyone, anyone knows why i don't have de command console data:import:category ??? As second pr

Options
U01UHQE5Z27
U01UHQE5Z27 Posts: 57 🧑🏻‍🚀 - Cadet
edited June 2021 in Slack General

Hi everyone, anyone knows why i don't have de command console data:import:category ???

As second problem, if run a full import with console data:import i get this error:

Spryker\Zed\DataImport\Business\Exception\DataImportException - Exception: The key "category_key" was not found in data set. Available keys: "category_key , parent_category_key, name.de_DE, meta_title.de_DE, meta_description.de_DE, meta_keywords.de_DE, name.en_US, meta_title.en_US, meta_description.en_US, meta_keywords.en_US, locales, localizedAttributes"

It says, the "category_key" was not found, but in available keys really exist "category_key"

Thanks for your help

Comments

  • U01LKKBK97T
    U01LKKBK97T Posts: 287 🧑🏻‍🚀 - Cadet
    Options

    You can make data:import:category executable by registering it in ConsoleDependencyProvider->getConsoleCommands.

    Regarding the category_key, please check the csv file's charset. A while ago I was having a similar issue and it turned out to be due to UTF-8 with BOM. It was looking like the correct key, but it contained invisible characters.

  • U01T075RRHD
    U01T075RRHD Posts: 118 🧑🏻‍🚀 - Cadet
    Options

    Did you try console data:import category yet?

  • Andriy Netseplyayev
    Andriy Netseplyayev Domain Lead Solution Architecture Sprykee Posts: 519 🧑🏻‍🚀 - Cadet
    Options

    regarding the second problem: there seems to be a space after “category_key”, please check that

  • Andriy Netseplyayev
    Andriy Netseplyayev Domain Lead Solution Architecture Sprykee Posts: 519 🧑🏻‍🚀 - Cadet
    Options

    “category_key ,”

  • U01UHQE5Z27
    U01UHQE5Z27 Posts: 57 🧑🏻‍🚀 - Cadet
    Options

    Thanks @U01LKKBK97T i´m going to check the charset

  • U01UHQE5Z27
    U01UHQE5Z27 Posts: 57 🧑🏻‍🚀 - Cadet
    Options

    @UK5EG6PBM yes, i tried the command and get this
    "Symfony\Component\Console\Exception\CommandNotFoundException - Exception: Command "data:import:category" is ambiguous.
    Did you mean one of these?
    data:import:category-template This command executes your "category-template" importer.
    data:import:category-store This command executes your "category-store" importer..
    in /data/vendor/symfony/console/Application.php (716)"

  • U01UHQE5Z27
    U01UHQE5Z27 Posts: 57 🧑🏻‍🚀 - Cadet
    Options

    @UKJSE6T47 I try with and without space but not work

  • U01LKKBK97T
    U01LKKBK97T Posts: 287 🧑🏻‍🚀 - Cadet
    Options

    I still think that the category importer is missing in ConsoleDependencyProvider. Not all importers shipped with the demoshop are registered there, you might need to add it.

  • Andriy Netseplyayev
    Andriy Netseplyayev Domain Lead Solution Architecture Sprykee Posts: 519 🧑🏻‍🚀 - Cadet
    edited June 2021
    Options

    okay. To be sure: the space between “category_key” and the following comma - is what I meant. If that doesn’t work - could be an encoding issue, but looks weird

  • U01UHQE5Z27
    U01UHQE5Z27 Posts: 57 🧑🏻‍🚀 - Cadet
    Options

    it was the encoding, i have UTF-8 BOM, change it to UTF-8 and works.

    Now i got another problem xD

    Spryker\Zed\DataImport\Business\Exception\DataImportException - Exception: SQLSTATE[HY000]: General error: 1364 Field 'fk_category_template' doesn't have a default value

    Executed query:
    INSERT INTO spy_category (id_category, category_key) VALUES (:p0, :p1)

    DataImport for "category" at data set position "1" has an error.

  • U01LKKBK97T
    U01LKKBK97T Posts: 287 🧑🏻‍🚀 - Cadet
    Options

    Sounds like you broke the csv file when changing the charset. Does everything look like before? I mean column separator and enclosing quotes...

  • U01UHQE5Z27
    U01UHQE5Z27 Posts: 57 🧑🏻‍🚀 - Cadet
    Options

    Yes, the problem was, i don't include template_name in csv

  • U01LKKBK97T
    U01LKKBK97T Posts: 287 🧑🏻‍🚀 - Cadet
    Options

    How about including it then? 😜