The solution is to delete the bad queries.
1. Get the list of bad queries.
use mdb
select query_uuid,count(*) as cnt from ca_query_def_contents
group by query_uuid
order by cnt desc
2. Get the name of the specific bad query
use mdb
Select * from CA_QUERY_DEF where QUERY_UUID=SPECIFIC-UUID-FROM-ABOVE
3. Remove the bad Queries. There are 2 ways to do this:
A. Thru SQL:
use mdb
Delete from CA_QUERY_DEF_CONTENTS WHERE QUERY_UUID=SPECIFIC-UUID-FROM-ABOVE
B. Thru the GUI
Go to DSM Explorer and delete the Query manually
*** If the Query is used by a Policy or Group, then you will need to delete the Policy or Group first ****