---
title: Plugins Health Check
slug: user-guide-10x/plugins-health-check
docTags: 
createdAt: 2025-12-09T12:32:15.939Z
---

Below are instructions to run the Plugins health check script.

# Download script

Create the plugins-health-check.js from the bottom.

By default, the script will search for all plugins. To search by 1 or more plugins, modify the script, and enter the plugin name(s). For example:

:::BlockQuote
var plugins = \['sw\_swimlane\_util', 'sw\_swimlane\_email'];
:::

# Swimlane Platform Installer (SPI) & Helm

1. Save the Swimlane namespace an env variable:

   NOTE: For SPI, enter default for \<SWIMLANE\_NAMESPACE>

:::BlockQuote{indent="1"}
export NS=\<SWIMLANE\_NAMESPACE>
:::

2. Save the mongo primary into an env variable:

   1. For Standalone:

   :::BlockQuote
   export MONGO\_PRIMARY=swimlane-sw-mongo-0
   :::

   2. For HA:

      1. Use the command below to lookup the PRIMARY:

      :::BlockQuote
      kubectl -n $NS exec swimlane-sw-mongo-0 -- mongo -u Admin -p  --authenticationDatabase admin --tls --tlsAllowInvalidCertificates admin --eval="rs.isMaster();" | grep primary
      :::

      2. Replace \<MONGO\_PRIMARY\_POD> with name of the pod (ex: swimlane-sw-mongo-#) from the previous step:

      :::BlockQuote
      export MONGO\_PRIMARY=\<MONGO\_PRIMARY\_POD>
      :::
3. Copy the file plugins-health-check.js in the PRIMARY mongo container:

:::BlockQuote{indent="1"}
kubectl -n $NS cp plugins-health-check.js $MONGO\_PRIMARY:/tmp/
:::

4. Run the file plugins-health-check.js inside the mongo PRIMARY container:

:::BlockQuote{indent="1"}
kubectl -n $NS exec $MONGO\_PRIMARY -- mongo --quiet Swimlane -u Admin -p  --authenticationDatabase admin --tls --tlsAllowInvalidCertificates /tmp/plugins-health-check.js | tee plugins-health-check-results.txt
:::

5. The output will be available in plugins-health-check-results.txt

:::Paragraph{indent="1"}
Sample Results:
:::

:::BlockQuote{indent="1"}
\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~
Plugin : sw\_microsoft\_exchange

&#x20; \========================================================================================================================================================
&#x20; PackageDescriptors:
&#x20;   db.PackageDescriptors.find(\{"\_id": \{$regex:'sw\_microsoft\_exchange'}})
&#x20; \========================================================================================================================================================
&#x20; \|-- Version: 5.1.1
&#x20; \|-- PythonVersion: 3.6

&#x20; \========================================================================================================================================================
&#x20; AssetDescriptors:
&#x20;   db.AssetDescriptors.find(\{"PackageDescriptor.Name": \{$regex:'sw\_microsoft\_exchange'}})
&#x20; \========================================================================================================================================================
&#x20; \|-- Version: 5.1.1
&#x20; \|-- PackageDescriptor.
&#x20; \|  |-- Version: 5.1.1
&#x20; \|  |-- PythonVersion: 3.6

&#x20; \========================================================================================================================================================
&#x20; AvailableActionDescriptors:
&#x20;   db.AvailableActionDescriptors.find(\{"PackageDescriptor.Name": \{$regex:'sw\_microsoft\_exchange'}})
&#x20; \========================================================================================================================================================
&#x20; \|-- Name: Delete Emails
&#x20; \|-- \_id: aMebJ1vsrwguvfLGT
&#x20; \|-- Version: 5.1.1
&#x20; \|-- AssetDependencyVersion: 5.1.1
&#x20; \|-- PackageDescriptor.
&#x20; \|  |-- Version: 5.1.1
&#x20; \|  |-- PythonVersion: 3.6

&#x20; \|-- Name: Get Email Metadata
&#x20; \|-- \_id: aPV76XJq7cuRC1xMm
&#x20; \|-- Version: 5.1.1
&#x20; \|-- AssetDependencyVersion: 5.1.1
&#x20; \|-- PackageDescriptor.
&#x20; \|  |-- Version: 5.1.1
&#x20; \|  |-- PythonVersion: 3.6

&#x20; \|-- Name: Move Email to Folder
&#x20; \|-- \_id: aQRy2Mn9DBIxHTS2X
&#x20; \|-- Version: 5.1.1
&#x20; \|-- AssetDependencyVersion: 5.1.1
&#x20; \|-- PackageDescriptor.
&#x20; \|  |-- Version: 5.1.1
&#x20; \|  |-- PythonVersion: 3.6

&#x20; \|-- Name: Reply/Forward Email
&#x20; \|-- \_id: aROnzCFTIkiSMuxjI
&#x20; \|-- Version: 5.1.1
&#x20; \|-- AssetDependencyVersion: 5.1.1
&#x20; \|-- PackageDescriptor.
&#x20; \|  |-- Version: 5.1.1
&#x20; \|  |-- PythonVersion: 3.6

&#x20; \|-- Name: Send An Email
&#x20; \|-- \_id: aSLdv1inOJ6ySLSP3
&#x20; \|-- Version: 5.1.1
&#x20; \|-- AssetDependencyVersion: 5.1.1
&#x20; \|-- PackageDescriptor.
&#x20; \|  |-- Version: 5.1.1
&#x20; \|  |-- PythonVersion: 3.6

&#x20; \|-- Name: Set Email Category
&#x20; \|-- \_id: aTITqsB6TsWTXmy4p
&#x20; \|-- Version: 5.1.1
&#x20; \|-- AssetDependencyVersion: 5.1.1
&#x20; \|-- PackageDescriptor.
&#x20; \|  |-- Version: 5.1.1
&#x20; \|  |-- PythonVersion: 3.6

&#x20; \========================================================================================================================================================
&#x20; Assets:
&#x20;   db.Assets.find(\{"Descriptor.PackageDescriptor.Name": \{$regex:'sw\_microsoft\_exchange'}})
&#x20; \========================================================================================================================================================
&#x20; \|-- \_id: aHTKy7BqMc\_RE8ZEj
&#x20; \|-- Name: Microsoft Exchange
&#x20; \|-- Descriptor.
&#x20; \|  |-- Name: Microsoft Exchange
&#x20; \|  |-- Version: 5.1.1
&#x20; \|  |-- PackageDescriptor.
&#x20; \|  |  -- Name: sw\_microsoft\_exchange
&#x20; \|  |  -- Version: 5.1.1
&#x20; \|  |  -- PythonVersion: 3.6

&#x20; \========================================================================================================================================================
&#x20; fs.files:
&#x20;   db.fs.files.find(\{"filename": \{$regex:'sw\_microsoft\_exchange'}})
&#x20; \========================================================================================================================================================
&#x20; \|-- \_id: a23Ktt58vO6n1\_oHR
&#x20; \|-- filename: sw\_microsoft\_exchange\_5.1.1.swimbundle

&#x20; \========================================================================================================================================================
&#x20; NON Forked Tasks:
&#x20;   db.Tasks.find(\{"Action.\_t": "PackagedAction", "Action.Descriptor.PackageDescriptor.Name": \{$regex:'sw\_microsoft\_exchange'}})
&#x20; \========================================================================================================================================================
&#x20; Task #1: Get Exchange Metadata

&#x20; \|-- \_id: aMRuAuAE0Q9GHNXQc
&#x20; \|-- Action.&#x20;
&#x20; \|  |-- PackageDescriptorId: aJgq9w8wg3l1rxdQ5 (match NOT found)
&#x20; \|  |-- AssetId: aHTKy7BqMc\_RE8ZEj (match found)
&#x20; \|  |  -- Descriptor.&#x20;
&#x20; \|  |  |  -- \_id: aJgq9w8wg3l1rxdQ5
&#x20; \|  |  |  -- Name: Get Email Metadata
&#x20; \|  |  |  -- AssetDependencyVersion: 5.1.1
&#x20; \|  |  |  -- PackageDescriptor.&#x20;
&#x20; \|  |  |  |  -- Version: 5.1.1
&#x20; \|  |  |  |  -- PythonVersion: 3.6

&#x20; Task #2: Move Email

&#x20; \|-- \_id: aJBC40S\_SH\_TSS2Kv
&#x20; \|-- Action.&#x20;
&#x20; \|  |-- PackageDescriptorId: aQRy2Mn9DBIxHTS2X (match found)
&#x20; \|  |-- AssetId: null (match NOT found)
&#x20; \|  |  -- Descriptor.&#x20;
&#x20; \|  |  |  -- \_id: aQRy2Mn9DBIxHTS2X
&#x20; \|  |  |  -- Name: Move Email to Folder
&#x20; \|  |  |  -- AssetDependencyVersion: 5.1.1
&#x20; \|  |  |  -- PackageDescriptor.&#x20;
&#x20; \|  |  |  |  -- Version: 5.1.1
&#x20; \|  |  |  |  -- PythonVersion: 3.6

&#x20; \========================================================================================================================================================
&#x20; Forked Tasks:
&#x20;   db.Tasks.find(\{"Action.ForkedFromPackage": \{$exists: true}, "Action.ForkedFromPackage": \{$regex:'sw\_microsoft\_exchange'}})
&#x20; \========================================================================================================================================================

&#x20; Task #1: Fork Exchange Delete Email

&#x20; \|-- \_id: aNzHNjCvOuXxpx5ht
&#x20; \|-- Action.&#x20;
&#x20; \|  |-- \_t: Python36Action
&#x20; \|  |-- AssetId: aHTKy7BqMc\_RE8ZEj (match found)
&#x20; \|  |-- AssetDependencyVersion: 5.1.1
&#x20; \|  |-- Descriptor.&#x20;
&#x20; \|  |  -- ActionType: python36

&#x20; Task #2: test move folder

&#x20; \|-- \_id: aU\_WP\_4MGiL949Jf3
&#x20; \|-- Action.&#x20;
&#x20; \|  |-- \_t: Python36Action
&#x20; \|  |-- AssetId: aHTKy7BqMc\_RE8ZEj (match found)
&#x20; \|  |-- AssetDependencyVersion: 5.1.1
&#x20; \|  |-- Descriptor.&#x20;
&#x20; \|  |  -- ActionType: python36
:::

Save the code below as `plugin-health-check.js`

:::BlockQuote
db = db.getSiblingDB('Swimlane');

// Default : search all plugins
var plugins = \[];

// To search by 1 or more plugins
// 1. uncomment the next line and enter the plugin name
//var plugins = \['sw\_xxx', 'sw\_xxx'];

var assets = \[]
var availableActionDescriptors = \[]

var indent =  "\t|-- ";
var indent2 = "\t|\t|-- ";
var indent3 = "\t|\t|\t-- ";
var indent4 = "\t|\t|\t|\t-- ";
var indent5 = "\t|\t|\t|\t|\t-- ";
var header = "\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~"
var divider = "\t========================================================================================================================================================"

if (plugins.length === 0) \{

&#x20;   db.getCollection('PackageDescriptors').find(\{}, \{"Name":1}
&#x20;       ).forEach( function(myDoc) \{
&#x20;               plugins.push(myDoc.Name);
&#x20;          &#x20;
&#x20;           }
&#x20;   );
}

plugins.forEach(function (pluginName) \{

&#x20;   print(header)
&#x20;   print("Plugin : " + pluginName);

&#x20;   // PackageDescriptors
&#x20;   print("\r");
&#x20;   print(divider);
&#x20;   print("\tPackageDescriptors:")
&#x20;   print(\`\t\tdb.PackageDescriptors.find(\{"\_id": \{$regex:'$&#x7B;pluginName}'}})\`);
&#x20;   print(divider);

&#x20;   db.getCollection('PackageDescriptors').find(
&#x20;           \{"\_id": \{$regex\:pluginName}},&#x20;
&#x20;           \{
&#x20;               "Name":1,&#x20;
&#x20;               "Version":1,&#x20;
&#x20;               "PythonVersion":1
&#x20;           }
&#x20;       ).forEach( function(myDoc) \{
&#x20;           print( indent + "Version: " + myDoc.Version );
&#x20;           print( indent + "PythonVersion: " + myDoc.PythonVersion );
&#x20;           print("\r");
&#x20;           }&#x20;
&#x20;   );

&#x20;   // AssetDescriptors
&#x20;   print(divider);
&#x20;   print("\tAssetDescriptors:")
&#x20;   print(\`\t\tdb.AssetDescriptors.find(\{"PackageDescriptor.Name": \{$regex:'$&#x7B;pluginName}'}})\`);
&#x20;   print(divider);
&#x20;          &#x20;
&#x20;   db.getCollection('AssetDescriptors').find(
&#x20;           \{"PackageDescriptor.Name": \{$regex\:pluginName}},&#x20;
&#x20;           \{
&#x20;               "Version":1,
&#x20;               "PackageDescriptor.Version":1,&#x20;
&#x20;               "PackageDescriptor.PythonVersion":1
&#x20;              &#x20;
&#x20;           }
&#x20;       ).forEach( function(myDoc) \{
&#x20;           print( indent + "Version: " + myDoc.Version);
&#x20;           print( indent + "PackageDescriptor.");
&#x20;           print( indent2 + "Version: " + myDoc.PackageDescriptor.Version);
&#x20;           print( indent2 + "PythonVersion: " + myDoc.PackageDescriptor.PythonVersion);
&#x20;           print("\r");                    &#x20;
&#x20;           }&#x20;
&#x20;   );

&#x20;   // AvailableActionDescriptors
&#x20;   print(divider);
&#x20;   print("\tAvailableActionDescriptors:")       &#x20;
&#x20;   print(\`\t\tdb.AvailableActionDescriptors.find(\{"PackageDescriptor.Name": \{$regex:'$&#x7B;pluginName}'}})\`);
&#x20;   print(divider);

&#x20;   db.getCollection('AvailableActionDescriptors').find(
&#x20;           \{"PackageDescriptor.Name": \{$regex\:pluginName}},&#x20;
&#x20;           \{
&#x20;               "Name":1,
&#x20;               "Version":1,
&#x20;               "AssetDependencyVersion":1,
&#x20;               "PackageDescriptor.Version":1,&#x20;
&#x20;               "PackageDescriptor.PythonVersion":1           &#x20;
&#x20;           }
&#x20;       ).forEach( function(myDoc) \{
&#x20;           availableActionDescriptors.push(myDoc.\_id);
&#x20;           print(indent + "Name: " + myDoc.Name);
&#x20;           print(indent + "\_id: " + myDoc.\_id);
&#x20;           print(indent + "Version: " + myDoc.Version);           &#x20;
&#x20;           print(indent + "AssetDependencyVersion: " + myDoc.AssetDependencyVersion);
&#x20;           print(indent + "PackageDescriptor.");
&#x20;           print(indent2 + "Version: " + myDoc.PackageDescriptor.Version );
&#x20;           print(indent2 + "PythonVersion: " + myDoc.PackageDescriptor.PythonVersion );
&#x20;           print("\r");
&#x20;           }   &#x20;
&#x20;   );

&#x20;   // Assets
&#x20;   print(divider);
&#x20;   print("\tAssets:")       &#x20;
&#x20;   print(\`\t\tdb.Assets.find(\{"Descriptor.PackageDescriptor.Name": \{$regex:'$&#x7B;pluginName}'}})\`);
&#x20;   print(divider);

&#x20;   db.getCollection('Assets').find(
&#x20;           \{"Descriptor.PackageDescriptor.Name": \{$regex\:pluginName}},&#x20;
&#x20;           \{
&#x20;               "\_id":1,&#x20;
&#x20;               "Name":1,
&#x20;               "Descriptor.Name":1,
&#x20;               "Descriptor.Version":1,
&#x20;               "Descriptor.PackageDescriptor.Name":1,&#x20;
&#x20;               "Descriptor.PackageDescriptor.Version":1,
&#x20;               "Descriptor.PackageDescriptor.PythonVersion":1      &#x20;
&#x20;              &#x20;
&#x20;           }
&#x20;       ).forEach( function(myDoc) \{
&#x20;           assets.push(myDoc.\_id);
&#x20;           print(indent + "\_id: " + myDoc.\_id);
&#x20;           print(indent + "Name: " + myDoc.Name);
&#x20;           print(indent + "Descriptor.");
&#x20;           print(indent2 + "Name: " + myDoc.Descriptor.Name);           &#x20;
&#x20;           print(indent2 + "Version: " + myDoc.Descriptor.Version );
&#x20;           print(indent2 + "PackageDescriptor.");
&#x20;           print(indent3 + "Name: " + myDoc.Descriptor.PackageDescriptor.Name);           &#x20;
&#x20;           print(indent3 + "Version: " + myDoc.Descriptor.PackageDescriptor.Version);
&#x20;           print(indent3 + "PythonVersion: " + myDoc.Descriptor.PackageDescriptor.PythonVersion);
&#x20;           print("\r");
&#x20;           }   &#x20;
&#x20;   );

&#x20;   // fs.files
&#x20;   print(divider);
&#x20;   print("\tfs.files:")
&#x20;   print(\`\t\tdb.fs.files.find(\{"filename": \{$regex:'$&#x7B;pluginName}'}})\`);
&#x20;   print(divider);

&#x20;   db.getCollection('fs.files').find(
&#x20;       \{"filename": \{$regex\:pluginName} }&#x20;
&#x20;       ).forEach( function(myDoc) \{
&#x20;           print(indent + "\_id: " + myDoc.\_id);
&#x20;           print(indent + "filename: " + myDoc.filename);
&#x20;           }&#x20;
&#x20;   );

&#x20;   // NON Forked Tasks

&#x20;   var taskCount = 1
&#x20;   print("\r");
&#x20;   print(divider);
&#x20;   print("\tNON Forked Tasks:");
&#x20;   print(\`\t\tdb.Tasks.find(\{"Action.\_t": "PackagedAction", "Action.Descriptor.PackageDescriptor.Name": \{$regex:'$&#x7B;pluginName}'}})\`);
&#x20;   print(divider);

&#x20;   var tasks = db.getCollection('Tasks').find(
&#x20;       \{
&#x20;           "Action.\_t": "PackagedAction",&#x20;
&#x20;           "Action.Descriptor.PackageDescriptor.Name": \{$regex\:pluginName}
&#x20;       },
&#x20;       \{ "\_id":1,
&#x20;       "Name":1,
&#x20;       "Action.PackageDescriptorId":1,
&#x20;       "Action.AssetId":1,
&#x20;       "Action.Descriptor.\_id":1,
&#x20;       "Action.Descriptor.Name":1,
&#x20;       "Action.Descriptor.AssetDependencyVersion":1,
&#x20;       "Action.Descriptor.PackageDescriptor.Version":1,
&#x20;       "Action.Descriptor.PackageDescriptor.PythonVersion":1
&#x20;       });
&#x20;      &#x20;
&#x20;   tasks.forEach(function(task) \{
&#x20;       print("\tTask #" + taskCount++ + ": " + task.Name + "\n");
&#x20;       print(indent + "\_id: " + task.\_id);
&#x20;       print(indent + "Action. ");
&#x20;      &#x20;
&#x20;       if (availableActionDescriptors.includes(task.Action.PackageDescriptorId)) \{
&#x20;           print(indent2 + "PackageDescriptorId: " + task.Action.PackageDescriptorId + " (match found)");
&#x20;       } else \{
&#x20;           print(indent2 + "PackageDescriptorId: " + task.Action.PackageDescriptorId + " (match NOT found)");
&#x20;       }


&#x20;       if (assets.includes(task.Action.AssetId)) \{
&#x20;           print(indent2 + "AssetId: " + task.Action.AssetId + " (match found)");
&#x20;       } else \{
&#x20;           print(indent2 + "AssetId: " + task.Action.AssetId + " (match NOT found)");
&#x20;       }
&#x20;       print(indent3 + "Descriptor. ");
&#x20;       print(indent4 + "\_id: " + task.Action.Descriptor.\_id);
&#x20;       print(indent4 + "Name: " + task.Action.Descriptor.Name);
&#x20;       print(indent4 + "AssetDependencyVersion: " + task.Action.Descriptor.AssetDependencyVersion);
&#x20;       print(indent4 + "PackageDescriptor. ");
&#x20;       print(indent5 + "Version: " + task.Action.Descriptor.PackageDescriptor.Version);
&#x20;       print(indent5 + "PythonVersion: " + task.Action.Descriptor.PackageDescriptor.PythonVersion);
&#x20;       print("\r");

&#x20;   });

&#x20;   // Forked Tasks

&#x20;   print(divider);
&#x20;   print("\tForked Tasks:");
&#x20;   print(\`\t\tdb.Tasks.find(\{"Action.ForkedFromPackage": \{$exists: true}, "Action.ForkedFromPackage": \{$regex:'$&#x7B;pluginName}'}})\`);
&#x20;   print(divider);
&#x20;   print("\r");

&#x20;   var taskCount = 1
&#x20;   var Tasks = db.getCollection('Tasks').find(
&#x20;       \{
&#x20;           "Action.ForkedFromPackage": \{$exists: true},&#x20;
&#x20;           "Action.ForkedFromPackage": \{$regex\:pluginName}
&#x20;       },
&#x20;       \{ "\_id":1,
&#x20;       "Name":1,
&#x20;       "Action.\_t":1,
&#x20;       "Action.AssetId":1,
&#x20;       "Action.AssetDependencyVersion":1,
&#x20;       "Action.Descriptor.ActionType":1           &#x20;
&#x20;       });

&#x20;   Tasks.forEach(function(task) \{

&#x20;       print("\tTask #" + taskCount++ + ": " + task.Name + "\n");
&#x20;       print(indent + "\_id: " + task.\_id);
&#x20;       print(indent + "Action. ");
&#x20;       print(indent2 + "\_t: " + task.Action.\_t);       &#x20;
&#x20;       if (assets.includes(task.Action.AssetId)) \{
&#x20;           print(indent2 + "AssetId: " + task.Action.AssetId + " (match found)");
&#x20;       } else \{
&#x20;           print(indent2 + "AssetId: " + task.Action.AssetId + " (match NOT found)");
&#x20;       }
&#x20;       print(indent2 + "AssetDependencyVersion: " + task.Action.AssetDependencyVersion);
&#x20;       print(indent2 + "Descriptor. ");
&#x20;       print(indent3 + "ActionType: " + task.Action.Descriptor.ActionType);       &#x20;
&#x20;       print("\r");               &#x20;
&#x20;   });
});
:::

