Description

This article provides the steps to perform when the error message "Routing Instance xyz-vr, does not exist in device" is seen when trying to publish/View Config for a NAT policy.

Symptoms

Error message seen when trying to publish or View Config for the NAT policy is:

Routing Instance xyz-vr, does not exist in device

On checking the device config, you can see that the routing-instance config is present on the device.

In the SD >> Devices >> Right Click on the device >> Device Configuration >> Active Configuration, the Routing-Instance config can be seen on the Junos Space.

Even a resync with the device does not help in resolving the issue.

Error messages seen in the logs:

2025-03-04 06:18:17,691 ERROR [net.juniper.jnap.sm.provisioning.common.ExceptionHandlingUtils] (JobThread11010063) Error encountered while calculating/
updating configuration for device:ABC: net.juniper.jmp.exception.JMPException: Error while converting rule: 1 of Policy: ABC. Err
or message: Routing Instance xyv-vr, does not exist in device
        at net.juniper.jnap.sm.provisioning.policy.deploy.converters.AbstractPolicyCMConverter.convertRule(AbstractPolicyCMConverter.java:345) [provisi
oning.jar:]
        at net.juniper.jnap.sm.provisioning.policy.deploy.converters.AbstractPolicyCMConverter.convertRuleAndOrder(AbstractPolicyCMConverter.java:269) 
[provisioning.jar:]
        at net.juniper.jnap.sm.provisioning.policy.deploy.converters.AbstractPolicyCMConverter.convertGroup(AbstractPolicyCMConverter.java:235) [provis
ioning.jar:]
        at net.juniper.jnap.sm.provisioning.policy.deploy.converters.AbstractPolicyCMConverter.convertGroup(AbstractPolicyCMConverter.java:233) [provis
ioning.jar:]

This issue happens when the Routing Instance config is not getting written properly in the database. Due to this, when compiling the config for a publish/update, the SD is unable to find this routing instance and hence gives the error message.

To check whether the Routing Instance is present in the DB or not, please run the following commands:

  • Login to the Space CLI as admin.
  • Enter the mysql DB mode:  mysql -ujboss build_db -p$(grep mysql.jboss /etc/sysconfig/JunosSpace/pwd | awk -F= '{print $2}')
  • Get the ID for the device:  select id,name from LogicalDevice where name="<Device-Name>";
  • Using the ID from the above command, check if the Routing Instance config is present in the DB:  select * from RoutingInstance where deviceName='<ID from the above>';

Solution

If no output is seen for the Routing Instance, please run the commands mentioned below to resolve the issue.

  • Login as the admin user
  • Navigate to the path: /var/log/space-debug/debug-utilities/deviceImport

cd /var/log/space-debug/debug-utilities/deviceImport

  • vi cleanupDeviceImportTables.sh
  • Look for the line "#"update ManagedElement set loopback_id=NULL where name='$DEVICE_ID';"
  • Uncomment this line by removing the # from the front of the line.
  • Save by clicking on ESC :x
  • Now run the cleanupDeviceImportTables.sh script:
  • sh cleanupDeviceImportTables.sh <Device name>
  • Resync the device from the UI from Device >> Right click on the device >> Device Operations >> Resync with Network.
  • Now the NAT policy Preview Config should work.

 

You can try the following as well if this does not succeed

 

  • Unassign device from policies (NAT, FIREWALL)
  • Rename existing policy (NAT)
  • Delete devices from SD
  • Readd devices
  • Reassign device to existing policy (FIREWALL)
  • Reimport NAT policy
  • Resolve object conflict with, likely, keep existing
  • Test to see if this succeeds now.
  • Delete old policy (NAT) if test succeeds

 

Modification History

2025-03-21 : Article Created