DataHub

Edge gateway troubleshooting

Symptom-based fixes for plant-site edge gateways — pairing, NATS, outbox, drift, and capacity.

Use this page when a gateway stays offline, drifts from hub config, or the outbox grows without draining.

install.bat / install.sh closes immediately or fails

SymptomLikely causeFix
Window flashes and closesDocker not runningStart Docker Desktop (Windows) or systemctl start docker (Linux); re-run the installer
SHA256 mismatchCorrupt tarball, or Windows install.bat captured CertUtil's success line instead of the hash (actual: starts with CertUtil:)If actual: is a CertUtil message, the tar is probably fine — see workaround below. Otherwise re-download the zip
docker load failedWrong architecture tarballMatch AMD64 vs ARM64 in console before download
Health never OKHub unreachable or wrong API URLFix HUB_API_URL in .env.edge (must include /api); open outbound HTTPS + NATS from plant

Windows SHA256 false mismatch: in the unzipped folder, with Docker Desktop running:

docker load -i datahub-edge-0.1.1-lan.tar.gz
docker compose -f edge-compose.yml --env-file .env.edge up -d

Adjust the tar name to match the file in the folder. New air-gap zips hash with PowerShell Get-FileHash instead of CertUtil.

Gateway stays OFFLINE after install

SymptomLikely causeFix
Health 503, paired: falseWrong or missing pairing codeConsole → gateway detail → copy pairing code; set PAIRING_CODE in .env.edge or use Deploy to edge before first boot
Health OK but console OFFLINEHub API URL unreachable from plantUse a LAN IP or DNS name the edge box can reach — not localhost or host.docker.internal
NATS never connectsNATS host/port blocked or wrong TLSOpen outbound 4222 (or TLS port); ensure NATS_PUBLIC_URL matches what the edge resolves; mount hub CA at /data/ca.pem when TLS is on
TLS verify failedCertificate SAN mismatchNATS cert must include the hostname/IP the edge uses — same issue when API and NATS hosts differ

Config drift (hub revision ≠ edge revision)

  • Console shows Config drift when configRevision on the hub has not been applied on the edge yet.
  • If drift lasts more than 5 minutes, check edge logs (Gateways → detail → Logs) for manifest apply errors.
  • Rollback: Revisions tab → pick an earlier snapshot → Rollback (writes forward as a new revision).
  • Pause stops collection without revoking the token; Resume when maintenance is done.

Hub restart / workers down

Plant outbox depth and hub consumer lag are different problems.

What is downPlant outboxWhere data waitsWhat to check
NATS or hub API (WAN/firewall)Growsoutbox.sqlite on the edge boxhubReachable / natsConnected on /healthz; outbound 443 + 4222
telemetry-worker or rule-worker only (NATS up)Stays lowHub JetStream streamConsole Operations → Platform — telemetry queue pending; restart workers
Full hub stack restartBrief spike possible, then drainsOutbox + streamNormal after docker compose up; both catch up automatically
Workers stalled for days while ingest continuesStays low until stream drops old messagesJetStream (7d / 4 GiB cap)Fix workers before retention discards oldest events

The edge does not pause NATS drain when Postgres workers are restarting — that is intentional. JetStream is the consumer-side buffer.

Outbox grows / plant box slows down

  • High tag count with ALL publish policy generates maximum WAN load. Prefer ON_CHANGE on devices when values are stable.
  • Console → gateway Overview → adjust Outbox & drain policy (max rows, drain min/max dp/s) — applied via manifest without editing .env on the plant box.
  • Default compose limits edge CPU/RAM (EDGE_CPUS, EDGE_MEM_LIMIT) so a runaway gateway does not take the whole host.
  • See Edge gateway sizing for harness-based guidance (not a throughput SLA).

Replace failed hardware (same gateway record)

  1. Stop the old container (optional: copy /data/outbox.sqlite for gap-free catch-up).
  2. Deploy to edge on the new box — do not create a new gateway row.
  3. Rotate token → set GATEWAY_TOKEN on the new box.
  4. Wait for ONLINE and verify applied revision matches hub.

Ports reference

ServiceDefault host portDirection
Edge health8080Local diagnostics on plant box
MQTT ingress1883Plant LAN → edge (push devices)
Hub API443/3001Outbound HTTPS from edge
NATS4222Outbound from edge