# Operations

Operate the local agent with metro failover, automatic updates, telemetry and troubleshooting

Source: https://zerocopy.sh/docs/swqos/agent/operations

## Regions and failover [#regions]

The agent chooses a primary metro and keeps other reachable metros available for failover.

### Automatic metro selection [#follow]

Leave `upstreams` unset for automatic selection. The agent follows available metros and favors low round trip time. See [Endpoints](/docs/swqos/endpoints#regions) for hostnames.

### Pinned metros [#pinned]

Set a [pinned upstream list](/docs/swqos/agent/configuration#upstreams) only when you need to restrict the available metros. Pinning also restricts failover: the agent will not use an unlisted metro when every listed metro is unavailable.

### Metro changes [#selection]

The agent checks reachable edges and changes its choice when a better connection is available or the current connection fails. Small latency differences may not cause a switch. Ordinary failover needs no restart.

If the agent chooses an unexpected metro, check the pinned list, DNS and outbound UDP access from the host. If the problem persists, ask on [Discord](https://discord.gg/zerocopy).

### Handle connection failover [#failover]

If an edge connection closes during a request, the agent may send the same request through another edge. The first edge may already have forwarded it, so delivery can happen twice. Check the signature before sending a replacement.

When a request needs an edge and none is available, it can return [`not_ready`](/docs/reference/errors#not_ready) with `waiting_for: upstream`. Check [network access](/docs/swqos/agent/install-and-run#network) and the service log. See [Confirmation](/docs/swqos/confirmation) for uncertain outcomes.

### Share edge connections [#connections]

An edge allows up to 32 QUIC connections per API key. Agents and direct QUIC clients using that key share the limit. Reuse running agents and client connections across sends.

## Automatic updates [#automatic-updates]

### Release checks [#process]

The licensed agent updates automatically. Before installing a release, it verifies the release and checks that it can start with your configuration and reach an edge. The running release keeps serving during the check and stays in place if the check fails.

### Keep the host ready [#needs]

Keep the executable directory writable by the agent's account, including under service sandboxing. With systemd's `ProtectSystem=strict`, use `ReadWritePaths=/opt/zerocopy` as in the [service example](/docs/swqos/agent/install-and-run#service). When launching through a symbolic link, the target directory must be writable.

Keep the configuration readable and valid. Updates preserve owner access to the executable and remove group and other permissions.

### Reconnect clients [#restart]

Installation closes local HTTP, QUIC and IPC connections. Reconnect once the listeners return. IPC clients must open a new session and repeat the handshake. A lost reply leaves the outcome unknown; check the signature before replacing the transaction.

Run [`--check`](/docs/swqos/agent/install-and-run#check) to see the installed release number.

### Update failures [#updates]

#### Diagnose an attempt [#failures]

Read `journalctl -u zerocopy-agent` for warnings with `release=` and `error=` fields.

| Error | Action |
| --- | --- |
| `install` or `Permission denied` | Check executable directory ownership, read only mounts and service sandboxing |
| `staged release failed its check` | Include the preceding `error:` lines when contacting support |
| Network access failure | Restore outbound access to the metro hosts |
| `error: restart <path>` on standard error | Check that the executable can run; the example service restarts after a process failure |

The running release remains in service when an update attempt fails. After fixing a host problem, restart the service to trigger a fresh attempt. Ask for help on [Discord](https://discord.gg/zerocopy) if the failure persists.

### Replace the executable manually [#replace]

When ZeroCopy provides a replacement, stop the service, follow [installation](/docs/swqos/agent/install-and-run#executable), verify its checksum and start the service again.

## Telemetry [#telemetry]

Telemetry is required for the licensed agent and cannot be turned off. Your license agreement and the [Privacy Notice](https://zerocopy.sh/privacy) cover it.

### Network access [#transport]

Reporting uses the edge connection and needs no separate firewall rule. Keep the [required outbound access](/docs/swqos/agent/install-and-run#network) available.

### Reported data [#contents]

| Category | Information |
| --- | --- |
| Agent and host | Release and build ID, host name, hashed machine ID specific to the application, operating system, kernel, architecture, CPU and memory information, DMI system vendor and product name, uptime, metro configuration and local listen addresses |
| Requests | Counts, outcomes, response latency and forwarding results |
| Connections | Edge latency, metro changes and connection failures, local connection counts and client activity counters |
| Updates and logs | Release changes, failed updates, warning and error log lines with their fields |

The agent hashes the machine ID on the host; the raw ID does not leave it. When the machine ID is unavailable, the agent uses a fallback ID, which may be shared by multiple hosts. The host name is reported separately.

Logs also go to standard output. With the example service, read them using `journalctl -u zerocopy-agent`.

### Excluded transaction data [#excluded]

Telemetry does not include transaction bytes, signatures, bundle contents or request bodies. It does not include the IPC socket path or the full contents of your configuration file.

## Troubleshooting [#troubleshooting]

### Startup errors [#startup]

Read `journalctl -u zerocopy-agent` or the terminal's `error:` lines. Run [`--check`](/docs/swqos/agent/install-and-run#check) to separate configuration and edge connectivity failures from listener failures.

| Error | Action |
| --- | --- |
| `GLIBC_2.39' not found` | Use a [supported platform](/docs/swqos/agent/install-and-run#platform) with glibc 2.39 or newer |
| `unknown argument` or `--config requires a path` | Pass `--config /etc/zerocopy/agent.toml`, optionally followed by `--check` |
| `read config` | Check the path and make the file readable by `zerocopy` |
| `parse config`, `unknown field` or `the customer binary does not accept the config option` | Use [supported options](/docs/swqos/agent/configuration); keep `upstreams` above table headers |
| `upstreams entry ... is not host:port with a host under sol.zerocopy.sh` | Use a [metro hostname and port](/docs/swqos/agent/configuration#upstreams) |
| `invalid log filter` | Fix `log.level` or the overriding `RUST_LOG` environment variable |
| `Address already in use` | Stop the other process or give each agent different listener ports |
| `bind <address>: Operation not permitted` | Match the [service port restrictions](/docs/swqos/agent/install-and-run#ports) to `listen.http` and `listen.quic` |
| `TPU client: I/O error: Operation not permitted` | Keep `SocketBindAllow=ipv4:udp:0` for outgoing QUIC sockets |
| `bind IPC ... No such file or directory` | Create the socket directory or use the [example service](/docs/swqos/agent/install-and-run#service) |
| `bind IPC ... Permission denied` | Make the socket directory writable by `zerocopy` |
| `another instance holds the IPC socket lock` or `another instance is listening on the IPC socket` | Stop the other agent or choose another IPC path |
| `IPC path exists and is not a socket owned by this user` | Inspect the path; remove it only if it belongs to a stopped instance, or choose a new path |

Keep IPC paths shorter than 108 bytes. For `no valid executable license data`, `no valid release slot` or `this build has no API key compiled in`, [verify the checksum](/docs/swqos/agent/install-and-run#checksum) and contact support for the correct licensed file.

### The connectivity check fails [#check]

For `no region answered in time`, check that metro hostnames resolve to IPv4 addresses, outbound UDP 443 reaches them, the system clock is correct and any pinned metros are available.

If the connection is refused despite correct network access, contact support to check the license and API key.

### Sends fail [#sends]

| Rejection | Action |
| --- | --- |
| [`not_ready`](/docs/reference/errors#not_ready), `waiting_for: upstream` | Check `/health`, the service log and network access |
| [`not_ready`](/docs/reference/errors#not_ready), `waiting_for: tip_vaults` | Fetch tip accounts again shortly |
| [`not_ready`](/docs/reference/errors#not_ready), `waiting_for: token_price` or `lookup_table` | Retry shortly, or tip in SOL to a static tip account |
| [`missing_tip`](/docs/reference/errors#missing_tip) | Meet the returned `minimum` with a [live tip account](/docs/swqos/tips#live-accounts), a [token tip](/docs/swqos/tips#tip-in-tokens) or an enabled [declared tip](/docs/swqos/tips#declared-tips). Agent releases that predate token tips refuse [token and lookup-table tips](/docs/swqos/agent/local-interfaces#token-tips) locally |
| [`payment_required`](/docs/reference/errors#payment_required) | Resolve the outstanding payment through [Billing](/docs/account/billing) or support |
| [`forward_failed`](/docs/reference/errors#forward_failed) | Check the signature before retrying |
| [`unsupported`](/docs/reference/errors#unsupported) for `tip_floor` | Query the [tip floor](/docs/reference/json-rpc/tip-floor) on a hosted endpoint |
| [`unsupported`](/docs/reference/errors#unsupported) for `bundles` | Bundles are turned off for the key; contact support to discuss access |

Use requests with replies to diagnose problems. A request without a reply cannot report its rejection. See [Errors](/docs/reference/errors) for other refusals and [Confirmation](/docs/swqos/confirmation) before resubmitting.

### Local clients cannot connect [#clients]

| Symptom | Action |
| --- | --- |
| HTTP connection refused | Wait for startup and check the address against `listen.http` |
| QUIC handshake fails | Use ALPN `zerocopy-swqos/1` and the [local certificate settings](/docs/swqos/agent/local-interfaces#certificate) |
| IPC `ENOENT` or `connect: No such file or directory` | Check `listen.ipc` and that the agent is running |
| IPC `EACCES` or `connect: Permission denied` | Give the application [socket access](/docs/swqos/agent/install-and-run#ipc-access) and restart it after a group change |
| IPC `ECONNREFUSED` or `connect: Connection refused` | Check that an agent is listening, rather than a socket left by a stopped instance |

### IPC sessions end or replies are missing [#ipc]

After a stop or update, reconnect and repeat the handshake. If a session closes immediately after a submission, compare your client with the [record and ring rules](/docs/reference/ipc#writing).

For missing completions, make sure each submission requests a reply, uses a distinct request ID and that your client keeps draining completions. See [submission flags](/docs/reference/ipc#submissions). Set a timeout for every request. For `no completion within 5 seconds`, check the signature and service log before retrying.

### One CPU core stays busy [#cpu]

With `ipc_busy_poll = true`, one core stays busy while any IPC client is connected, even an idle one. Set it to `false`, disconnect idle clients or restrict the agent's CPUs. See [busy polling](/docs/swqos/agent/configuration#busy-poll).

### Contact support [#support]

Give support your team name, the `--check` output and the settings relevant to the problem. Include the `error:` lines and their `site=` codes. Remove credentials from anything you share, including URLs in logs or configuration. Never send the licensed executable.
