Skip to content
Kaiov0.8.0

Troubleshooting

Permission-denied errors on the socket mean the user running the server is not allowed to read it. Add it to the docker group:

Terminal window
sudo usermod -aG docker $USER
# Log out and log back in for the change to take effect

newgrp docker applies it to the current shell without logging out.

For rootless Podman, the socket belongs to your user already. See Podman.

If the database reports a lock, make sure only one instance of the server is running against it. WAL mode allows concurrent reads and writes, but a single background writer is required.

Terminal window
ps aux | grep kaio-server

A common cause is make dev left running in another terminal while a container instance points at the same data/ directory.

  • Check the socket path: KAIO_DOCKER_HOST unset uses local defaults, which may not match a rootless Podman setup.
  • Check the server logs with RUST_LOG=debug.
  • Confirm the API answers: curl localhost:8080/api/health.

The page says this build carries no web UI

Section titled “The page says this build carries no web UI”

kaio-server compiles the dashboard in, from the bundle Vite writes to frontend/dist. A debug build made before the frontend was ever built serves a placeholder page saying so, and the API under /api works throughout. Build the bundle, then the server:

Terminal window
cd frontend && npm ci && npm run build
cd ../backend && cargo build -p kaio-server

A release build refuses to compile without a bundle, so a binary from make dist, from the image, or from a release tarball cannot show that page.

Remote image update checks need Skopeo. It ships in the production image; on a source build, install it on the host. Without it, stacks simply never show the ★ indicator.

For a local registry over HTTP, detection is heuristic, so check the server logs for the inspection error if a known-updated image stays unflagged.

The first Trivy scan downloads the vulnerability database and runs alone to warm the cache, so it takes noticeably longer than later ones. If scans never complete:

  • the host must be able to pull KAIO_TRIVY_IMAGE;
  • check the Docker volume holding the Trivy cache has space.

unknown means it has not been probed yet, not that it failed. Probes run every KAIO_NODE_HEALTH_INTERVAL_SECONDS (default 60), and 0 disables them entirely, which leaves every row frozen on its last result. Force one:

Terminal window
kaio-cli node check prod-01
kaio-cli node check

Enrolling probes the node immediately, so a status that is already wrong at join time is almost always the advertised address rather than the node itself. The control plane reaches the node at the address the node gave it, which is not necessarily the address you typed to reach the control plane.

Terminal window
kaio-cli node show prod-01 # the URL actually stored
curl http://<that url>/api/health # from the control plane, not from your laptop

Rejoin with an explicit --advertise host:port when the node sits behind a port mapping, a NAT, or a wildcard bind. See Multiple servers.

Refusing to listen on http://0.0.0.0:8080: Kaio authenticates no one, ...

KAIO_ADDR is off the loopback and nothing says who may reach it. kaio-server setup lan accepts this host’s network, kaio-server setup proxy <IP> the proxy in front, and kaio-server setup local moves KAIO_ADDR back to 127.0.0.1: see Pick your case. In a container, name the Compose network: see Deploy with Compose. An unreadable value, such as a CIDR with a typo, stops the server too, with the variable named. kaio-server check tells you without starting anything.

A server that joined a cluster before calls were signed says so instead:

Refusing to listen on http://0.0.0.0:8080: this server joined the cluster at
http://10.0.0.1:8080, but holds no key of that control plane, ...

Join it again with a fresh token from the control plane; meanwhile kaio-server setup lan lets it start.

Run kaio-cli whoami the same way as the call that failed: it answers at any level and says who the server takes you for.

  • Requests from <address> are refused: that address is neither a trusted proxy nor on an allowed network. The message names the line that would let it in, for the address alone and for its network. A container reaching Kaio through a published port comes from the Compose network, not from 127.0.0.1.
  • ... the request does not carry the shared secret: the proxy’s address is trusted, and KAIO_PROXY_SECRET_FILE is set, but the proxy does not send X-Kaio-Proxy-Secret, or sends another value.
  • <action> needs the write level, and alice has read: identity worked, the level does not reach. Check the groups your proxy sends against KAIO_GROUPS_*.
  • Cross-site request refused: a browser page on another origin sent it. Name that origin in KAIO_ALLOWED_ORIGINS if it is yours.
  • user: (none) behind a proxy: the proxy’s address is not in KAIO_TRUSTED_PROXIES, so its identity headers are dropped. Kaio sees the proxy’s own address, which, behind Docker, is its address on the Compose network.

Every refusal of a sensitive action is in kaio-cli audit with its reason.

Something in front of that node asked for a credential the control plane does not have, typically a reverse proxy with authentication added after the join. A node needs no proxy: once joined, it answers its control plane by signature and refuses everyone else, so let the control plane reach the node’s own port, or drop it from the registry with kaio-cli node rm prod-01: an unreachable entry is only a dead route. A 401 on a call through the gateway is the node refusing the signature instead: both sides must run 0.6.0, and a node that left the cluster no longer trusts its old control plane.

  • Invalid join token: a token lets one server in, once, within 24 hours, and --rotate retires the unused ones. It was spent, expired or retired: mint a fresh one on the control plane with kaio-cli cluster token.
  • A control plane cannot join itself: registering the server that already holds the registry is refused by design.
  • already enrolled under another key: the identity in data/ is in the registry, but this server signs with another key. Two machines share a copied data/, or the key was lost. If this one is the rightful server, drop the old row with kaio-cli node rm <name> on the control plane and join again.
  • does not answer as <name>, so its address was left unchanged: the node is already in the registry, but the address worked out for this join differs from the one recorded, and nothing at the new one answers with its identity. Pass the recorded address, as kaio-cli node ls shows it, port included, with --advertise. The token is not spent by this refusal.
  • refused this control plane's signature: the node has left this cluster or joined another since. Run kaio-cli join on it again.
  • more than 300s away from this server's clock: the two clocks disagree. Run NTP on both.
kaio-server[1242]: thread 'main' panicked at crates/server/src/main.rs:31:10:
kaio-server[1242]: Failed to connect to Docker
kaio.service: Scheduled restart job, restart counter is at 93.

The host has no Docker daemon, or the one it has is unreachable by the kaio user. kaio-server talks to the daemon at startup and exits when it cannot, and Restart=always then loops. Install Docker, which is a prerequisite rather than an option:

Terminal window
curl -fsSL https://get.docker.com | sh
systemctl restart kaio

The installer names this as its first step when docker is not on PATH. If Docker is installed and the loop persists, the daemon is elsewhere: point KAIO_DOCKER_HOST at it in /etc/kaio/kaio.env, and check that the kaio user is in the docker group with id kaio.

The gateway only forwards to servers in the registry, so a 404 there means the node is not in it, usually because it was removed or it left. That says nothing about the node’s own health: its address stays exactly as reachable as before, and KAIO_ADDR=<node> kaio-cli status still works. It rejoins by running kaio-cli join again, from the node itself.

A deploy failed and the stack looks unchanged

Section titled “A deploy failed and the stack looks unchanged”

That is intended: a failed compose up restores the previous compose.yml and .env, and the submitted variables are not persisted. Read the error returned by the deploy: it is the raw Compose output.

The toolchain is pinned by Nix. Wrap the command:

Terminal window
nix-shell shell.nix --run "cargo test --workspace"

Kaio, built by Régis Gaidot