UniFi Captive Portal Troubleshooting
Diagnose and resolve UniFi guest captive portal issues including ERR_CONNECTION_REFUSED and portal not loading
SOP-010: UniFi Captive Portal Troubleshooting
Version: 1.1
Created: 2026-02-12
Last Updated: 2026-03-12 (added Issue #6: JVM heap runaway)
Scope
When to Use:
- Customer reports "can't connect to WiFi hotspot"
- Phone shows "Sign in to network" but portal doesn't load
- Browser displays
ERR_CONNECTION_REFUSEDon guest WiFi - Voucher system not showing login page
Not for:
- UISP service suspension (use Payment Reconnection SOP)
- Device offline/unreachable (use device troubleshooting)
- Payment/billing issues
Prerequisites
- UniFi controller access:
https://unifi.karetechsolutions.com - Credentials: Infisical
/credentials/unifi/
Common Issues
Issue 1: allowed_subnet_1 Blocking Portal Access (Most Common)
Symptoms: Phone connects, "Sign in to network" appears, but browser shows ERR_CONNECTION_REFUSED.
Root Cause: Setting allowed_subnet_1 to controller hostname creates a whitelist that can block portal access on certain network configurations.
Diagnosis:
Expected good output: "allowed_subnet_1": null
Solution:
Via Web UI: Settings → Guest Control → Pre-Authorization Access → Remove all entries.
Issue 2: Portal HTTPS Port Not Listening (8843)
Symptoms: HTTP portal works (8880), HTTPS portal doesn't work (8843).
Diagnosis:
Solution:
Issue 3: Access Point Offline
Diagnosis:
State codes: 0 = Offline, 1 = Connected, 5 = Provisioning.
Issue 4: Guest Portal Disabled
Diagnosis:
Expected: portal_enabled: true, auth: "hotspot", voucher_enabled: true.
Issue 5: WLAN Not Configured as Guest
Expected WLAN config: is_guest: true, security: "open", enabled: true.
Via UI: WiFi → Select SSID → Enable "Guest Network" → Set Security to "Open".
Issue 6: UniFi OS Controller Crashes (JVM Heap Runaway)
Symptoms:
- Controller inaccessible at
https://unifi.karetechsolutions.com systemctl status uosserver.serviceshows restart loop- "Container did not start within 60 seconds" in logs
Root Cause (2026-03-12):
Default UniFi OS sets -XX:MaxRAMPercentage=80.0, allowing JVM heap to balloon to 6+ GB on a server with 7.7 GB RAM and 43+ containers, triggering SIGABRT via -XX:+CrashOnOutOfMemoryError.
Permanent Fix:
/var/lib/unifi/env-overrides (persistent volume) hard-caps heap at 1 GB:
Verify:
Important: UniFi OS is a Podman container, NOT Docker. Use systemctl status uosserver.service, not docker ps.
Bulk Site Audit
Check all sites for allowed_subnet_1 issue:
Bulk cleanup of 71 sites was performed on 2026-02-12 in 50 seconds.
Prevention
- Never set
allowed_subnet_1unless absolutely required - Audit sites monthly for this setting
- Test portal after SSL certificate renewals
- Monitor UniFi OS port status (8843, 8880)