[SalesForce] getting an ‘Entity is Deleted’ error for all apex classes when attempting to deploy to an org with a managed package

When attempting to deploy to an org that has a managed package using the ANT migration tool, I am seeing the following error for all classes in the org:

Error: classes/XxxClass.cls(XxxClass):entity is deleted
Error: classes/YyyClass.cls(YyyClass):entity is deleted
Error: classes/ZzzClass.cls(ZzzClass):entity is deleted

The classes exist both locally in my src folder as well as in the org that I am trying to deploy to. Is this somehow related to namespacing or version of the classes being deployed?

Best Answer

After inspecting the deleted components tab within the managed package, it was discovered that a certain class AaaClass was listed when it should not have. We looked at our src directory and discovered that we were in fact trying to deploy the AaaClass file. Once we 'undeleted' the AaaClass from the deleted components tab in the managed package and attempted to redeploy, the error messages went away.

Unfortunately, this type of vague error was misleading and not at all indicative of what the actual issue was. Only by chance did we notice that there was a file in the deleted components that should not have been there. Hopefully, this helps anyone else who might come across this issue.

Related Topic