Strange error cropping up when using content manager

System Information
  • Strapi Version: 4.9.0
  • Operating System: Ubuntu
  • Database: PG
  • Node Version: 14.21.3
  • NPM Version: 6.14.18
  • Yarn Version:

Recently completed a migration from version 3 to version 4, after a log of manual fixing data we finally had everything working as expected. Our content manager was adding content just fine one day then the next day it quit working. I had a backup of the database before I handed it over so I thought they did someting wrong. I restored the DB and the error went away. Here we are a few days later and no matter what we get his error when trying to add new records. I’m specifically trying to add a playlist to a playlist collection. see schema below

What I don’t understand is why this would just stop working

error: insert into “components_blocks_playlists_playlist_links” (“playlist_id”, “playlists_id”) values ($1, $2) returning “id” - duplicate key value violates unique constraint “components_blocks_playli sts_playlist_links_pkey”

Play List Collections:
{
“kind”: “collectionType”,
“collectionName”: “playlist_collections”,
“info”: {
“singularName”: “playlist-collection”,
“pluralName”: “playlist-collections”,
“displayName”: “Playlist Collection”,
“description”: “”
},
“options”: {
“draftAndPublish”: true
},
“pluginOptions”: {},
“attributes”: {
“title”: {
“type”: “string”
},
“type”: {
“type”: “string”
},
“playlists”: {
“type”: “component”,
“repeatable”: true,
“component”: “blocks.playlists”
}
}
}

PlayList:

{
“kind”: “collectionType”,
“collectionName”: “playlists”,
“info”: {
“singularName”: “playlist”,
“pluralName”: “playlists”,
“displayName”: “Playlist”,
“description”: “”
},
“options”: {
“draftAndPublish”: true
},
“pluginOptions”: {},
“attributes”: {
“title”: {
“type”: “string”
},
“activity_title”: {
“type”: “string”
},
“label”: {
“type”: “string”
},
“description”: {
“type”: “string”
},
“sfa”: {
“type”: “boolean”
},
“meta_tags”: {
“type”: “relation”,
“relation”: “manyToMany”,
“target”: “api::meta-tag.meta-tag”,
“inversedBy”: “playlists”
},
“slug”: {
“type”: “uid”,
“targetField”: “title”
},
“list”: {
“type”: “component”,
“repeatable”: true,
“component”: “blocks.list”
},
“SortOrder”: {
“type”: “integer”
}
}
}


Our V3 PlayList Schema:

has additional stuff, I didn’t build this so I’m not sure what these relations are for. I suspect they may enable what I’m trying to do.

====================================
“playlists”: {
“collection”: “playlist”,
“via”: “backlinks”,
“dominant”: true
},
“backlinks”: {
“collection”: “playlist”,
“via”: “playlists”
}

FULL SCHEMA
{
“kind”: “collectionType”,
“collectionName”: “playlists”,
“info”: {
“name”: “Playlist”
},
“options”: {
“increments”: true,
“timestamps”: true
},
“attributes”: {
“title”: {
“type”: “string”
},
“activity_title”: {
“type”: “string”
},
“label”: {
“type”: “string”
},
“description”: {
“type”: “text”
},
“sfa”: {
“type”: “boolean”
},
“meta_tags”: {
“collection”: “meta-tags”,
“via”: “playlists”,
“dominant”: true
},
“slug”: {
“type”: “uid”,
“targetField”: “title”
},
“list”: {
“type”: “component”,
“repeatable”: true,
“component”: “blocks.list”
},
“homelink”: {
“model”: “playlist”
},
“playlists”: {
“collection”: “playlist”,
“via”: “backlinks”,
“dominant”: true
},
“backlinks”: {
“collection”: “playlist”,
“via”: “playlists”
}
}
}

Ugg, I need to quit posting here. Just solved the issue incorrect relation mapping on a couple of blocks