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, I'am importing categories by console data:import:category and I get this error Spryker

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

Hi everyone, I'am importing categories by console data:import:category and I get this error

Spryker\Zed\DataImport\Business\Exception\DataImportException - Exception: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '/de' for key 'spy_url_unique_key'

Executed query:
INSERT INTO spy_url (id_url, fk_locale, fk_resource_categorynode, url) VALUES (:p0, :p1, :p2, :p3)

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

Anyone know what it means?

Comments

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

    Sounds like url /de is already taken by your homepage and you're trying to import a category having the same url.
    Have a look at db table spy_url. If there already is an entry for /de, check which of the fk_... fields is populated.

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

    ok, but how i can set the url for the category?

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

    Have a look at vendor/spryker/category-data-import/src/Spryker/Zed/CategoryDataImport/Business/Model/CategoryWriterStep.php. In function findOrCreateNode, the url will be built and stored.