CLI command
probierz intake serve
Listen for authenticated `wisent-errors` failure envelopes from desktop applications.
Invocation#
probierz intake serve --bind <BIND>Required inputs and options#
- `--bind HOST:PORT` selects the listener. No address is assumed: the `com.wisent.compute.service.probierz` declaration in Stado's product catalogue names the one the host uses. Missing it exits 2.
- Bearer authentication comes from `PROBIERZ_INTAKE_TOKEN` when it is set, otherwise from `~/.probierz/intake-token`.
Output and state effects#
Starts the intake HTTP service and persists accepted failure envelopes in the configured failure store until the process stops. It creates `~/.probierz` owner-only when it is not there, whether the token comes from the variable or the file. Once bound it writes the address it listens on (`http://<HOST:PORT>`) to `~/.probierz/intake-url` beside the token, so a desktop app's wisent-errors reporter finds the intake where the service declaration placed it instead of assuming a port. It is the host's one Probierz process, declared as `com.wisent.compute.service.probierz`, and needs no harness directory: launchd may start it anywhere. Started by launchd as that unit, it first boots out the Node intake `com.wisent.probierz-intake`, waits for that process to exit within the exit grace launchd gives a job, and removes its launch agent, so the port is free and no login loads the old copy again; run by hand it retires nothing. `probierz failures` likewise reads the store without a harness.
Exact refusals#
- Missing `--bind` or a missing value is refused by the parser with exit 2.
- A value without `host:port`: `--bind needs host:port, got "<VALUE>"`; a port that is zero or above 65535: `--bind port out of range: <PORT> (<CAUSE>)`.
- A port another process still holds ends the start with the retryable failure `intake.listen` `could not bind <HOST:PORT>: Address already in use` and exit status 75; launchd starts the unit again.
- `PROBIERZ_INTAKE_TOKEN` set but empty is refused at `intake.token` with `PROBIERZ_INTAKE_TOKEN is set but empty; set it to the token clients send, or unset it to use the token file`, and one that is not text with `PROBIERZ_INTAKE_TOKEN is not text, so no client could send it`.
- Without `PROBIERZ_INTAKE_TOKEN`, a missing or empty `~/.probierz/intake-token` is replaced by a new token; one that exists and cannot be read is refused at `intake.token` with `cannot read the intake token <PATH>, so it is not replaced: <CAUSE>`, so clients paired with it are not cut off.
- A `~/.probierz` that cannot be created ends the start at `intake.directory`: `<PATH> could not be created, so the intake has nowhere to keep its token and address: <CAUSE>`; an address file that cannot be written ends it at `intake.address`: `<PATH> could not be written, so no client can find this intake: <CAUSE>`.
- The intake service refuses requests that fail its bearer and envelope validation contracts. A request line that is not `METHOD TARGET VERSION`, a header line that is not `NAME: VALUE`, and a connection that closes inside the headers are answered 400 naming which. A POST that declares no Content-Length is answered 400 `the request declares no Content-Length, so its body cannot be read whole`, one whose length is not a byte count `Content-Length "<VALUE>" is not a byte count: <CAUSE>`, a body shorter than its declared length `the body ended after <READ> of the <DECLARED> bytes its Content-Length declares`, and a body that does not parse `body is not valid JSON: <CAUSE>` — none is read as an empty body.
Source snapshot#
Generated from the Rust binaries at https://github.com/wisent-ai/probierz.git revision `f65b755da397f2ec7435eb80ed722aa6017437c1`.
Combined help SHA-256: `4a12655d233812abc29eeebbf3db3065efe3e00288024383f3eef3970d092e94`; binary SHA-256: `d5398832d3ab52c541b1efe979730dea62941ac6197898a20fccfc5d3fca44df`.