Symptoms:
could not execute statement; SQL [n/a]; constraint [form_formdefinition_source_id_source_type_type_tenant_key]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement".
VMware vRealize Automation 8.x
This issue is resolved in VMware vRealize Automation 8.11.2.
See the Workaround section below for more information.
Workaround:
vracli dev psql form-db
select * from form_formdefinition fd where exists (select * from form_formdefinition fd2 where fd.source_id = fd2.source_id and fd.id != fd2.id) and source_type='resource.action';
kubectl -n prelude exec -it postgres-0 – chpst -u postgres psql -d form-db -c "update xaas_resource_action set form_definition_id='correct-tenant-definition-id' where form_definition_id='wrong-tenant-definition-id'"
kubectl -n prelude exec -it postgres-0 – chpst -u postgres psql -d form-db -c "delete from form_formdefinition where id='wrong-tenant-definition-id'"