I do encounter the same issue after the migration from strapi v3 to v4.
In my case that’s because the count permission not exist anymore.
white the count permission was migrated from db level into the new permission table “up_permissions”.
once I clean up the records with sql below, problem solved.
select *
--delete
from up_permissions up
where "action" ~ 'count'
The log detail in my case:
[2023-06-20 07:32:06.955] debug: Unknown action "api::product-attribute.product-attribute.count" supplied when registering a new permission
[2023-06-20 07:32:06.955] debug: Unknown action "api::product-category.product-category.count" supplied when registering a new permission
[2023-06-20 07:32:06.955] debug: Unknown action "api::product-image.product-image.count" supplied when registering a new permission
[2023-06-20 07:32:06.955] debug: Unknown action "api::product.product.count" supplied when registering a new permission
Hey, yes, I also had to clean-up some database entries manually.
I had searched for this strings “api::…” and deleted the entries from the permissions table (I don’t remember what is the exact table)