Description

This article explains the procedure for resolving device sync failure issues.

Symptoms


When trying to resync the device you will be displayed with below job error 

"Error while reading config from device: <Device-name>
Operational RPC Command Results
Unable to establish connection with the device (Device Id: xx).
Device is down, not reachable, or unable to accept requests."
 

Solution

As a workaround, you can try the following

 

Option 1:
 

Use cleanupDeviceImportTables.sh command from Junos Space CLI
 

  1. Login to Junos Space CLI, JBoss VIP node
     

  2. Use the command:
     

/var/log/space-debug/debug-utilities/deviceImport/cleanupDeviceImportTables.sh  <deviceName>

[root@space-005056a99be5 ~]# /var/log/space-debug/debug-utilities/deviceImport/cleanupDeviceImportTables.sh  VSRX-22.4R2.8
mysql: [Warning] Using a password on the command line interface can be insecure.
Device id from VSRX-22.4R2.8 is ::3
mysql: [Warning] Using a password on the command line interface can be insecure.
Finished cleaning up the import related tables for device VSRX-22.4R2.8
[root@space-005056a99be5 ~]# 
 
  • Replace <deviceName> with the name of the device in Junos Space

 

  • If the device is an SRX cluster. This command MUST be run on both members of the cluster

 

  • If the device is an SRX LSYS. Run this command on the root device only

 

Option 2 :

Use cleanUpDeviceInvStaleEntries.sh  script  in Junos Space CLI
 

By running the device stale entry script, you should be able to clean up device stale entries in the database. If no stale found you will displayed as no stale entries found 


/var/www/cgi-bin/cleanUpDeviceInvStaleEntries.sh
 

[root@space-005056a99be5 cgi-bin]# /var/www/cgi-bin/cleanUpDeviceInvStaleEntries.sh 
=============================================================================
No stale entries found in the Device Inventories. No devices are in Sync Failed state at the moment..
=============================================================================


 

Option 3


To flap a device via Junos Space CLI
 

 

1. Connect to MySQL DB:


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

 

2. Capture the device id using the hostname of the device:

 

mysql> select id from LogicalDevice where name="<hostname of the device>";

 

3. The id from the command above is used as the device_id_id in the next command:
 

mysql> update DeviceConnectionStatus set connStatus=0 where device_id_id=<output of previous command>;
 

[root@space-005056a99be5 cgi-bin]# mysql -ujboss -p$(grep mysql.jboss /etc/sysconfig/JunosSpace/pwd | awk -F= '{print $2}') build_db -A
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1584255
Server version: 5.7.37-enterprise-commercial-advanced-log MySQL Enterprise Server - Advanced Edition (Commercial)

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

You are enforcing ssl conection via unix socket. Please consider
switching ssl off as it does not make connection via unix socket
any more secure.
mysql>  select id from LogicalDevice where name="VSRX-22.4R2.8";
+----+
| id |
+----+
|  3 |
+----+
1 row in set (0.00 sec)

mysql> update DeviceConnectionStatus set connStatus=0 where device_id_id=3;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0


4. Perform Resynchronize with Network on the affected device 

 

Modification History

2024-09-05 : Article Created