Custom and Self-Hosted Integration Troubleshooting
If you have a custom or self-hosted integration set up but counts are not appearing, are wrong, or have stopped updating, this guide walks through the most common failure modes by symptom.
If you are setting up a self-hosted integration for the first time, start with the Self-Hosted Integration Setup & Troubleshooting Guide — this article is for diagnosing issues with an integration that is already in place.
Self-hosted integrations are PowerShell scripts that run on your infrastructure. They use the Reconcile PowerShell SDK to pull data from a vendor API and push counts into Gradient. Because the script runs on your side, troubleshooting involves a few extra places to look compared to native integrations.
In this article
- Step 1: Pick your symptom
- Section A: Integration stuck on Pending
- Section B: Counts stopped updating
- Section C: Counts are wrong
- Section D: PowerShell execution errors
- Section E: Script runs but no data appears
- Section F: Liongard specifically
- Reminder: scripts available on request
- Still stuck? What to send support
Step 1: Pick your symptom
| Symptom | Most likely cause | Jump to |
|---|---|---|
| Integration shows Pending, never went Active | Initial usage sync has not run yet | Section A |
| Counts populated initially but have stopped updating | Scheduled task or token expired | Section B |
| Counts are appearing but are wrong | Mapping or vendor-side data issue | Section C |
| Script throws PowerShell execution errors | Execution policy or module issue | Section D |
| Script runs without errors but no data appears | API token, endpoint, or filter issue | Section E |
| Liongard integration specifically misbehaving | Liongard metric or sync issue | Section F |
Section A: Integration stuck on Pending
A new custom integration stays in Pending status until a successful usage sync completes. Until that first sync runs, you will see Pending.
- Confirm the script has actually been run at least once after the integration was created in Gradient
- Check the script's output for a successful response from the Gradient API
- Refresh the integration page in Gradient — sometimes status lags
- Re-run the script manually to confirm it completes
- Once the first usage sync succeeds, the integration moves to Active automatically
The script will produce 404 errors for any account or service that does not yet have a mapping. This is expected and is not a failure. The script should still complete and the integration should still go Active.
Section B: Counts stopped updating
This is the most common ongoing issue with self-hosted integrations. The script worked initially, then went silent. There are three likely causes.
1. The scheduled task or cron job stopped running
- On the machine where the script is hosted, open Task Scheduler (Windows) or check cron logs (Linux)
- Confirm the task last ran successfully and is scheduled to run again
- Common reasons it stopped: machine was rebooted, service account password changed, task was disabled, or the user it runs as lost permissions
- If the task is broken, re-create or re-enable it
2. The Gradient API token was revoked
- Log into Gradient and open API Tokens
- Confirm the token used by your script still exists and is active
- If it was rotated or deleted, generate a new one
- Update the script with the new token
- Re-run the script to confirm it works
3. The vendor API credential expired
Different vendors have different credential lifespans. Here are the ones most likely to cause silent failures:
| Vendor | Credential lifespan | Note |
|---|---|---|
| AppRiver | 14 day refresh token | Critical — script must run at least every 13 days or token expires |
| Sophos Central | 12 months default | Renew API credential annually |
| Most OAuth-based APIs | 30 to 90 days | Check vendor documentation |
| Standard API keys | Indefinite, but revocable | Often broken by admin password changes or user deactivation |
AppRiver has the shortest token lifespan of any vendor we work with. If you set up AppRiver and the script runs less than once every 13 days, it will fail and you will need to regenerate the refresh token and update the script. Set the scheduled task to run daily or weekly to avoid this.
Section C: Counts are wrong
If the script is running and counts are appearing but they do not match what you expect, the data is flowing — the issue is either mapping or how the vendor exposes the data.
Check mapping first
- Open a service card in Gradient showing the wrong count
- Click Review to see the Data Source
- Confirm the account is mapped (no mapping = no count, sometimes shown as a dash)
- Confirm the service is mapped to the correct vendor SKU
Then check the vendor side
- Run the script manually and capture its output
- Confirm the counts the script is pulling match what you see in the vendor portal
- If the script's counts match the vendor portal but your Gradient counts are still off, the issue is in the Gradient mapping (above) or in many-to-one mapping aggregation
- If the script's counts do not match the vendor portal, the issue is in the script's filter or query
If you have multiple PSA products all mapped to the same vendor SKU (many-to-one), Gradient correctly aggregates them. But if you also have a CSV import contributing to the same service, you can accidentally double-count. Check the Data Source widget on any suspicious service card to confirm only one source is contributing.
See: Counts and Discrepancy Troubleshooting for deeper diagnostics.
Section D: PowerShell execution errors
If the script throws errors before it can connect to anything, the issue is usually environmental rather than vendor-related.
Execution policy error
Most common error on first run. PowerShell scripts will not execute by default on Windows.
Fix:
- Open PowerShell as Administrator
- Set the execution policy on the script's root folder to Unrestricted
- Re-run the script
PowerShell version too old
The Reconcile SDK requires PowerShell 7.0 or later. If your machine is running Windows PowerShell 5.1 (the default on older Windows installations), the script will fail.
- Run $PSVersionTable in PowerShell to check your version
- If under 7.0, install PowerShell 7 from Microsoft's official site
- Run the script using the new pwsh.exe instead of powershell.exe
Missing module
If the script references modules that are not installed (the SDK module, or a vendor-specific module), it will fail with a “module not found” error.
- Read the error message to identify the missing module
- Install it with Install-Module
- Re-run the script
Section E: Script runs but no data appears
This is the trickiest scenario — no errors, but nothing shows up. Work through these:
- Add Write-Host or Write-Verbose statements to the script to confirm it is actually reaching the vendor API call
- Confirm the vendor API endpoint URL is correct and uses the right region (US, EU, AU, etc.)
- Confirm the script's filter is not excluding everything (date ranges, account IDs, plan tiers)
- Confirm the Gradient API token has permissions for the right account
- Run the script with verbose logging to see the actual HTTP responses
The Reconcile PowerShell SDK includes helper commands to test the integration setup, verify the API connection, and see what is being sent to Gradient. Use these to isolate whether the issue is on the vendor side or the Gradient side.
Section F: Liongard specifically
Liongard is a special case because it sits between vendors and Gradient. When something is off, the issue can be in Liongard's metric or in the Gradient mapping.
| Symptom | Check first |
|---|---|
| Metric value in Gradient does not match expectation | Open the metric in Liongard and check the current value there. Gradient pulls whatever Liongard reports. |
| Multiple false-positive New Found Revenue cards | You probably have multiple like services mapped to a single metric. See Best Practices for Using Liongard Integration. |
| Metric value in Liongard looks wrong | JMESPath query may be off, or an active sync is in progress in Liongard for that environment and inspector. |
| Sync from Liongard fails | Check Liongard service user is still active and has access to all the environments you expect to pull from. |
Full reference: Liongard Troubleshooting.
Reminder: scripts available on request
Gradient maintains a library of self-hosted scripts you can request from support@meetgradient.com. These are kept up to date and tested. If you have built a custom script and a vendor on this list now has an official version, switching saves you the maintenance burden.
For the full list, see: Available self-hosted Integration scripts.
Vendors with available scripts include: AppRiver, Autotask PSA Locations, Auvik Average Billable Devices, Axcient (x360 Cloud, Recover, Sync), Barracuda (Essentials, Intronis), Bitdefender, CheckPoint, ConnectWise PSA Contacts, ConnectWise Asio, ConnectWise Automate, Curricula, Cyberaware, D&H Cloud Marketplace, Datto SaaS Protection, Datto RMM, Domotz, Dropsuite, Heimdal Security, Hexnode, Ingram Micro, Intermedia, Kaseya VSA 10, KnowBe4, LeaderCloud, Malwarebytes, Mimecast, N-able N-Central, N-able N-sight RMM, NinjaOne, Pax8, Phin Security, Printix, Rhipe for M365, SaaS Alerts, SonicWall, TD Synnex StreamOne Stellr, ThreatLocker v2, Trend Micro, Ubiquiti UniFi, uSecure, Veeam, Wasabi, Wasabi ACM, WP Engine, Zerotier.
Still stuck? What to send support
Email support@meetgradient.com with:
- The exact script name and version, or which vendor's API you are pulling from
- A snippet of the script output (with credentials redacted)
- What the integration status shows in Gradient (Pending, Active, Failed)
- Whether the script ran successfully on the host machine
- When it last worked, if known
Related articles
- Available self-hosted Integration scripts
- Creating Self-Hosted Integrations - Reconcile PowerShell SDK
- Self-Hosted Integration Setup & Troubleshooting Guide
- Creating Custom Integration Scripts with ChatGPT and PowerShell
- Liongard Integration - Getting Started
- Liongard Troubleshooting
- Best Practices for Using Liongard Integration