Upserting content with Id from previously deleted empty schema errors

I have…

  • [ ] Checked the logs and have uploaded a log file and provided a link because I found something suspicious there. Please do not post the log file in the topic because very often something important is missing.

I’m submitting a…

  • [ ] Regression (a behavior that stopped working in a new release)
  • [ x] Bug report
  • [ ] Performance issue
  • [ ] Documentation issue or request

Current behavior

Re-upserting a ContentItem with Id fails if the schema is empty, been deleted, then re-created. Message returns 400 “Invalid Command”.

Expected behavior

Upserting the ContentItem with Id succeeds

Minimal reproduction of the problem

Create empty Schema “a”
Create ContentItem with Guid Id b34128ee-2fb1-56df-8c84-9dd5f7caafeb
Delete Schema
Recreate Schema “a”
Attempt to create Content with same Guid id
Response is 400 “Invalid Command”

Environment

  • [x] Self hosted with docker
  • [ ] Self hosted with IIS
  • [ ] Self hosted with other version
  • [ ] Cloud version

Version: [VERSION]

Browser:

  • [x] Chrome (desktop)
  • [ ] Chrome (Android)
  • [ ] Chrome (iOS)
  • [x] Firefox
  • [ ] Safari (desktop)
  • [ ] Safari (iOS)
  • [ ] IE
  • [ ] Edge

Others:
*I noticed that no ContentCreated event document is created in the mongoDb store when no fields are available.
*I noticed that I could Upsert a deleted item with an pre-used Id if fields exist within the schema

Yes, thats a restriction of the “never delete policy”. When you do not delete a content permanently, then the ID is taken forever.

Thank you so much for your quick response. In that event, where deleting the schema deletes a contentItem and schema is re-created), is it possible to permanently delete the Id of the old content item after it has gotten into that state via API calls?

I’m attempting to move some legacy data with Ids around. I’m mainly trying to figure out if someone accidentally deleted the schema and the migration needed to be re-run that I could manually clean up the Ids that weren’t permanently deleted, or upsert over them. Basically, whatever allows a second attempt at migration would probably work fine for me.

Thank you so much for your quick response. In that event, where deleting the schema deletes a contentItem and schema is re-created), is it possible to permanently delete the Id of the old content item after it has gotten into that state via API calls?

Unfortunately not. If the schema would be still there it would be possible. You can undo the deletion, but you have to hook into the DB for that.

It should be enough if you just remove the “deleted” flag from the schema.

1 Like