Troubleshooting

What the usual errors mean and how to fix them: the server and its console, the apps, Flaq Connect, the relay and certificates.

5 min read

Each entry below starts with what you see. Most problems show up in the server's own log first:

docker compose ps                         # flaq healthy, flaq-db healthy
docker compose logs -f flaq               # what it is doing

The server#

The container stays unhealthy. docker compose logs flaq shows why. The usual causes are a volume the container user (uid 1000) can't write to, or a POSTGRES_PASSWORD changed after the database was created.

"Flaq can only encrypt on a page opened over HTTPS." Setup or the admin console was opened at an http:// address other than localhost, where browsers turn encryption off. Serve it over HTTPS (With your own domain) and open that address; with PUBLIC_URL set, plain-HTTP visits go there by themselves. A server at home is opened as localhost, through an SSH tunnel if need be (At home with Connect).

"Your session expired. Reload the page and try again." In the admin console: the CSRF token no longer matches, usually because the secret key changed (a new SECRET_KEY, or a lost volume) or the session cookie was cleared. Reload.

Signed out on every restart. SECRET_KEY is unset and the volume is not persistent, so a new key is generated each time. Keep the volume, or set SECRET_KEY.

The challenge on the console's sign-in page fails for everyone. The Turnstile widget no longer lists the hostname the server is reached on. Turn Turnstile off from the server, fix the hostname list in the Cloudflare dashboard, then turn it back on in the admin console, under Security:

docker exec flaq flask turnstile off

An admin is locked out. Set a new password from inside the container:

docker exec -it flaq flask reset-password you@example.com

The apps#

The app keeps saying it's reconnecting. The reverse proxy isn't passing WebSockets through, at /api/v1/ws. See With your own domain.

Messages appear for some people only after a reload. Several web workers without Redis: each only hears its own events. Set REDIS_URL, or WEB_WORKERS=1.

"Too many attempts." Eight failed sign-ins for one account from one address lock that pair out for fifteen minutes, per web worker; more than SIGN_UPS_PER_HOUR new accounts from one address wait an hour. Restarting the container clears it. Behind a proxy without TRUST_PROXY, every client shares the proxy's address.

"This message will appear when another member's app is online." The person is new to the conversation, or their password was reset, and no member's app has been open since to share the keys. It opens by itself once one is. If every member of a conversation has lost their keys (all reset), its history can't be recovered: that is what end-to-end encryption means.

"That is not a Flaq server or a Flaq Connect address." The address typed in the app answers neither as a Flaq server nor as a Connect. Check the address, or ask for the invite link again.

The app says a server can't be reached through Flaq Connect. Run the app with FLAQ_DEBUG set in its environment, and it says each step of reaching the server on standard error.

Flaq Connect, from a server#

Status on the console's Flaq Connect page stays at Connecting, or shows Failed. The server can't reach the Connect over UDP: an outgoing firewall that allows only TCP, or a mistyped host name under Connects. Failed gives the reason beside the host. "The gate isn't running" instead means the container was started with FLAQ_GATE=0.

Listed, but no way in was checked. UDP 4433 isn't forwarded to the server, or a firewall on the machine drops it. Apps still try to punch through, which fails when both sides are behind strict routers; forward the port or use a relay.

An invite link opens in the browser but the app can't join. The app reached the Connect but not the server: the server is offline (the app says so), or no way in works from where the app is. See the two entries above.

A new computer can't reach a server it joined from my account's list. A server reached only through Flaq Connect needs the invite link once on a computer that hasn't joined it before.

The relay#

"The relay can't be reached". The relay's address or port is wrong, its UDP port is closed in its firewall, or its certificate doesn't match its host name. The reason follows on the same line.

The relay's log says "no port left in the relay's range". RELAY_PUBLIC isn't an address of the machine's own (ip -4 addr), or every port in RELAY_PORTS is taken: widen the range and open it in the firewall.

"That access key isn't one this relay gave out." The key on the console doesn't match one in RELAY_KEYS, or the relay wasn't restarted after it was added.

"This access key has used its traffic for the month." The key's allowance is used up until the first of next month, or until the relay's operator raises it.

Running a Connect#

Connect or the relay stops at start with "reading /certs/…". The certificate files are missing, or uid 1000 can't read them: run the certificate hook again (Certificates), or:

sudo chown 1000 certs/*.pem

A server or an app on the same network as your Connect can't reach it, though everyone outside can. The router doesn't send traffic for its own public address back inside (NAT loopback, or hairpinning). Turn it on in the router, for UDP as well as TCP. On pfSense: System, Advanced, Firewall & NAT, NAT Reflection mode "Pure NAT" (the proxy mode carries TCP only), with "Enable automatic outbound NAT for Reflection" ticked. When Connect's HTTPS and UDP are on one machine, local DNS answering its host name with that machine's LAN address works too; behind a reverse proxy on another machine it can't, since one name would need two addresses.

A server behind the same router as the Connect isn't confirmed. It still looks to the Connect like a private address, so the Connect can't confirm a way in from the internet for it, or help apps punch through to it. Forward the server's UDP 4433 (with reflection), or test with the server and the Connect on different networks.

Forgot the console password. Make a one-time link, make a new admin account with it, and remove the old one in Settings:

docker exec flaq-connect flaq-connect admin link

Still stuck#

Report a bug on GitHub, with what you see and the lines from docker compose logs around it. Report security problems privately instead, through GitHub's private vulnerability reporting or by email to hyprlab@proton.me.