Description
When a Newt agent disconnects (site goes offline), the health check status of all targets routed through that site remains "healthy" in the dashboard. Pangolin correctly detects the site as offline, but does not invalidate the cached health check results for targets on that site.
This causes Pangolin to continue routing traffic to targets through a dead tunnel, resulting in timeouts for users.
Steps to Reproduce
- Configure a resource with multiple targets across different sites (e.g., 3 targets via Site A, 1 target via Site B)
- Enable health checks on all targets
- Verify all targets show "healthy"
- Stop the Newt agent on Site A (e.g.,
docker stop pangolin-newt)
- Observe: Site A shows "Offline" in the Sites dashboard
- Observe: All targets via Site A still show "healthy" in the resource configuration
Expected Behavior
When a site goes offline, all targets routed through that site should immediately transition to "unhealthy" or "unknown" status. Pangolin should not route traffic to targets on offline sites.
Actual Behavior
- Site correctly shows "Offline"
- Target health check status retains the last known value ("healthy")
- Pangolin continues to route traffic through the dead tunnel
- Users experience sporadic timeouts (requests randomly hit the dead route)
Root Cause Analysis
Based on log analysis:
- Health checks run through the Newt tunnel (Pangolin → WebSocket → Newt → HTTP → target)
- When Newt disconnects, no new health check results arrive
- The last-known-good status stays in the database and is displayed as current
- Additionally:
newt/disconnecting message type throws an exception instead of triggering state cleanup:
Unsupported message type: newt/disconnecting
- Pangolin continues sending health check requests to the disconnected Newt (phantom checks)
Environment
- Pangolin: Enterprise Edition (PostgreSQL)
- Newt: v1.10.3
- Setup: 4 targets for Proxmox VE (172.16.50.8:8006) across 4 sites, 1 site taken offline
Suggested Fix
When a Newt disconnect is detected:
- Set all target health checks on that site to
"unknown" or "unhealthy"
- Handle the
newt/disconnecting message type (currently throws exception)
- Stop sending health check requests to disconnected sites
- When Newt reconnects, resume health checks and let them naturally transition back to "healthy"
Description
When a Newt agent disconnects (site goes offline), the health check status of all targets routed through that site remains "healthy" in the dashboard. Pangolin correctly detects the site as offline, but does not invalidate the cached health check results for targets on that site.
This causes Pangolin to continue routing traffic to targets through a dead tunnel, resulting in timeouts for users.
Steps to Reproduce
docker stop pangolin-newt)Expected Behavior
When a site goes offline, all targets routed through that site should immediately transition to "unhealthy" or "unknown" status. Pangolin should not route traffic to targets on offline sites.
Actual Behavior
Root Cause Analysis
Based on log analysis:
newt/disconnectingmessage type throws an exception instead of triggering state cleanup:Environment
Suggested Fix
When a Newt disconnect is detected:
"unknown"or"unhealthy"newt/disconnectingmessage type (currently throws exception)