Service Graph Meraki - Stuck Imports - Temporary Workaround (Non-Official)

JoseTorres
Tera Contributor

Hey Community!

 

I'd like to share an issue we recently encountered with the Service Graph Connector for Meraki (x_caci_sg_meraki) and provide a temporary workaround that helped us restore functionality.

Since this integration is delivered through a third-party plugin, some customers may need a quicker resolution while waiting for an official fix.

 

Important: As mentioned in KB3063951, the plugin has been temporarily removed from the ServiceNow Store while the Cisco team works on a permanent solution.


Issue

The "SG-Meraki Devices" Import Schedule starts a job that executes HTTP requests against the Meraki API.

When triggered, the integration repeatedly sends requests to the same endpoint, entering an infinite loop until the API eventually stops responding (HTTP 503).

This behavior can generate a very large number of requests and may lead to excessive memory consumption on the ServiceNow instance, resulting in instance instability or outages.

JoseTorres_0-1782253716387.png


Root Cause

Cisco recently introduced a change to their API where the response header previously returned as "Link" is now returned as "link" (lowercase).

 

The Data Stream Actions used by the connector rely on this header during pagination processing.


Temporary Workaround

Note: This solution requires customization and is intended only as a temporary fix until Cisco releases an updated version of the plugin. These changes should be reverted once an official fix becomes available.

Also ensure you are making the changes within the correct application scope.


1. Duplicate the Data Stream Actions

There are three Data Stream Actions that need to be adjusted:

  • SGMerakiGetDevices
  • SGMerakiGetDeviceStatuses
  • SGMerakiGetNetworks

JoseTorres_1-1782253945469.png

 

 

Navigate to Workflow Studio and search for Data Stream Actions within the Service Graph Connector for Meraki application.

 

Open each of the Data Stream Actions listed above and select "Copy Action" from the additional options menu.

Provide a name for each copy and click Copy.

 

We will modify these cloned versions while keeping the out-of-box actions unchanged, making future rollback much easier.


2. Fix the Pagination Setup

Open each copied Data Stream Action and navigate to the Pagination Setup Step.

JoseTorres_2-1782254060349.png

 

Inside the Pagination Variables Script, locate all references to .response_headers['Link'] and replace them with .response_headers['link'] using lowercase link.

 

Once completed, save and publish each action.

Repeat this change for all three Data Stream Actions.


3. Override the Default Script Include

The "SG-Meraki Devices" Data Source used by the Import Schedule calls the Script Include SGConnectorMerakiImportUtils, this Script Include extends SGConnectorMerakiImportUtilsBase which contains the core integration logic.

 

We'll use the extending Script Include to override the methods that execute the Data Stream Actions.

 

Script Includes

- SGConnectorMerakiImportUtils

https://<instance-name>.service-now.com/now/nav/ui/classic/params/target/sys_script_include.do?sys_i...

 

- SGConnectorMerakiImportUtilsBase

https://<instance-name>.service-now.com/now/nav/ui/classic/params/target/sys_script_include.do?sys_i...

 

Open both records, and from the Base Script Include, copy the full contents of the following functions:

  • getNetworks
  • getDeviceStatuses
  • getDevices

Paste these functions into the extending Script Include (SGConnectorMerakiImportUtils).

***Do not remove the existing initialize() function.

 

These methods are responsible for executing the Data Stream Actions. You will find lines similar to:

var networkAction = sn_fd.FlowAPI.getRunner().datastream('x_caci_sg_meraki.sgmerakigetnetworks').withInputs(networksStreamInput).run();

JoseTorres_3-1782254195270.png

 

 

Replace the reference inside .datastream(...) so that it points to the copied Data Stream Action you created earlier.

 

To obtain the correct action name:

  1. Open the copied Data Stream Action in Workflow Studio.
  2. Select Create Code Snippet from the additional options menu.
  3. Copy only the value used inside .datastream(...).
  4. Replace the existing reference in the corresponding Script Include method.

JoseTorres_4-1782254257678.png

 

Repeat this process for all three methods and save the record.


Summary of the Changes

The workaround consists of three steps:

  1. Duplicate the Default Data Stream Actions.
  2. Correct the pagination logic.
  3. Override the methods that execute the Data Stream Actions using the extending Script Include (SGConnectorMerakiImportUtils) and redirect them to the customized Data Stream Actions.

Validation

Run the "SG-Meraki Devices" Import Schedule and verify that only the expected API calls are executed.

In our testing, the integration stopped generating the endless request loop, the Transform process started successfully, and device records were updated as expected.

JoseTorres_5-1782254329201.png

 


Rollback

Once Cisco releases an official fix, revert the customization by restoring SGConnectorMerakiImportUtils to the latest Store version through the Versions related list.

After doing so, the integration will return to its default behavior and the custom Data Stream Actions will no longer be used.


Again, this is only a temporary workaround until Cisco delivers a permanent solution.

Hopefully this helps anyone currently facing the same issue and needing a faster path to recovery.

 

Thanks, and I hope this saves you some troubleshooting time!!! 

0 REPLIES 0