This article will explain how to fix if preview job is failing with the error "utm is not available on the device"
We will get the below error from the server.log under /var/log/jboss/servers/server1:
2023-08-18 11:58:49,226 ERROR [org.jboss.as.ejb3.invocation] (default task-3139) WFLYEJB0034: EJB Invocation failed on component jnap.sm.SecurityDeviceManagerEJB for method public abstract net.juniper.jnap.sm.om.SecurityDeviceDO net.juniper.jnap.sm.om.interfaces.SecurityDeviceInterface.getSecurityDeviceByLogicalDeviceId(java.lang.String) throws net.juniper.jnap.sm.common.SMException: javax.ejb.EJBTransactionRolledbackException: HTTP 404 Not Found
Caused by: net.juniper.jnap.sm.common.SMException: Invalid Identifier: 7Some of the devices listed in UrlCategoryDeviceEntity table are not present in LogicalDevice table, because of which we are getting this exception (net.juniper.jnap.sm.common.SMException: Invalid Identifier: 7).To check the stale entry, please run the below command:select deviceId from UrlCategoryDeviceEntity where deviceId NOT in (select deviceId from SecurityDeviceEntity);
The issue is reported in Junos Space version 23.1.
As a workaround, we can clear the stale entry using the following command:
mysql> delete from UrlCategoryDeviceEntity where deviceId NOT in (select deviceId from SecurityDeviceEntity) ;
As a permanent solution, please install either Security Director Hotpatch v3 or the latest Security Director hotpatch of 23.1.