Docs/Error States

Error States Reference

How Hygate handles error conditions across modules.


Guest-Facing Error States

Payment Page Errors

ErrorConditionWhat Guest SeesResolution
Door in MaintenanceDoor status = MAINTENANCE"Currently Closed for Maintenance" messageAdmin changes door status to Active
Door in Passage ModeDoor status = PASSAGE"Free Access" — no payment requiredNo action needed; guest enters freely
Device in MaintenanceDevice status = MAINTENANCE"Device Currently Unavailable"Admin changes device status to Active
Device in UseAnother session is ACTIVE on the same device"Device is currently in use. Please try again later."Wait for existing session to end
Payment FailedCard declined or Stripe error"Your payment could not be processed."Guest tries a different card
3D Secure FailedGuest failed bank verificationRedirected back to payment pageGuest retries or uses different card
Invalid Door/DeviceDoor/device uid not found"Access point not found"Check door/device UID configuration
Webhook TimeoutStripe webhook not receivedPayment may show PENDINGStripe retries webhook delivery

Session Page Errors

StateConditionDisplayGuest Action
LoadingInitial page loadSkeleton/loading animationWait
RunningSession is active with time remainingCountdown circle in primary colorUse the device
FinishingTime remaining = 0, waiting for relay OFFCountdown circle, timer at 0:00Wait for relay OFF confirmation
CompleteTimer finished, relay OFFGreen checkmark, "Session Complete"Done
InterruptedSession cancelled after startingAmber indicator, "Session Ended"Contact support
Failed to StartSession cancelled before relay turned onRed indicator, "Session Could Not Start"Contact support
UnavailableDevice went offline during sessionRed indicator, "Device Unavailable"Contact support

Admin-Facing Error States

Dashboard Errors

IndicatorCauseCheck
TTLock redConnection failed, invalid credentialsSettings → TTLock → Test Connection
Shelly redAuth key invalid, service downSettings → Shelly → Test Connection
Stripe redAPI keys invalid, webhook misconfiguredSettings → Stripe → Test Connection
No active sessionsNormal if no device sessions activeDoors still work normally
Zero revenueNo payments yet, or test mode activeNormal for new installations

Door Operation Errors

ErrorCauseFix
Sync returns no locksTTLock credentials wrong, account has no locksVerify TTLock credentials and lock ownership
QR code generation failsTTLock API unavailableRetry; check TTLock API status
Status won't changePermission issueOperators may be restricted; check role
Delete failsForeign key constraintRemove associated data first

Device Operation Errors

ErrorCauseFix
Power ON failsShelly device offline, network issueCheck device connectivity in Shelly app
Power ON fails after 3 retriesDevice unreachableMark session as CANCELLED; check device
Power OFF failsShelly API issueRetry; cron job will attempt again in 2 minutes
Sync returns no devicesShelly Auth Key wrongRe-enter Auth Key in Settings → Shelly
Session stuck on "Finishing"Relay OFF command pendingWait 5 minutes (cleanup cron) or click Force End

Payment Errors

ErrorWhat HappensFix
Duplicate webhookHygate detects existing payment, ignores webhookNormal — idempotency working
Payment succeeded but no sessionWebhook received but session creation failedCheck audit logs; manually create session
Wrong price chargedPrice locked at payment initiationRefund via Stripe; re-purchase at correct price
Webhook not receivedStripe can't reach Hygate endpointCheck HTTPS, webhook URL, firewall

System-Level Errors

Startup Recovery

When Hygate restarts, it performs recovery on all active sessions:

ScenarioRecovery Action
Session expired during downtimeRelay OFF → COMPLETED
Session valid, relay ONConfirm → no change
Session valid, relay OFF (interrupted)Mark CANCELLED with reason

All recovery actions are logged with the startup_recovery event.

Reconciliation Errors

The 2-minute reconciliation process detects state mismatches:

MismatchAction
Session ACTIVE, relay OFFMark CANCELLED
Session expired, still ACTIVEForce complete
Session not found, relay ONLog warning (orphan relay state)

Reconciliation logs contain the reconciliation event with before/after state.

Relay Command Failures

ScenarioHygate Behavior
ON command fails3 retries (5s each) → mark session CANCELLED → log shelly_on_failed
OFF command fails3 retries → log error → retry on next cron cycle
4xx response on OFFTreat as non-fatal (already off)

HTTP Error Codes

CodeMeaningCommon Cause
400Bad RequestInvalid request data, validation failure
401UnauthorizedMissing or expired JWT
403ForbiddenInsufficient role permissions
404Not FoundResource doesn't exist
409ConflictDuplicate resource, state conflict
500Internal ErrorUnexpected server error
502Bad GatewayUpstream service (Stripe, TTLock, Shelly) unavailable
503Service UnavailableHygate server overloaded or maintenance

Recovery Procedures

Payment Made But No Access Granted

  1. Check Payments module — is the payment SUCCEEDED?
  2. Check Audit Logs for payment_confirmed event
  3. If payment exists but no access → regenerate access code
  4. If no payment record → Stripe webhook issue → check Stripe webhook logs

Device Session Not Activating

  1. Check Sessions — was a session created?
  2. Check Audit Logs for shelly_on_requestedshelly_on_success or shelly_on_failed
  3. If relay ON failed → check Shelly device connectivity
  4. Navigate to session → try manual retry activation
  5. If all else fails → click Force End and investigate root cause

Session Won't End

  1. Wait up to 5 minutes — the cleanup cron runs every 5 minutes
  2. If still stuck → go to Sessions → click Force End
  3. Verify relay is OFF in Shelly app
  4. Check audit logs for the force-end action

Integration Connection Fails

  1. Verify credentials are correct (no extra spaces, correct format)
  2. Test connection from the Settings page
  3. Check the external service's status page
  4. Rotate credentials if they may have been compromised
  5. Contact the external service's support if the issue persists