I'll try to explain a certain use-case where we forcefully had to clean up an in-progress task from the database in vRealize Automation 8
The user tried to delete a failed deployment and it was stuck in a weird state " Delete - Initialization" phase
After a bit of research, we found that the information related to the stuck task is present under the dep_event table of catalog-db
Note: Before heading into these steps we do know the deployment id's of the deployments where we need to forcefully clean the events
How did we end up identifying this event information is in CATALOG DB took a lot of research will explain methods followed during this investigation in my next post
Take a snapshot of all vRealize Automation appliances using vRLCM
Take a backup of catalog-db database by following the below command
vracli db dump catalog-db > /tmp/catalog-db.sql
Once taken then connect to the database using the below command
kubectl exec --n prelude -it postgres-0 -- /bin/bash su postgres psql
Now when we type \l we will be able to list all the databases present in vRealize Automation 8.x
Now get connected to catalog-db and list all the tables in it
The first thing I did was to see what are the different status available on this table by command
select distinct status from dep_event
So, as you can see in the above table these are the unique statuses inside the dep_event table.
The deployment event we wanted to cleanup was in the state INITIALIZATION as per the screenshot and the same can be seen in the table as well.
So we now wrote to a query to cross-check all the details with respect to this record
select * from dep_event where deployment_id = <<deploymentid>> and status = 'INITIALIZATION"
Once the details are cross-checked, go ahead and capture the id which would be needed in the second step
The record contents are shown as below. You would need the id and the deployment_id
update dep_event set status = 'FAILED' where id = '<<id>>' and deployment_id = '<<deployment_id>>';
After this, the stuck request should be marked into the FAILED state.