Content is being deleted from strapi components

I have a strapi cms running in a Google Cloud run environment and have been having an issue with content types that have been created and deployed. One of the content types is a component and one is a single type.

The issue that I am facing is either:

  1. The content from the fields in the content type gets deleted
  2. The content type itself gets deleted from the content manager
  3. The API role permissions get reset.

Issue 2 is inconsistent as it only sometimes happens, and the way I have been resolving this is by rolling back and redeploying to the environment.

The above issues are also only happening in a live environment and not a staging site. I have had a look through the Google Cloud run instances and cannot spot any configuration differences between the 2 environments besides the specs of each container. I also cannot find any consistency of when the content is being deleted it seems to just randomly happen and is causing the site to go down.

When the site went down last i saw the following error log in Google Cloud console:

error: select “t0”.*, “t0”.“id”, “t0”.“id” from “public”.“components_component_cta_text_blocks” as “t0”
where (“t0”.“id” in ($1, $2)) - relation “public.components_component_cta_text_blocks” does not exist

I then found the cta_text_block component in the CMS content builder sitting there with no content. Removing the module from the page fixed the error and the site.

System Information
  • Strapi Version: 4.8
  • Operating System: Running on Google Cloud run environment
  • Database: Postgres 15.1.0.52
  • Node Version: 16.16.0

The site is also using REST cache which has been configured to run in memory using the following configuration:

"rest-cache": {
    config: {
      provider: {
        name: "memory",
        options: {
          max: 9932767,
          maxAge: 333600,
        },
      },
      strategy: {
        contentTypes: [
          // list of Content-Types UID to cache
          "api::page.page",
          "api::header.header",
          "api::footer.footer",
          "api::navigation.navigation",
          "api::sold-out-modal.sold-out-modal",
          "api::subscribe-modal.subscribe-modal"
        ],
      },
    },

Has anyone had this happen before or know any leads to follow?

FYI - This is a project that was built by someone and inherited by us, but the current team has very little Strapi knowledge as this is the first time working with this cms for us

Hey man , did you find any solutin on this i am also facing the same problem