Troubleshooting¶
Common issues with Eight.ly Agent and how to resolve them.
Enable Debug Logging¶
The first step for any issue is to enable debug logging. This switches output from JSON to human-readable format and includes heartbeat confirmations, startup config details, and request-level information.
Docker:
docker run -d --init \
-e LOG_LEVEL=debug \
... \
ghcr.io/imogenlabs/eightly-agent:latest
Or for a running container:
docker stop eightly-agent
docker rm eightly-agent
# Re-run with LOG_LEVEL=debug
Binary:
./eightly-agent --log-level debug ...
Viewing logs:
docker logs -f eightly-agent
At debug level, you will see heartbeat confirmations (heartbeat ok), startup configuration values, and the agent version/port/socket path at startup.
Agent Will Not Register¶
Symptoms: Agent starts but never appears in the EOS dashboard. Every authenticated request answers 503 with Retry-After: 30 and {"message":"service unavailable: agent is not registered with the server yet"}. Log shows:
WRN registration failed
WRN agent is not registered; authenticated routes answer 503 until it is retry_in=5000
The agent keeps retrying in the background, waiting 5 seconds and then twice as long each time, up to 5 minutes. Once it registers, the 503s stop without a restart. Only /ping, /healthz, /readyz and /version answer while it waits.
A register failed: status 403 in the log means the server refused the enrollment token: it was already used, has expired or is wrong. Retrying will not help. Generate a new install command in EOS, set the new EIGHTLY_ENROLL_TOKEN, and restart the agent.
If the log instead says not registering: the registration state cannot be saved; set EIGHTLY_STATE_PATH to a writable file, the agent has not spent the enrollment token: make the state directory writable by the agent (uid 1000 in the image) or point EIGHTLY_STATE_PATH somewhere that is.
Check these in order:
-
Is the server URL correct?
If this times out or returns an error, the agent cannot reach EOS.curl -k https://your-eos-server:8080/api/health -
Is the enrollment token valid? EOS enrollment tokens are single-use and may expire. Generate a new one from the EOS admin panel and restart the agent with the new token.
-
Network connectivity The agent needs to reach EOS on the configured port. Check for firewalls, VPN requirements, or DNS resolution issues.
# From the agent host curl -k -v https://your-eos-server:8080/api/agents/register -
State file from a previous registration If a state file exists at the configured
--state-path, the agent skips registration and goes straight to heartbeat. If the state is stale (different EOS server, old agent ID), generate a new install command in EOS first, because the old enrollment token is already spent. Then delete the state file and start the agent with the newEIGHTLY_ENROLL_TOKEN. For Docker, re-run the container with the new token (an environment variable cannot be changed on an existing container):docker exec eightly-agent rm /data/eightly-agent.json docker rm -f eightly-agent # re-run with -e EIGHTLY_ENROLL_TOKEN=<new token>; keep the same data volume
Heartbeat Failures¶
Symptoms: Agent is registered but shows as offline in EOS. Logs show:
WRN heartbeat failed error="heartbeat: 401" failures=1
WRN heartbeat failed error="heartbeat: 401" failures=2
WRN re-registering after repeated heartbeat failures
Causes and fixes:
-
401 status: The agent's token was invalidated on the EOS side (e.g., the agent was deleted and re-added in EOS). Generate a new install command in EOS, delete the state file, and start the agent with the new enrollment token.
-
agent token expired, so this agent must be re-enrolled: The agent was off long enough for its 30-day token to lapse (it renews from day 15 while running). Generate a new install command under Environments → Add Agent and run it on the host; the agent uses the new enrollment token in place of the lapsed saved one. -
Connection refused / timeout: EOS is unreachable. The agent will back off (30s -> 60s -> 120s -> 240s -> 300s) and attempt re-registration after 3 consecutive failures. Once EOS is reachable again, the agent recovers automatically.
-
Exponential backoff stuck at 5 minutes: After sustained failures, the heartbeat interval caps at 300 seconds. If EOS is back online, the agent will eventually reconnect, but it may take up to 5 minutes. Restart the agent for immediate reconnection.
Docker Socket Permission Denied¶
Symptoms: Requests to the Docker proxy return errors. Agent may log:
docker connect failed
Fixes:
-
Check socket permissions:
ls -la /var/run/docker.sock # srw-rw---- 1 root docker 0 May 20 10:00 /var/run/docker.sock -
Docker container: Ensure the socket is mounted correctly:
volumes: - /var/run/docker.sock:/var/run/docker.sock -
Binary mode: The user running the agent must be in the
dockergroup or be root:sudo usermod -aG docker $USER -
Socket path mismatch: If Docker uses a non-standard socket path (e.g., rootless Docker at
$XDG_RUNTIME_DIR/docker.sock), configure it:-e DOCKER_SOCKET=/run/user/1000/docker.sock
Agent Refuses to Start¶
Symptoms: Agent exits immediately on startup with invalid configuration.
Causes and fixes:
-
No secret: The agent is fail-closed -- a shared secret is required. Set it with
EIGHTLY_AGENT_SECRET,--secret, or a file named by--secret-file/EIGHTLY_AGENT_SECRET_FILE:For development only, opt in to no-auth mode with-e EIGHTLY_AGENT_SECRET="your-shared-secret"-e EIGHTLY_INSECURE_NO_AUTH=trueor--insecure-no-auth. -
Secret set twice: A secret file together with
--secretorEIGHTLY_AGENT_SECRETis refused. Keep only the file. -
Secret file unreadable or empty: The error names the file. On Windows it also says when the file's access list could not be closed to other accounts.
-
Not a boolean:
EIGHTLY_METRICS_ENABLED,EIGHTLY_BROWSE_READ_ONLYandEIGHTLY_INSECURE_NO_AUTHaccepttrue/false,1/0,yes/nooron/off. Anything else stops the agent with an error such asEIGHTLY_METRICS_ENABLED="ture" is not a boolean; use true or false. -
Server URL not https:
--server-urlmust usehttpsunless--insecure-server-tlsis set.
TLS Errors¶
Client gets "certificate signed by unknown authority"¶
The connecting client (typically the EOS server, or curl) doesn't trust the agent's self-signed certificate. Options:
- Use --tls-san to include the correct hostnames/IPs in the auto-generated cert
- Provide a proper CA-signed certificate to the agent
- Configure the EOS server to trust the agent's self-signed cert via --server-ca
- For curl debugging only: curl -k https://agent-host:9001/ping (never in production)
Agent fails to register -- outbound TLS error¶
Outbound TLS to EOS is fail-closed by default. The agent pins the EOS server's certificate on the first successful registration and refuses any other certificate afterwards; with --server-ca it also verifies the chain against that CA. If the EOS server's certificate was replaced on purpose, the saved pin no longer matches: delete the state file and enroll the agent again with a fresh enrollment token.
- --insecure-server-tls turns off verification and pinning. Dev only.
See TLS for full details.
"failed to generate TLS cert"¶
The agent cannot write to the data directory. Check:
# Directory exists and is writable
ls -la /data/
# Or for Docker, check the volume mount
docker inspect eightly-agent | grep -A5 Mounts
"failed to load TLS cert"¶
The cert or key file exists but is malformed. Delete both and restart to regenerate:
rm /data/cert.pem /data/key.pem
# Restart agent
Certificate past its end date¶
Auto-generated certificates carry a 1-year validity, and the agent keeps serving the same certificate after that on purpose: Eight.ly OS pins this exact certificate, and the container health check ignores its dates. A browser or curl will report it as expired; that does not affect Eight.ly OS. Do not delete the files to "renew" it: a new certificate cuts the agent off until it is accepted again in EOS. See TLS.
"refusing to reuse TLS key"¶
The key in the data directory is readable by others and the agent could not tighten it to 0600 (for example a read-only bind mount). Fix the mode and owner on the host. On Windows the message means another account still has access to the key after the agent tried to remove it; check with icacls.
WebSocket Connection Drops¶
Symptoms: Terminal session disconnects unexpectedly.
Possible causes:
-
Container exited: When the container or exec process exits, Docker closes the stream and the WebSocket terminates. Check if the container is still running:
curl -k -H "Authorization: Bearer $TOKEN" https://localhost:9001/containers/<id>/json | jq .State.Running -
Session limits: A session with no input from the client for 15 minutes is closed, and every session ends after 8 hours. A client that stops reading for more than 10 seconds is disconnected. Reconnect if this happens.
-
Network interruption: Any break in the TCP connection between the client and agent will terminate the WebSocket. There is no automatic reconnection built into the agent.
-
Reverse proxy timeout: If a load balancer or reverse proxy sits between the client and agent, ensure it has WebSocket support enabled and an idle timeout of at least 15 minutes.
WebSocket returns "docker connect failed"¶
The agent cannot connect to the Docker socket. Same as the Docker socket permission issue above.
WebSocket returns "docker attach failed" or "docker exec start failed"¶
Docker rejected the attach or exec request. Common causes: - The container ID does not exist - The container is not running (for attach mode) - The exec ID is invalid or already started (for exec mode)
Docker Requests Refused With 403¶
Symptoms: Installing, updating or recreating an app from the dashboard fails, or a console will not open, with {"message":"forbidden: <reason>"}. The agent logs [SECURITY] proxy.denied (or websocket.denied for the console) with the same reason.
The Docker proxy forwards only an allow-list of endpoints and refuses requests that would let a container reach the host. The reason names the rule:
host bind mount rejected: <path> (no --allowed-bind-roots are set; use a named volume)or... is outside --allowed-bind-roots: the container binds a host folder the agent does not allow. Add the folder, or a parent of it, toEIGHTLY_ALLOWED_BIND_ROOTS(for example/opt/appdata) and restart the agent, or give the container a named volume. See Configuration.bind source ... runs through the symlink ...: a component of the path below the bind root is a symlink. Replace it with a real folder.volume <name>: ...: a named volume was made with bind options pointing outside the bind roots, or with options for a non-local driver.the agent's own container is off limits,container ... holds the Docker socketorcontainer <id>: <rule>on exec, attach, the console or a file upload: the target container itself reaches the host (privileged, a host namespace, the Docker socket, a host folder outside the roots, an extra capability or a device). Such a container keeps running and can be started and stopped, but nothing can be run inside it through the agent.endpoint not allowed: <METHOD> <path>: the Docker endpoint is not on the allow-list. Image builds, commits, exports, image load and push, and Swarm are not available through the agent.--allowed-bind-roots: ... is, holds or is inside the system directory ...at startup: a root names a system folder or a parent of one, such as/optor/var. Name the app data folder itself, such as/opt/appdata.
File Browser 403 / Permission Denied¶
Symptoms: File browser operations fail with 403 or 500 errors.
Fixes:
-
Volume mount for file browser: The agent resolves file paths as
<volumes-path>/<volumeID>/_data/<path>, with--volumes-pathdefaulting to/var/lib/docker/volumes. A503naming that folder means it is not there: bind it in at the same path, asdocker-compose.ymldoes:Avolumes: - /var/lib/docker/volumes:/var/lib/docker/volumes501means the agent found no volumes folder at all: on Docker Desktop (macOS, Windows) volumes live inside its virtual machine and the file browser is not available. -
File ownership: Docker volumes may be owned by different UIDs inside containers. The agent runs as uid 1000 in the image and needs read (and, for uploads, write) access.
{"error":"volume is not readable by the agent"}(403) means it has none. -
Path traversal rejection: If you see
{"error":"path traversal rejected"}, yourvolumeIDorpathparameter contains... Use clean paths without parent directory references. -
Hidden paths:
{"error":"forbidden"}(403) means a segment of the path starts with.(.ssh,.env,.git). Hidden files and folders are never reachable through the file browser. -
Special files:
{"error":"not a regular file"}(400) means the target is a pipe, socket or device. Only regular files can be downloaded or overwritten. -
Read-only mode:
{"error":"read-only mode"}(403) on upload, delete or rename means the agent runs with--browse-read-only.
Agent Not Responding on Expected Port¶
-
Check the port configuration:
docker logs eightly-agent 2>&1 | grep "listening" # Expected: listening (TLS) addr=0.0.0.0:9001 -
Port mapping: In Docker, ensure the port is published:
docker port eightly-agent # 9001/tcp -> 0.0.0.0:9001 -
Firewall: Check that port 9001 (or your custom port) is open:
sudo ufw status | grep 9001 sudo iptables -L -n | grep 9001 -
Address binding: The default
--addr 0.0.0.0listens on all interfaces. If the agent is configured with--addr 127.0.0.1, it only accepts local connections.
Version Mismatch¶
Check the agent version from the response headers:
curl -kI https://localhost:9001/ping
# Eightly-Agent: 2.0.0
# Eightly-Agent-API-Version: 2
If the EOS dashboard expects a different API version, update the agent to match. Pull the latest image:
docker pull ghcr.io/imogenlabs/eightly-agent:latest
docker stop eightly-agent && docker rm eightly-agent
# Re-run with the same configuration
Windows¶
Service Won't Install¶
Symptoms: Running eightly-agent.exe install fails with an access denied error.
Fix: You must run the command from an elevated (Administrator) command prompt or PowerShell. Right-click Command Prompt or PowerShell and select "Run as administrator", then retry:
eightly-agent.exe install
eightly-agent.exe start
Service Starts but Immediately Stops¶
Symptoms: eightly-agent.exe start succeeds, but the service shows as "Stopped" moments later in services.msc.
Diagnosis: The service writes its log to standard error, which Windows discards for services, so the reason is not in Event Viewer (the System log only records that the service stopped). Run the agent by hand to see it; see Viewing Logs When Running as a Windows Service.
Common causes:
-
Missing or empty secret file: The service reads its secret from the file
installconfigured (defaultC:\ProgramData\eightly-agent\secret). Write it from an elevated PowerShell:Set-Content -NoNewline -Path C:\ProgramData\eightly-agent\secret -Value 'your-shared-secret' -
Secret set twice: The agent refuses to start when
EIGHTLY_AGENT_SECRETis set as well as the secret file. Remove the old Machine variable, which every local user can read:[System.Environment]::SetEnvironmentVariable("EIGHTLY_AGENT_SECRET", $null, "Machine") -
Secret file or state open to other users: The agent refuses the secret file, the state file and the TLS key if an account other than SYSTEM, Administrators and its own still has access after it tries to lock them down. Check with
icacls C:\ProgramData\eightly-agent\*and remove the extra entries. -
A boolean variable with a bad value:
EIGHTLY_METRICS_ENABLED,EIGHTLY_BROWSE_READ_ONLYandEIGHTLY_INSECURE_NO_AUTHmust betrueorfalse(or1/0,yes/no,on/off); anything else stops the agent at startup. -
Port conflict: Another process is using port 9001. Check with:
netstat -ano | findstr :9001
Docker Socket Connection Refused on Windows¶
Symptoms: Agent starts but Docker API requests fail. Logs show connection errors to the Docker socket.
Fixes:
-
Docker Desktop must be running: Unlike Linux where Docker runs as a system daemon, Docker Desktop on Windows must be launched and running. Check the system tray for the Docker whale icon.
-
Named pipe path: The agent defaults to
//./pipe/docker_engineon Windows, which is Docker Desktop's standard named pipe. If you use a non-standard Docker configuration, set the correct path:[System.Environment]::SetEnvironmentVariable("DOCKER_SOCKET", "//./pipe/your_custom_pipe", "Machine") -
WSL2 backend: If Docker Desktop is configured with the WSL2 backend, the named pipe should still be available on the Windows side. If it is not, ensure "Expose daemon on tcp://localhost:2375 without TLS" is disabled (use the pipe, not TCP).
Viewing Logs When Running as a Windows Service¶
The agent logs to standard error. Under the Service Control Manager that output is discarded, and the agent does not write to the Windows Event Log; Event Viewer's System log only shows the service starting and stopping.
Running interactively for debugging: Stop the service and run the agent in an elevated PowerShell with the same secret file to see its output:
eightly-agent.exe stop
eightly-agent.exe --secret-file C:\ProgramData\eightly-agent\secret --log-level debug
Press Ctrl+C to stop, then restart the service when done debugging.
Collecting Diagnostic Information¶
When reporting an issue, include:
- Agent version (
Eightly-Agentheader or startup log) - Logs at debug level (
LOG_LEVEL=debug) - Docker version on the host (
docker version) - How the agent is deployed (Docker or binary, full command/compose)
- The specific error message or behavior observed
- Network topology (is there a reverse proxy, VPN, or firewall between EOS and the agent?)
See Also¶
- Configuration -- All flags and environment variables
- Authentication -- Token format and common auth errors
- TLS -- Certificate generation and custom cert setup
- Registration and Heartbeat -- Registration flow and heartbeat recovery
- WebSocket Console -- WebSocket protocol and error codes
- File Browser -- Path resolution and security model