When something is wrong
Start here, always:
btk3s doctor
It changes nothing. It checks the tools, the cluster, the domain and the
certificates actually being served, the ingress, node resources, disk headroom,
Flux, port collisions, your Azure, credentials that have drifted apart, and
every asset's bindings and telemetry. FAIL is a problem; WARN is worth
reading; SKIP means the thing is not installed yet.
Then, for anything doctor says is repairable:
btk3s repair
It binds assets whose channels are not routed from their device, and tidies
what an earlier release left behind. btk3s up runs the same repairs at the
end, so up is never the wrong answer either.
Nothing loads in the browser
Check what is being served:
btk3s hosts show
- A certificate warning is expected until you trust the tenant's CA -
btk3s hosts trust; see Trust the tenant's certificates. - The page times out and k3s is in WSL2 or a Lima VM, and you are browsing
from Windows or macOS:
upstarts a relay so the VM's ports appear on the outer machine's localhost. Check it is there withdocker ps | grep btk3s-relay, and re-runbtk3s upif it is not. - The name does not resolve any more: a
btk3s.192.168.x.y.nip.iodomain stops pointing at your machine when the network changes.btk3s.127.0.0.1.nip.ionever moves. Changing the domain meansbtk3s downandbtk3s up, because it is baked into the certificates.
btk3s up stopped partway
From btk3s 0.7.7, it ends by naming the stage it stopped at and what to do next:
==> btk3s up stopped at: env layer: controllers
Next: run 'btk3s up' again - it continues from where it stopped.
If it stops at the same place, run 'btk3s bug' and send us the btk3s-bug-*.md file it writes.
Where the stage knows a specific fix, the Next: line says that instead. Every
stage is idempotent, so a rerun resumes rather than starting over.
A wait ran out. Every wait has a limit. When one runs out, or what it waits on can no longer get there on its own, btk3s says what it waited for and why, in the words of the thing it waited on. A release Flux gave up on:
external-secrets in flux-system to be Ready: it will not get there by waiting
Ready=False: Helm install failed for release ...: timeout waiting for: [Deployment/... status: 'InProgress']
Stalled=True: Failed to install after 1 attempt(s)
Wait another 10m? [Y/n]
Press Enter to wait another round; a release Flux had given up on is retried
first. Answer n to stop. The question is asked only in a terminal: run from a
script or CI, btk3s stops at the limit. A wait that cannot finish on its own,
such as a release Flux has stopped retrying, is reported straight away instead
of after its limit. On a slow first install, a chart's images can take longer
to pull than Flux allows; waiting again, or running btk3s up again, retries
it.
The run log keeps one line per wait, such as wait done after 47s (limit 10m): external-secrets in flux-system to be Ready; btk3s bug sends it.
After a machine restart, the first up can wait a while: k3s has to be running
(systemctl is-active k3s), and the tenant is not applied until the External
Secrets webhook is accepting.
A device cannot connect
btk3s doctor # the Domain section checks EST and the broker leaf
The CA that EST hands out must be the CA that signed the broker's certificate; doctor compares them. If that passes and a device still fails, the device's own credentials are usually stale - tear it down and bring it up again under a new id:
btk3s btpy device teardown -d dev-01 --yes
btk3s btpy device up -d dev-02 -g <tier-2 group> -m 'dtmi:jemac;4.4' --tier 2 --telemetry-format jemac
Telemetry does not arrive
btpy device verify prints one row per channel and then a verdict. Read the
rows: they carry the timestamp of what actually landed.
btk3s btpy device verify -d my-first-device --telemetry-format jemac
btk3s doctor # the Assets section: values held, and how fresh
- Some channels arrive and others never do. The asset's channels are not
all bound.
btk3s repairbinds them; doctor's Assets section lists which are missing by name. - Nothing arrives at all. The payload's keys have to be telemetry channels on the asset's model - a key that is not on the model is accepted by the broker and dropped without a trace.
Something only works after a second up
Credentials that drifted apart, almost always. btk3s doctor finds them, and
its Credential section names the pair that disagrees.
Reading logs
btk3s shell -c 'kubectl -n btk3s get pods | grep -v Running | grep -v Completed'
btk3s shell -c 'kubectl -n btk3s logs deploy/onboarding --since=10m'
beacontower-dagster and provider-iothub do not run locally, and
btk3s init excludes them. A btk3s.yaml written by an init older than
v0.5.1 does not; add the two lines yourself and run btk3s up:
exclude:
- beacontower-dagster
- provider-iothub
Starting over
btk3s down # the tenant; the environment layer and Azure stay
btk3s up # about 20 minutes
Do not run up over a teardown that failed partway: it refuses a namespace
that is still Terminating. Wait for it to go.
btk3s cloud destroy removes the Azure side as well, and asks first.
Reporting it
btk3s bug -t "up stops at the env layer"
Run it in the directory with your btk3s.yaml. It writes
btk3s-bug-<time>.md there: your machine, btk3s.yaml, a full doctor run, the
cluster's state and the latest up, cloud and down logs. Passwords, keys,
tokens and connection strings are removed first. Read it before you send it
all the same.
Email the file to your BeaconTower contact, or open the link it prints, say
what you ran and what happened, and attach the file. The link needs a GitHub
account. Name the area when it is not btk3s itself: btk3s bug btpy, shell,
provider or flows.
up, cloud and down keep their output in ~/.local/state/btk3s/logs/,
the newest twenty runs. btk3s bug needs btk3s v0.6.4 or later.