Hitting MODULAR_BLOCK_IN_USE when performing migration (autogenerated migration script)

Hitting an error below when running the auto-generated migration script from β€œ@datocms/cli”: β€œ4.0.28”.

Suspected issue: it tries to remove a block that is used by another model.

The sequence written in the migration script = del block > del model, but it should be del model > block.

Error: DELETE https://site-api.datocms.com/item-types/CyAO43hzTMuSjjhJLx61aQ?skip_menu_items_deletion=true: 422 N/A

[
  {
    "id": "08f4de",
    "type": "api_error",
    "attributes": {
      "code": "MODULAR_BLOCK_IN_USE",
      "details": {
        "field_id": "PWLOMgDnRNmxw7J6aW3ZTw",
        "item_type_id": "bizK-TefRZKeI3P28amh6A"
      },
      "doc_url": "https://www.datocms.com/docs/content-management-api/errors#MODULAR_BLOCK_IN_USE"
    }
  }
]

Hello @yiying.lim welcome to the community and thank you for the feedback!

This seems indeed to be an edge case bug on our CLI.

We’re taking a look at it, and I’ll get back to you as soon as we have any updates on this.

Thank you once again for letting us know!

Hey once again @yiying.lim !

We just shipped a fix for this on CLI 4.0.29

Can you update it and generate a new migration and let us know if it works as expected now?

Thank you very much once again for the feedback!

@m.finamor

Thanks! :smiley:

It’s working flawlessly in v4.0.29.

Really appreciate the effort from you and your team. Great work!

2 Likes