Article - CS232209

Entities were not removed upon deletion of extension in ThingWorx Platform

Modified: 05-Aug-2024   


Applies To

  • ThingWorx Platform 5.4 to 9.3

Description

  • After removing a custom extension from ThingWorx, the entities in the extension are still in Composer
  • Restarting the server did not remove the entities from the extension from ThingWorx
  • Unable to delete extension entities in ThingWorx 
  • Remove all entities using the extension prior to deleting the extension
    • If the entities are part of the extensions, follow best practices to make them non-editable
  • Getting an error when trying to delete an extension from ThingWorx composer
Extension Package deletion failed: Unable to Invoke Service DeleteExtensionPackage on PlatformSubsystem : Cannot delete ExtensionPackage [Extension_Name] because the following Extension Entities are still in use: [entity: Entity_Name, used-by: Entity_Name ]
  • Deleting the extension references both from tomcat directory (/webapps/Thingworx/WEB-INF/extensions) & /ThingworxStorage/extensions folder followed by server restart is also not removing extension entities from Composer
  • Removing the extension entries from both of PostgreSQL database Extensions tables (Extensions & Extension_Package) is also not removing extension entities from Composer
  • Re-import of same extension is giving error:
Import Failed: Unable to import extension: [1,018] Data store unknown error: [Error occurred while accessing the model provider]
ExtensionPackage [name_of_extension] is trying to override existing entities
  • Re-importing of same extension fails with error saying "Extension cannot be imported. It is already installed"
  • PostgresDB logs during same time of import shows error:
ERROR:  duplicate key value violates unique constraint "model_index_pkey"2019-01-08 11:43:04 IST DETAIL:  Key (entity_name, entity_type)=(Extension, XXXX) already exists.
2019-01-08 11:43:04 IST STATEMENT:  INSERT into model_index(entity_name,entity_type,last_modified_time,description,identifier,entity_id, tags, project_name) VALUES($1,$2,$3,$4,$5,$6,$7,$8)
This is a printer-friendly version of Article 232209 and may be out of date. For the latest version click CS232209