Error in pattern debug

Paul van den Bo
Kilo Explorer

Hi,

In the 2 patterns Network Switch and Network Router, I always receive an error in the shared library "SNMP - Switch - Vlan" in step "Handle FDB for Juniper".

See the error below:

Oct 30, 2019 1:33:56 PM:: Starting step: 'Handle FDB for Juniper'
Oct 30, 2019 1:33:57 PM:: Test failed: Failed to set attribute while testing the step due to the following error: JAVASCRIPT_CODE_FAILURE: Caused by error in Ad hoc script 'EvalClosure-Handle FDB for Juniper' at line 6 3: var joinTables = function(tabletoAddTo, tableToAdd){tabletoAddTo.addAll(tableToAdd);}; 4: var addTableToContext = function(tableToAdd){CTX.setAttribute(forwardingTableName, tableToAdd);}; 5: var createTableFromSnmpQueryWithVlan = function(oidToQuery,vlanId){snmpQueryResult = CTX.getCommandManager().snmpTableQuery(oidToQuery, ["1", "2", "3"], CTX);var debuggerFormattedTable = NetworkDiscoveryUtil.buildTableAttribute(["dot1dTpFdbAddress", "dot1dTpFdbPort", "dot1dTpFdbStatus"], ["1" , "2", "3"], ["dot1dTpFdbAddress"], snmpQueryResult,vlanId);joinTables(finalForwardingTable,debuggerFormattedTable);}; ==> 6: /*Q-BRIDGE-MIB*/for(var i = 0; i < vlanList.size(); i++){createTableFromSnmpQueryWithVlan("1.3.6.1.2.1.17.7.1.2.2.1",vlanList.get(i));} 7: if(finalForwardingTable.size() == 0){/*BRIDGE-MIB*/for(var i = 0; i < vlanList.size(); i++){createTableFromSnmpQueryWithVlan("1.3.6.1.2.1.17.4.3.1",vlanList.get(i));}} 8: addTableToContext(finalForwardingTable);rtrn = '';

So it seems to fail while running the javascript. The strange part is, I don't have any issues when I run a discovery of a device, in the pattern log it says:

Handle FDB for Juniper

2019-10-30 12:06:23: Execution time: 0 ms

So no issues there. But now i cannot debug the patterns in a normal way. Anyone knows what is causing this and how I can fix this so I can run debugs?

 

Regards Paul.

3 REPLIES 3

adilrathore
ServiceNow Employee
ServiceNow Employee

What is the make and model of the Router/Switch. I am saying so cause this step may not be valid in case it is not a Juniper router/switch.

 

This step is checking the forwarding database for Juniper switch and it seems that the script is failing to retrieve the same.

Paul van den Bo
Kilo Explorer

Well, it looks like it stops on any device but a cisco (it checks if the var $isCisco is false).

This is kind of anoying because now I cannot debug anything after this step.

You can always bypass any step by putting a precondition like 1 contains 2 which would evaluate to false and would not run the step.