TCA API PUT request with null ID creates "Ghost Tags"
search cancel

TCA API PUT request with null ID creates "Ghost Tags"

book

Article ID: 453155

calendar_today

Updated On:

Products

VMware Telco Cloud Automation

Issue/Introduction

  • When performing an API PUT request to update tags in Telco Cloud Automation, sending an empty string (id = "") or a missing id field in the request payload can result in the internal database ID being set to NULL.
  • These "ghost tags" are effectively orphaned in the system and they cannot be modified or deleted via the UI or API.
  • API calls to edit or delete these tags return 405 Method Not Allowed or E_METHOD_NOT_ALLOWED errors.
  • The tag may appear visually in the environment but is inaccessible for standard lifecycle management operations.

Environment

TCA 3.4

Cause

TCA Manager version 3.4 lacks strict schema validation for the id field within PUT request payloads. The API accepts the id: "" input as valid and subsequently overwrites the existing internal database identifier with a NULL value, corrupting the tag's state.

Resolution

The permanent fix will be part of future TCA release.

Workaround:

  • Use PATCH for partial updates: When performing partial updates to tags, use the PATCH method instead of PUT. The PATCH method is designed for partial resource updates and will prevent the overwriting or clearing of fields not present in the payload.
  • Payload Validation: Ensure all PUT payloads include a valid, non-empty id. Do not omit the id field or set it to an empty string.
  • API Documentation: Consult the TCA API Documentation Portal via the TCA Manager UI to verify all mandatory fields before constructing your automation scripts.
  • Recovery (Database Cleanup): If tags have already been corrupted with NULL IDs, they cannot be recovered through standard API calls. Manual intervention is required to identify and remove these entries from the TCA Postgres database:
  1. Take a snapshot of the TCA Appliance VMs.
  2. SSH to TCA Manager VM.
  3. Connect with postgress Pod.
    1. Run command and wait for approx. 15 sec: debug-tca-cluster
    2. Run command: debug-tca
    3. Select option on menu prompt: 'Connect to Postgres'
      Connecting to Postgres pod postgres-0 in namespace tca-mgr
  4. From TCA UI browse to Administration > Tags view and note down the tag names to be deleted.
  5. Run below commands and replace the tag names which need deletion
    select * from "NfvTags" where val->>'key'='replace with tag name to be deleted';
    delete from "NfvTags" where val->>'key'='replace with tag name to be deleted'