Bytekey QR Sync
Provisioning, rollout, health checks, and troubleshooting for Bytekey QR access on Edge devices.
Bytekey QR sync lets a ByteGate Edge appliance validate Bytekey-issued QR credentials locally from a scoped snapshot. It is for customer access at the door, not for Bytekey administration.
Production Contract
- Production sync uses
GET /v1/edge/qr-credentials/snapshoton the Bytekey API. - The edge authenticates with an edge-scoped bearer credential. Use one credential per device or per location, bound server-side to the Bytekey organization/app scope and, where available, the ByteGate tenant/location scope.
- Edge appliances must never store or use Bytekey
INTERNAL_AUTH_TOKEN,INTERNAL_DOCS_TOKEN,BYTEGATE_AUTH_TOKEN, or any broad internal/operator token. - Request headers such as
X-Bytegate-Device-IdandX-Bytegate-Location-Idare consistency checks. They do not widen the credential scope. - Production snapshots include only allocated, unrevoked, unexpired credentials.
- Production snapshots exclude
availableQR pool credentials. - Snapshots are cached locally and replaced atomically so a failed or invalid download does not destroy the last known-good cache.
- When enabled, the Edge QR sync manager refreshes the snapshot at service startup and periodically afterwards.
Enablement Path
Bytekey QR sync is disabled by default. Do not turn it on just because a device has been updated to a release that contains the feature.
Before enabling a device:
- Deploy the Bytekey API version that serves
/v1/edge/qr-credentials/snapshot. - Provision an edge-scoped QR sync credential in Bytekey API configuration or the registration store used for the rollout.
- Install or update ByteGate Edge to a release that contains the disabled
bytekey_qr_syncconfig block. - Set the Bytekey API base URL, token source, device ID, location ID, cache directory, and timeout in the device configuration.
- Restart the edge service and confirm the next heartbeat reports
bytekey_qr_sync_v1and healthybytekey_qr_syncstate.
The edge must validate only allocated and unexpired credentials from a fresh snapshot. Once validUntil has passed, Bytekey QR access fails closed until a fresh valid snapshot is accepted. Existing non-Bytekey access paths keep their own behavior.
Dashboard Checks
Open Locations → device → Maintenance and check the Bytekey QR Sync panel.
The dashboard displays:
- whether the device advertises
bytekey_qr_sync_v1; bytekey_qr_syncstatus from heartbeat;- snapshot ID, snapshot age, and
validUntilwhen available; - readiness and the reason a device is not ready;
- last error text, bounded for operator display.
Generic edge software rollout creation is not blocked by Bytekey QR readiness. This avoids blocking the rollout that introduces bytekey_qr_sync_v1 in the first place. QR-specific enablement should use the readiness helper as the gate.
Rollout Order
Use this order for production:
- Deploy Bytekey API support first.
- Ship ByteGate Edge with
bytekey_qr_syncstill disabled by default. - Enable one internal or staging edge and observe snapshot health.
- Enable one controlled production location.
- Expand by small cohorts after heartbeat health stays fresh and access logs look normal.
Do not enable a cohort if the maintenance panel shows missing capability, disabled, stale, offline, auth failed, scope mismatch, or error state.
Troubleshooting
| Status | What it means | Operator action |
|---|---|---|
disabled | Feature is present but not enabled/configured. | Confirm this is intentional. Configure only after the Bytekey API route and edge credential are ready. |
starting | The edge has not accepted a usable snapshot yet. | Wait for the first sync, then inspect service logs if it does not become healthy. |
healthy | A fresh snapshot is loaded and usable. | No action. Continue observing after rollout. |
stale | The last snapshot is past validUntil. Bytekey QR access fails closed. | Check network, Bytekey API availability, token validity, and device clock sync; restart the service after fixing configuration. |
offline | The device cannot currently refresh from Bytekey API. | Check DNS, outbound HTTPS, proxy/firewall rules, and Bytekey API reachability. |
auth_failed | Bytekey API rejected the edge credential. | Rotate or re-provision the edge-scoped token. Do not substitute INTERNAL_AUTH_TOKEN. |
scope_mismatch | Device/location headers do not match the server-side edge principal scope. | Verify the provisioned device ID, location ID, organization, and app scope. Re-provision if the device moved locations. |
error | The edge rejected the response or hit an unexpected sync error. | Check logs for schema rejection, corrupt cache, disk permission, timeout, or non-200 response details. |
Useful checks on the Pi:
cd ~/bytegate-edge
sudo systemctl status bytegate-edge
sudo journalctl -u bytegate-edge -n 120 --no-pager | grep -iE "bytekey|qr|snapshot|auth|scope|stale|offline|error"
grep -n "bytekey_qr_sync" config_production.yamlDo not paste QR credentials, bearer tokens, or full snapshot files into support tickets. Share status, snapshot age, validUntil, device ID, location ID, and redacted log lines.
Last updated on