Troubleshooting
Start with the symptom below. Commands assume the quick-start
instance at http://localhost:8080. For a different host or port, replace the URL.
Ask the instance first
GET /_rustybin/diagnostics (admin) runs every check Rustybin knows and answers
each with a status (ok, warn, fail), what it saw and the fix. It never
returns a credential. It is not readiness (/_rustybin/ready, for the platform)
and not the demo toggle (/health).
GET {{secured_url}}/_rustybin/diagnostics
Authorization: Bearer {{admin_token}}
HTTP 200
[Asserts]
jsonpath "$.status" matches "^(ok|warn|fail)$"
jsonpath "$.checks[*].id" contains "state_dir"
jsonpath "$.checks[*].id" contains "settings_file"
jsonpath "$.checks[*].id" contains "listeners"
jsonpath "$.checks[?(@.id == 'listeners')].status" contains "ok"
From the command line, rustybin doctor prints the same checks as a table and
exits 1 when one fails, so a deploy script can stop on it:
rustybin doctor --profile prod
| Check | What it looks at |
|---|---|
state_dir | the state directory is set and writable (a probe file); set but unwritable is fail, none at all is warn (nothing survives a restart) |
secrets_key | where the secrets key comes from; a key held only by the process is warn |
secrets_unreadable | stored secrets sealed under another key |
settings_file | the settings document loaded at startup; when it did not, the instance started empty |
mock_load_errors | mock files, the config file and saved mocks that did not load |
config_file | RUSTYBIN_CONFIG_FILE can be read |
listeners | HTTPS and gRPC started (HTTP always has: a bind failure stops the process) |
egress_refusals | outbound calls the egress policy refused in the last hour, by purpose |
source_control | the last git operation |
source_control_diverged | (only when it has) the branch has commits here and on the remote: the instance never merges and the automatic mode does not resolve it, so a person chooses a way out |
source_control_signing | (only with git.sign on) commit signing can work: a usable signing key, a git that signs with SSH keys |
source_control_verification | (only with git.verify on) verified pulls can pass something (an allowed signer or a signing key, git 2.38 or later) and the repository's side was not refused: a warning names the commit no allowed signer signed, and nothing of it was applied |
source_control_host | (only when git.host resolves to a git host) a pull request can be opened there. A warning says what is missing: no token for the API (git.host_token), an API the outbound policy refuses, an API address that fails its rules, or a repository whose name the kind cannot read. With git.host on auto, a repository on a public host and no token it is ok and says that pull requests are opened by hand. Not there without a repository or with git.host on none |
default_password | the console still accepts the default password |
users | (password mode) where the users live: <state>/users.json, in memory without a state directory (warn), or a file that could not be read or written (fail; an unreadable file is never written over) |
client_documents | (only with oauth.client_metadata_documents on) the outbound policy permits a host for the purpose client_metadata; with none named in egress.allow every client's document is refused before any call (warn) |
harness | load test mode with an engine problem |
assist | AI assist configured but not usable |
A git host that is named and has no token, as the check answers it:
# A host is named and no token is set for its API: the diagnostics say so
# before anyone asks for a pull request.
curl -s -o /dev/null -X PATCH -H "Authorization: Bearer $ADMIN" -H "Content-Type: application/json" \
-d "{\"values\": {\"git.host\": \"github\", \"git.host_api\": \"$HOST_API\"}}" "$A/_rustybin/settings"
curl -s -H "Authorization: Bearer $ADMIN" "$A/_rustybin/diagnostics"
The route needs settings.read (the viewer role and the console scope have it); a
token without it, an inspector one say, gets 403 naming the permission:
GET {{secured_url}}/_rustybin/diagnostics
Authorization: Bearer {{inspector_token}}
HTTP 403
[Asserts]
jsonpath "$.reason" == "permission_required"
jsonpath "$.permission" == "settings.read"
On every surface
| Surface | Where |
|---|---|
| API | GET /_rustybin/diagnostics (admin) |
| Console | Management, Diagnostics: one row per check with its fix, Run again |
| CLI | rustybin doctor (--json for the report; exit 1 on a fail) (reference) |
| Management MCP | diagnose_instance (read only, admin; the messages of mock_load_errors and source_control quote file and remote text, so they come as untrusted_message) (agent page) |
rustybin.yaml | Nothing to configure: the checks read the instance's state |
I cannot connect to the instance
Check the HTTP listener first:
curl -i http://localhost:8080/_rustybin/ready
Expect 200. With Docker, run docker ps and docker logs rustybin; the
quick-start mapping is host port 8080 to container port 80. Compose uses host
port 80, so its URL is http://localhost instead.
If Cargo reports a bind error, use high ports as shown in the Cargo setup, or stop the process already using the port. HTTPS and gRPC are optional: a warning about one of them does not mean HTTP failed.
The console or API returns 401 or 403
A fresh instance's console at /ui uses rustybin / rustybin. A
/_rustybin/* call needs the token from that sign-in; the console attaches it for
you. For the CLI, run rustybin login --url http://localhost:8080.
- 401: sign in again if the token expired or was revoked. Check that the CLI profile or base URL points to the instance you intended.
- 403: the credential may lack a required scope, an admin guard may apply, or the feature may be disabled in public mode. Read the JSON error for the reason.
- A data-plane endpoint asks for credentials: authentication demo routes, secured mocks and instances with required API keys have their own credentials. The console password is for managing the instance. See mocked security or authentication.
For password recovery with an admin token, alternative auth modes and hosted instances, see control-plane security.
An example fails when I copy it
Most reference pages show Hurl, a request followed by response assertions. It
is a file format, so paste the block into a .hurl file and run Hurl; lines such
as HTTP 200 and [Asserts] are not shell commands. {{base_url}} is a Hurl
variable. The examples guide explains how to set it and gives the
equivalent curl request.
The full example runner configures several fresh instances, including an open control plane and an admin token. On your default instance, sign in for control routes. Some examples also need sample mocks, a particular auth mode or a shared session; check the page's prerequisites and the runner settings.
HTTPS reports a certificate error
Rustybin generates a demo CA and server certificate at startup. Download the CA
from /auth/mtls/get-ca-cert, extract its PEM value with jq, then pass it to curl:
curl -fsS http://localhost:8080/auth/mtls/get-ca-cert | jq -r .ca_cert_pem > rustybin-ca.crt
curl --cacert rustybin-ca.crt https://localhost:8443/health
Use the host names covered by the demo certificate (localhost or loopback).
If certificates change after a restart, persist /app/certs in Docker. See
TLS configuration and
mTLS for client certificates.
My changes disappeared after a restart
Without a state directory, settings and API-created mocks are in memory. Set
RUSTYBIN_STATE_DIR to a writable persistent directory. In Docker, use a volume:
docker run -d --name rustybin-saved -p 8081:80 \
-e RUSTYBIN_STATE_DIR=/app/certs/state \
-v rustybin-data:/app/certs \
ghcr.io/coldbathcode/rustybin:latest
This example uses port 8081 so it can run alongside the quick-start container;
open http://localhost:8081/ui. For a bind mount, the directory must be writable
by the container's user, uid 10001. This command puts state under /app/certs
because the image already makes that volume location writable by uid 10001.
A new volume at /app/state needs its ownership prepared first; otherwise the
instance can answer requests while its logs warn that secrets cannot be saved.
The state directory keeps settings, sealed secrets, saved mocks and other persisted configuration. It is not a log of captured traffic. For a portable, reviewable backup, export the instance as code and keep it in source control. See state directory details.
My mock returns 404 or 503
- 404: check the mock name and the spec's server prefix. The built-in sample
is
/mock/petstore/v1/pets/42, including/v1. An unknown operation is also 404; the problem response includes the base path. - 503: check whether the mock is disabled, has a draft that has never been
deployed, or comes from a file that did not load (the answer has
load_error). In the console's Mock APIs, inspect its state and deploy report. - Petstore is missing: the sample is off by default in public mode and can be
disabled with
RUSTYBIN_MOCKS_SAMPLE=false.
The mock URL reference explains prefixes, methods and reserved paths. Draft, deploy, rollback explains when an edit reaches the live URL.
An outbound connection is refused
Rustybin checks outbound destinations against its egress policy. Inspect Management, Network in the console and look for the refusal reason.
An external MCP server usually needs its host in RUSTYBIN_EGRESS_ALLOW (or the
egress.allow setting). Loopback also needs RUSTYBIN_EGRESS_ALLOW_LOOPBACK=true.
A destination can still be refused by a feature's own rules. Read
outbound connections before choosing the
allowlist for your setup.
If a gateway runs in another container, localhost means that container. Use the
Rustybin service name on a shared Docker network for its upstream address.
I cannot see a request in the inspector
In public mode the inspector captures requests tagged with
X-Rustybin-Session; use the same session when sending and reading traffic.
Some control routes are excluded and a time-to-headers timeout does not appear
in the inspector. Check request inspector and
sessions for capture rules and limits.
For a mock, its Traffic tab shows calls to that mock. For AI requests, use the AI request inspector.
A health check returns 503
/health is a demo switch: a test or a person can make it unhealthy on purpose.
Use /_rustybin/ready for a readiness probe and / for liveness. To restore the
demo health state, use Chaos and health in the console. See
health endpoints.