Remote tasks no longer appear on TCA Manager (TCA-M) after upgrade to TCA 2.3.0
search cancel

Remote tasks no longer appear on TCA Manager (TCA-M) after upgrade to TCA 2.3.0

book

Article ID: 345717

calendar_today

Updated On:

Products

VMware VMware Telco Cloud Automation

Issue/Introduction

This fix will help users restore the remote tasks functionality and prevent the flooding of TCA-CP app logs.

Symptoms:
  1. Lower level task updates will no longer show up on TCA-M UI. Eg: During VNF instantiation, as part of the create servers step, we will no longer see an intermediate message like "cloning server <vdu-name>"
  2. TCA Control Plane (TCA-CP) app logs will be flooded with error messages similar to the following:
TCA-CP app log error Snippet:
 
ERROR c.v.h.s.remote.task.RemoteTaskSync- Unable to send remote tasks for location 20200304090132532-7c4fe304-7790-4f4d-9867-d521fafce26a. Error Error at index 3 in: "643Z"
java.lang.NumberFormatException: Error at index 3 in: "643Z"
 at java.base/java.lang.NumberFormatException.forCharSequence(Unknown Source)
 at java.base/java.lang.Integer.parseInt(Unknown Source)
 at java.sql/java.sql.Timestamp.valueOf(Unknown Source)
 at com.vmware.hybridity.service.remote.task.RemoteTaskSync.getInstantFromString(RemoteTaskSync.java:198)
 at com.vmware.hybridity.service.remote.task.RemoteTaskSync.getLastSyncTime(RemoteTaskSync.java:190)
 at com.vmware.hybridity.service.remote.task.RemoteTaskSync.getDataToSend(RemoteTaskSync.java:108)
 at com.vmware.hybridity.service.remote.task.RemoteTaskSync.sendData(RemoteTaskSync.java:90)
 at com.vmware.hybridity.service.remote.task.RemoteTaskSync.run(RemoteTaskSync.java:62)
 at com.vmware.vchs.hybridity.messaging.LoggingJobWrapper.run(LoggingJobWrapper.java:41)
 at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
 at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
 at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
 at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
 at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
 at java.base/java.lang.Thread.run(Unknown Source)


Environment

VMware Telco Cloud Automation 2.2

Cause

This is due to a change in the expected format of the lastSyncTime field in the RemoteTaskStatus table. The RemoteTaskSync job does not expect the format as it was in TCA 2.2.0.

Resolution

- This issue will be fixed in TCA 3.0.0

- For the existing TCA 2.3.0 environment kindly patch the system using the steps as mentioned in workaround section.

Workaround:

This issue can be resolved by following the steps listed below:

1. Login to TCA-CP shell 

2. Open the PostgreSQL console using the following command:

 

PGPASSWORD=$(cat /common/pgsql/passwords/tca_admin) psql -U tca_admin -d tca


3. Execute the following command on the PostgreSQL console:
 

DROP FUNCTION IF EXISTS "remoteTask_getSyncStatus";
CREATE FUNCTION "remoteTask_getSyncStatus"(given jsonb) RETURNS json AS $$
DECLARE
    res json;
 BEGIN
    SELECT COALESCE(json_agg(json_strip_nulls(to_json(t)->'val')) FILTER (WHERE is_json_object_not_empty(to_json(t)->'val')), '[]'::json) INTO res
    FROM(
        SELECT
            CASE
                WHEN (to_jsonb(level1)->'val' 'lastSyncTime')
                THEN jsonb_set(to_jsonb(level1), '{val, lastSyncTime}', to_jsonb(RTRIM(to_jsonb(level1)->'val'->>'lastSyncTime''Z')))->'val'
                ELSE to_jsonb(level1)->'val'
        END as val
        FROM (
            SELECT val
            FROM "RemoteTaskStatus"
            WHERE ( ( NOT( given ? 'location')  or  val->>'location' = given->>'location' )  and  ( NOT( given ? 'status')  or  val->>'status' = given->>'status' ) )
        ) as level1
    ) AS t;
    RETURN res;
END;
$$
LANGUAGE plpgsql;