Description

This article explains how to troubleshoot and fix if the search function is working partially. Here, we will explain the search issue of the following modules:

  1. Find usage for addresses under Configure > Shared Objects > Address
  2. Searching rules and addresses inside the policy



Symptoms

To check if the last refresh search index is complete, please run the command below:


[root@space-005056bddb0c admin]# cat /var/log/jboss/servers/server1/server.log | grep -i "full import" | tail -2

2026-02-04 11:38:06,893 WARN [net.juniper.jnap.secmgt.search.ejb.SearchAdminHandler] (Thread-641) Start Full Import

2026-02-04 11:38:50,995 WARN [net.juniper.jnap.secmgt.search.ejb.SearchAdminHandler] (Thread-641) Full Import Done


In this scenario, the search indexing is completed as we see "Full Import Done", However, the search function might fail while collecting the search items from the database.


To Run Refresh SD Search index

  1. Navigate to Network Management Platform > Administration > Applications
  2. (right-click) Security Director
  3. (select) Refresh Search Index. This will delete the existing data and refresh the search index data.


In order to cross-check, please check the SD.log under /var/log/jboss/servers/server1 while doing a refresh search index. You will be getting the following error:


2026-02-04 11:38:49,793 ERROR [net.juniper.space.sd.common.AbstractRuleManagerHandler] (Thread-641) failed to get rules from db: javax.ejb.EJBException: java.lang.IllegalArgumentException: Provided id of the wrong type for class net.juniper.jnap.sm.om.jpa.AddressEntity. Expected: class java.lang.Integer, got class java.lang.String


Elasticsearch is unable to pull some IDs from the database due to a character. Check if there is any character # for the source address and destination address for the Rules using the following commands:


mysql -ujboss -p$(grep mysql.jboss /etc/sysconfig/JunosSpace/pwd | awk -F= '{print $2}') sm_db

select count(*) from RULE_SRCADDRS where srcAddresses like '%#%';

select count(*) from RULE_DSTADDRS where dstAddresses like '%#%';


If it is showing a number apart from zero, that is the cause of the issue.


Please follow the steps below to identify the policy that causes this issue:


mysql> select * from RULE_SRCADDRS where srcAddresses like '%#%' limit 5;

+---------+--------------+

| RULE_id | srcAddresses |

+---------+--------------+

| 1867835 | 11#1     |

| 3080216 | 11#1     |

| 3080256 | 11#1     |

| 5965650 | 11#1     |

| 5965651 | 11#1     |

+---------+--------------+

5 rows in set (0.00 sec)


mysql> select name,groupPolicy_id from DCRuleEntity where id=1867835;

+------------+----------------+

| name    | groupPolicy_id |

+------------+----------------+

| Test123 |    1867825 |

+------------+----------------+

1 row in set (0.00 sec)


mysql> select name from DCPolicyEntity where id=1867825;

+-------------------+

| name       |

+-------------------+

| Test_Policy |

+-------------------+

1 row in set (0.00 sec)








Solution

To fix the issue, please delete the Test_Policy from the SD UI if it is unused. Post that run refresh search index again.


If you are still facing the same issue, please contact JTAC for assistance

Modification History

2026-02-16 : Article Created