Skip to content

collisions on deliveryKey when importing a folder of content items #173

Open

Description

@rcorbett-scs

I keep running into collisions on deliveryKey when importing a folder of content items

running dc-cli --baseRepo 62b07a46c9e77c00010c38a5 content-item import ././wallpaperCSVs/wallpaper/MY_FOLDER_NAME --force --publish --batchPublish

The goal is that I want to upsert NEW content items using dc-cli; if item does not exist then create new, else update existing item (which is why I added --force).

I get this error almost every 2nd or 3rd attempt at running the dc-cli import command... the only "fix" I know to do it to remove the .json file that has the deliveryKey that is an issue - and attempt to reimport the folder again...

Existing mapping loaded from '/Users/robb/.amplience/imports/repo-62b07a46c9e77c00010c38a5.json', changes will be saved back to it.
Scanning structure and content in '././trbCSVs/blogs/trb-2019-schema-1680220742-clean-import' for repository 'Content'...
Done. Validating content...
Found 1 dependancy levels in 6 items, 0 referencing a circular dependancy.
Importing 6 content items...
ERROR: Failed creating Article - Ladies Turkey Hunt for Texas Rios:
Error: Request failed with status code 409: {"errors":[{"level":"ERROR","code":"CONTENT_ITEM_DELIVERY_KEY_DUPLICATE","message":"Required delivery key already exists on this hub","property":"body._meta.deliveryKey","entity":"ContentItem","invalidValue":"the-realblog-with-stephanie-mallory/ladies-turkey-hunt-for-texas-rios"}]}
Importing content item failed, aborting. Error: Error: Request failed with status code 409: {"errors":[{"level":"ERROR","code":"CONTENT_ITEM_DELIVERY_KEY_DUPLICATE","message":"Required delivery key already exists on this hub","property":"body._meta.deliveryKey","entity":"ContentItem","invalidValue":"the-realblog-with-stephanie-mallory/ladies-turkey-hunt-for-texas-rios"}]}
Log written to "/Users/robb/.amplience/logs/item-import-1680230116189.log".

Activity

  1. rcorbett-scs commented on Mar 31, 2023

    @rcorbett-scs
    Author

    note that sometimes I can import 20-30 at a time, but usually I do 3-4, then need to sift through and delete the .json files then try again... very slow going.

    not sure if this is a bug in the logic of the tool or an improvement is need to allow for a specific create option like $ dc-cli content-item create [[folder_name]] to make multiple new items in builk

  2. rcorbett-scs commented on Apr 4, 2023

    @rcorbett-scs
    Author

    another suggestion; process the entire folder, but instead of stopping on errors simply output the errors to the log file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions