Troubleshooting

flowchart TD
    A[Login or gate failure] --> B{127.0.0.1:51091 health works?}
    B -->|no| C[Container, port, or config failure]
    B -->|yes| D{auth.loca.zone returns HTML?}
    D -->|no| E[Nginx portal proxy or TLS failure]
    D -->|yes| F{Browser loops after login?}
    F -->|yes| G[Cookie scope, forwarded headers, or clock]
    F -->|no| H{Forest assets missing?}
    H -->|yes| I[sub_filter, compression, route, or CSP]
    H -->|no| J[Inspect exact protected location and policy]

Redirect loop

  • symptoms:
    • app redirects to auth.loca.zone
    • successful login returns to the app
    • app immediately redirects to auth.loca.zone again
  • check in order:
    • Authelia health endpoint on 127.0.0.1:51091
    • auth.loca.zone access rule remains bypass
    • protected vhost includes snippets/authelia-location.conf at server scope
    • protected location includes snippets/authelia-authrequest.conf
    • proxy sends the correct Host and X-Forwarded-Proto
    • browser has an authelia_session cookie eligible for the target host
    • host and browser clocks are sane
  • common mistake:
    • assuming the domain rule alone protects a route
    • actual gate is the exact Nginx location that invokes auth_request
  • commands:
  • required live values:
    • cookie domain: loca.zone
    • Authelia URL: https://auth.loca.zone
    • cookie name: authelia_session
  • failure patterns:
    • domain too narrow: protected sibling hosts do not receive the cookie
    • invalid public-suffix or special-use domain: browser refuses the cookie
    • wrong scheme or host in authelia_url: return URL or cookie scope fails validation
    • stale browser cookie after a config change: behavior appears inconsistent
  • repair order:
    • correct and validate server configuration first
    • restart only after approval
    • then remove the stale cookie in browser storage and sign in again
  • reference:

502 Bad Gateway

  • likely boundary:
    • Nginx cannot reach http://127.0.0.1:51091
  • inspect:
    • Compose service state
    • Authelia logs
    • loopback health response
    • configuration validation result
  • do not start with:
    • editing cookie settings
    • deleting state
    • changing the registered port
  • registered topology:
    • host loopback 51091
    • container 9091
    • source: Compose file and /home/loca/AGENTS.md

CSP error or portal asset 404

  • symptoms:
    • browser console reports a refusal mentioning script-src or style-src
    • /portal-forest.css or /portal-remember.js returns 404
    • forest styling is absent or the checkbox does not start checked
  • healthy baseline:
    • /portal-forest.css returns 200 as text/css
    • /portal-remember.js returns 200 as application/javascript
    • /var/www/auth-portal contains only portal-forest.css and portal-remember.js
  • required design:
    • external stylesheet and script
    • same origin: https://auth.loca.zone
    • no inline JavaScript or CSS
  • Nginx checks:
    • exact location = /portal-forest.css
    • exact location = /portal-remember.js
    • both use root /var/www/auth-portal
    • main proxy sends Accept-Encoding ""
    • sub_filter '</title>' inserts the stylesheet link
    • sub_filter '</head>' inserts the script tag
  • why compression matters:
    • sub_filter must see readable upstream HTML
    • a compressed upstream body does not expose the literal source tokens to this setup
  • why same-origin matters:
    • Authelia allows external script and style resources from 'self'
    • an inline script lacks Authelia’s generated nonce
  • rollback:

The remember-me box is not pre-checked

  • first check:
    • remember-me row is visible
    • element exists as input#remember-checkbox[value="rememberMe"]
    • /portal-remember.js returns 200
  • likely causes:
    • /portal-remember.js returned 404
    • CSP blocked /portal-remember.js
    • the checkbox never became enabled within the 10s deadline
    • React did not commit a checked state within the bounded 8 click attempts
    • an Authelia upgrade changed the selector, disabled-state transition, or React event contract
    • the user unticked the box after the first successful check, permanently disarming the script for that page load
  • expected user-untick behavior:
    • the script must not fight the user or re-check the box after disarm
    • reload the portal to test the first-load default again
  • console signal:
    • one portal-remember.js warning appears when the bounded retry gives up
  • do not fix by:
    • hiding the checkbox while claiming it is on
    • setting remember_me: 0; zero restores the default duration and does not default-check the box
    • setting theme: forest; validation rejects it

Clock skew

  • symptoms:
    • fresh session appears expired
    • redirect or OIDC code fails near issuance
    • browser and server disagree about cookie expiry
  • inspect:
    • host UTC time and synchronization state
    • browser device date, time, and timezone
    • timestamps in Authelia logs
  • repair boundary:
    • observing time is read-only
    • changing system time or time-service configuration is a system-service ask-first stop
  • after correction:
    • clear only the affected browser session cookie
    • sign in again

Forest style looks partly wrong

  • likely cause:
    • upstream Material UI class or DOM change after an Authelia upgrade
  • verify:
    • sign-in heading is visible
    • username, password, visibility control, remember row, reset link, submit label, and footer remain usable
    • keyboard focus is visible
    • mobile viewport does not overflow
  • support reality:
    • forest CSS is an Nginx-injected override, not an upstream Authelia theme
    • re-audit the real portal after every version change