CNF Upgrade and CNF Instantiation failed with error “E_TCA_CP_NOT_REACHABLE”
search cancel

CNF Upgrade and CNF Instantiation failed with error “E_TCA_CP_NOT_REACHABLE”

book

Article ID: 377204

calendar_today

Updated On:

Products

VMware Telco Cloud Automation

Issue/Introduction

From the app logs, errors related to postgresSQL can be seen

App.log

024-09-10 11:19:49.858 UTC [NfvAlarmService_SvcThread-95, Ent: HybridityAdmin, Usr: HybridityAdmin, , TxId: #####-####-####-####-############] ERROR c.v.h.nfvm.alarm.AlarmSyncJob- Unable to run data sync job

com.vmware.hybridity.adapters.objectstore.ObjectStoreException: Cannot create object under key /common/attachments/NfvAlarmService/#####-####-####-####-############/#####-####-####-####-############-11.txt

2024-09-10 11:19:49.858 UTC [NfvAlarmService_SvcThread-95, Ent: HybridityAdmin, Usr: HybridityAdmin, , TxId: #####-####-####-####-############] ERROR c.v.v.h.a.p.PostgresQLAdapter- Error storing file in PostgreSQL: ERROR: nextval: reached maximum value of sequence "objectstore.files_id_seq" (##########)

Environment

2.3.x

Cause

This is due to the Large number of files are present. These files could be as part of catalogs, or CNF LCM, or CaaS LCM (as part of DIP), etc.

The objectstore.files id field changed to a large number which is completely normal - and expected in environments which are dealing with a lot of files.

 

Resolution

To Resolve this issue , we need to update the id to a lower number to just clear up and order the records correctly and reset the sequence counter to a smaller number . This is needed only if the ids in the "objectstore.files" table are not sorted / ordered.

Pre-requisite:

  • Take a snapshot and backup of TCA-CP before proceeding with the below steps.

Proceed with the below steps :

  • SSH to TCA-CP via admin and connect to postgres
    SSH admin@<tca-cp>
    connect-to-postgres
  • Run the following queries
    select count ( * ) from "objectstore.files";
    select id, enterprise, organization, filename, "uploadDate" from "objectstore.files" order by id;
  • Taker note/copy  the last id
  • Update the id of the last record to a lower count
    update "objectstore.files" set id = 14 where id = <id_of_last_record>;
  • Update the file sequence
    alter sequence "objectstore.files_id_seq" AS integer;
  • Confirm the id was updated
    select count ( * ) from "objectstore.files"; select id, enterprise, organization, filename, "uploadDate" from "objectstore.files" order by id;
  • Confirm the file sequence Type is set to integer
    alter sequence "objectstore.files_id_seq" AS integer;
  • Update the sequence to restart numbering from one number more than the last id
    alter sequence "objectstore.files_id_seq" RESTART WITH 15;
  • Attempt to instantiate/upgrade the CNF instantiate again.