Forge - Deleting redundant Storage Entity deployed to Development environment

We have a Forge app that is already in production. One of the developers added a new storage entity for testing purposes and deployed it to the development environment. Now, when we try to delete this entity from the manifest.yml file, an error occurs:

...
ℹ Packaging app files
ℹ Uploading app
ℹ Validating manifest

Error: Manifest validation failed: Failed to validate custom entities
Additional information: [
  {
    "message": "Entity \"test\" cannot be deleted",
    "extensions": {
      "errorType": "DELETED_ENTITY"
    }
  }
] (requestId: 705545fceb6b4ea3b9639d6d526f30a4)

How can we delete the redundant entity?
Alternatively, is it possible to delete the entire development environment and recreate it?

2 Likes

Up, I have the exact same issue, have been on it the whole day.

Btw here is the error I get:

Error: Manifest validation failed: Failed to validate custom entities
Additional information: [
{
“message”: “Index "projectkey" cannot be removed”,
“extensions”: {
“errorType”: “BREAKING_CHANGES_NOT_SUPPORTED”
}
}
] (requestId:

@KaiserSoft @Uli, would you please provide your appId and the requestId?

sure :slight_smile:

app:
id: ari:cloud:ecosystem::app/fe1fc4d3-0cca-4989-9181-b7f5bd2978a4

forge deploy
Warning: Your version of Forge CLI is out of date. We recommend you update to the latest version to get the latest features and bug fixes.
Run npm install -g @forge/cli@latest to update from version 7.1.0 to 8.0.0.

Deploying your app to the development environment.
Press Ctrl+C to cancel.

Running forge lint...
No issues found.

× Deploying wo-release-manager-app to development...

i Packaging app files
i Uploading app
i Validating manifest

Error: Manifest validation failed: Failed to validate custom entities
Additional information: [
  {
    "message": "Index \"groupname\" cannot be removed",
    "extensions": {
      "errorType": "BREAKING_CHANGES_NOT_SUPPORTED"
    }
  }
] (requestId: c5e3875ec06a4773bfe25a6230c82eda)

And also to be able to keep progressing I changed the manifest in that way :

app:
  id: ari:cloud:ecosystem::app/fe1fc4d3-0cca-4989-9181-b7f5bd2978a4

  storage:
    entities:
    - name: 'jiraproject-group'
      attributes:
        groupname:
          type: 'string'
        projectkey:
          type: 'string'
      indexes:
      - groupname
      - projectkey
        # Index to query project groups by name
      - name: 'by-groupName'
        range:
        - 'groupname'
      - name: 'by-projectkey'
        range:
        - 'projectkey'
    - name: 'jiraproject-group-test0001'
      attributes:
        groupname:
          type: 'string'
        projectkey:
          type: 'string'
      indexes:
      # - groupname
      # - projectkey
        # Index to query project groups by name
      - name: 'by-groupName'
        range:
        - 'groupname'
      - name: 'by-projectkey'
        range:
        - 'projectkey'

Adding multiple indexes for the same entity, and also duplicating ‘jiraproject-group’ into ‘jiraproject-group-test0001’ completly, but that’s not a very clean approach.

Hi @KaiserSoft @Uli Thanks for the detailed response. This is a known limitation of the platform as mentioned here.

Once you’ve deployed your app, you cannot delete any entities, attributes, or indexes defined in your manifest. If you do, Forge will return an error the next time you deploy your app. We are working on addressing this in a future update.

You can still add new attributes and indexes to an existing entity. Doing so will not count as an entity deletion.

There are 2 types of errors that you are seeing -

First one - In this, you are trying to delete an entity which is not allowed as per the above link.

{
    "message": "Entity \"test\" cannot be deleted",
    "extensions": {
      "errorType": "DELETED_ENTITY"
    }
  }

Second one - In this, you are trying to delete an index from an entity which is also not allowed as per the above link.

{
    "message": "Index \"groupname\" cannot be removed",
    "extensions": {
      "errorType": "BREAKING_CHANGES_NOT_SUPPORTED"
    }
  }

Further, can you help me understand what are you trying to achieve by duplicating the entity as in the original request you wanted to remove the entity?

1 Like

Hi @MuditJuneja ,

I’m still learning how to manage storage with forge, and so at first I didn’t get that I needed to declare a range:

      - name: 'by-groupName'
        range:
        - 'groupname'

To be able to query on the index (to be honest I’m still fuzzy on the matter and still trying to make it work as shared here Forge storage query : Variable "$range" got invalid value null)

So as I try different things I have to change things and repair my mistakes… :wink:

From what I understand I’ll continue to hack my way to make it work and then I’ll start the app from scratch coping files to a new project so I can have a clean setup. At least I know now :slight_smile:

Thanks for the explanation.

The issue is that we deployed the manifest.yml with a test entity to a Development environment by a mistake (“forge deploy”). Now, we cannot proceed with app development because it requires this entity, and we are no longer deploying to the Development environment.
Is there any way to delete the “corrupted” Development environment and recreate it again? We don’t need this redundant “test” entities in the production version of the app. By the way, our app ID is d47d1c6f-016e-478e-adbd-d890fb7951e4.

If you have access, could you please recreate the development environment from scratch? We will redeploy the correct version of the app. Alternatively, are you able to delete ALL entities from our app? We will deploy the correct manifest.yml afterward.

Thank you both for giving the complete context. Can you clarify why is this a development blocker for you? You can keep the entity definition same in the manifest file and deploy your app to any env (say production).

Dead code (and dead database entries) is quite a bad practice… useless indexes or entities makes for more confusion when trying to understand the code later on or for someone else.

Keeping dead code and redundant database entries can lead to inefficiencies and confusion in the codebase. It makes it harder for developers, including yourself or others, to understand and maintain the code in the future. Would you consider removing the dead code and unused database entries to improve the clarity and maintainability of our project?

Hi both, Yes you are right about dead code. To unblock your development, I checked this internally and we can do an exception for you. We will be able to trigger the deletion of entities and the data associated with them if you raise a ticket here providing the relevant information like appId, app link (if in marketplace), entities you want to delete. We should be able to do that by the end of next week.

Thanks!

3 Likes