DocsRelay SetupRelay Troubleshooting

Relay Troubleshooting

Diagnose and resolve common issues with the AsPeekIt Discovery Relay, including connection problems, authentication errors, and discovery failures.


Relay Shows as Offline

The relay card on the Relays page shows "stale" (no contact for RELAY_STALE_AFTER_MINUTES, default 15) or "offline" (RELAY_OFFLINE_AFTER_MINUTES, default 60) even though the process is running.

  • Check that the relay process is actually running: systemctl status idp-relay (systemd), docker ps (Docker), or kubectl get pods -n idp-system (Kubernetes)
  • Verify backend_url is correct and reachable from the relay host: curl -sI https://your-idp-instance.example.com/api/v1/relay/heartbeat/
  • Check that relay_id matches the Relay ID on the Relays page: with a bound key a different relay_id is refused with 401 "API key does not match relay"
  • Look for "[main] Heartbeat failed" or "[main] Config poll failed" in the relay logs: journalctl -u idp-relay -f or docker logs idp-relay
  • If behind a proxy or firewall, ensure outbound HTTPS (port 443) is allowed to the backend URL

Authentication Errors (401 / 403)

The relay logs show HTTP 401 (Unauthorized) or 403 (Forbidden) errors when polling for configuration or submitting results.

  • "Invalid API key": the key does not exist. Keys start with idpr_ — check for whitespace or truncation
  • "API key expired or inactive": the key was revoked (API Keys in the relay card menu) or has expired
  • "Relay already registered; use its relay-specific API key": an unbound bootstrap key was used for a relay_id that already exists; use a key bound to the relay
  • "API key does not match relay": a bound key used with another relay_id
  • "Relay is disabled": enable it from the relay card menu
# Test the API key manually
curl -v -H "X-Relay-ID: relay-datacenter-01" \
  -H "X-API-Key: idpr_YOUR_KEY" \
  https://your-idp-instance.example.com/api/v1/relay/config/

No Zones Returned

The relay connects but runs no discovery because its configuration contains no zones.

  • The config poll returns only active discovery zones with an active assignment to this relay: check the relay card (number of zones) and have an admin use "Assign discovery zones" in its menu
  • Check that the zones are active on the Zones page (Discovery section)
  • Azure, GCP and agent zones cannot be run by a relay

Discovery Not Running

Zones are assigned but no discovery runs.

  • Pending jobs are handed out only for zones with discovery enabled
  • Look for "[scheduler] Added environment ..." (the zone was scheduled, with its next run) and "[scheduler] Concurrency limit reached" (max_concurrent_jobs reached, the run is deferred)
  • A discovery started from the UI is picked up within job_poll_interval_seconds (default 30): look for "[main] Pending job ... scheduling immediate run"
  • Pending relay jobs that no relay claims are failed after RELAY_PENDING_JOB_MAX_AGE_MINUTES (default 360); claimed jobs not completed within RELAY_JOB_CLAIM_TIMEOUT_MINUTES (default 50) are released

Note: The relay polls its configuration at start and then every config_poll_interval_minutes: restart it to pick up newly assigned zones at once.

Kubernetes Discovery Failures

The relay fails to discover Kubernetes resources, reporting connection errors or permission denials.

  • In-cluster: Ensure the relay Pod has a ServiceAccount with a ClusterRole that grants read access to the required resources. The Helm chart creates these automatically
  • Out-of-cluster: Verify the kubeconfig in the environment connection_config is valid and the relay host can reach the Kubernetes API server
  • Check for certificate issues: if the K8s API uses a private CA, ensure the CA certificate is trusted on the relay host or included in the kubeconfig
  • Permission errors (403): the kubeconfig user or ServiceAccount lacks the required ClusterRole/Role bindings
  • Kubeconfigs that use exec or auth-provider plugins or local file paths are refused unless kubernetes_allow_external_auth is true in the relay configuration
# Test Kubernetes connectivity from the relay host
kubectl --kubeconfig /path/to/kubeconfig get namespaces

# For in-cluster relays, check the ServiceAccount
kubectl auth can-i list pods --as=system:serviceaccount:idp-system:idp-relay

Network / SNMP Discovery Failures

Network scanning or SNMP discovery fails or returns no results.

  • Network scan: Ensure the relay host has network connectivity to the target CIDR ranges. Firewalls may block outbound TCP connections or ICMP
  • SNMP: Verify the community string (v2c) or credentials (v3) are correct in the environment connection_config
  • SNMP: Check that SNMP is enabled on the target devices and that the relay host IP is in the allowed SNMP client list
  • SNMP v3: Ensure the authentication and privacy protocols match the device configuration (e.g., SHA vs MD5, AES vs DES)
  • Increase connect_timeout_seconds if targets are on a slow or high-latency network

vSphere Discovery Failures

The relay cannot connect to vCenter or ESXi hosts.

  • Verify the vSphere URL, username, and password in the environment connection_config
  • Ensure the relay host can reach the vSphere API endpoint (default: port 443)
  • If using a self-signed vSphere certificate, set tls_skip_verify to true in the zone connection_config (or add the CA certificate to the relay host trust store)
  • Check that the vSphere user has at least read-only privileges on the target data centre/clusters
# Test vSphere connectivity
curl -sk https://vcenter.example.com/sdk/vimServiceVersions.xml | head -20

Result Submission Failures

The relay runs discovery successfully but fails to submit results to the backend.

  • Check for HTTP timeout errors — increase send_timeout_seconds if the payload is large (thousands of assets)
  • Look for 413 (Payload Too Large) errors — the backend may have a request size limit set by a reverse proxy (e.g., Nginx client_max_body_size)
  • 403 "DiscoveryZone not assigned to this relay" or "DiscoveryZone is inactive": the zone was unassigned or deactivated while the job ran
  • Check retry logs: the relay retries failed submissions with exponential backoff (configurable via retry_count and retry_delay_seconds)

Enabling Debug Logging

Set log_level to debug for more detailed output.

Warning: Debug logging may include sensitive information such as API endpoints and request headers. Do not leave debug logging enabled in production.

# Via config file
log_level: "debug"

# Via environment variable
export IDP_LOG_LEVEL=debug

# Restart the relay to apply
sudo systemctl restart idp-relay

Common Log Messages

Log lines carry a prefix such as [main], [scheduler], [client] or the collector name:

  • "[main] AsPeekIt Relay <version> started" and "[main] Supported collectors: [...]": the relay started
  • "[main] Heartbeat sent": normal; "[main] Heartbeat failed: ..." points to connectivity or authentication
  • "[main] Results submitted for "<zone>" (success=true): created=N updated=N removed=N deps=N": a discovery finished and was accepted
  • "[main] Failed to submit results for "<zone>" (job_id=...): ...": the submission failed after the retries ("[client] Retry n/N ...")
  • "[kubernetes] Discovered N assets, M dependencies in ..." (and the same for the other collectors): collector summary
  • "context deadline exceeded": a timeout was reached; raise connect_timeout_seconds, send_timeout_seconds or job_timeout_minutes