Some of the provided components in xxx are not related to the entity

System Information
  • Strapi Version: 4.1.9
  • Operating System: Mac
  • Database: MariaDB 10.7.3
  • Node Version: 16
  • NPM Version:
  • Yarn Version: 1.22.11

I am exporting few collection entries via strapi.entityService.findMany and setting as option populate: "*".

When then I try to import the same data via strapi.entityService.update I get the error:

Some of the provided components in seo are not related to the entity

With hero being the name of the component in api::homepage.homepage in field seo

What does this error mean?

For reference, this is what the data exported looks like:

{
  "api::homepage.homepage": [
    {
      "id": 1,
      "title": "hello",
      "slug": "hello",
      "createdAt": "2022-04-20T04:33:38.256Z",
      "updatedAt": "2022-04-27T16:07:56.941Z",
      "publishedAt": "2022-04-20T04:33:44.720Z",
      "seo": { "id": 1, "title": "dsadsa", "description": "dasdsa" },
    }
  ]
}

By hero i meant seo :slight_smile:

I actually figure out the id field is the issue. If it is not provided, then it would work correctly. If the id is different, say I have a duplicate entry in the database and I pick the id of the same other identical entry, will return that error.

The issue could be I have exported and imported first all components. Then I tried to export and import all collection types. The id of seo stayed the same, but somehow when I tried to populate it a second time when I imported all the collections, it did throw this error.

1 Like

So do you have any advice how to fix this? I am getting the same with data in dynamic zones.

@smiley @gvocale Did you find a solution for this issue? I am having this issue as well, and for my use case I would like to keep the id of component when I update, is there any possible way for me to do that?

I am also getting the same error in the Strapi admin to one of my collection. I have used a component for SEO.

Due to this issue, the Save action is not working. I have to refresh the page and then save it which is frustrating.

I’m also having this issue, only when I remove all components does it work again. You didn’t by any chance migrate from v3?

This is because of your seo object inside your payload have id, remove id simply by delete seo.id and then send the payload.

Hope it helps!