Recipe + friction log for running a locally built mando_bess binary as a HOST process against the mando-cli infra stack (postgres + wiremock + local-dd-agent). Assembled during the BE-3657 phase 3 local end-to-end verification (2026-07-23); the friction items are pre-existing repo issues, valuable for the whole team.
For Agents
The container path (full stack via
mando up) is Local Docker Setup. THIS note is the host-process variant: binary on the host, infra in containers. Use it when you need to run an unmerged branch binary (not built into an image) against real infra.
The shape
mando up --datadog -p infra # postgres + wiremock + local-dd-agent
cargo build --release # in your worktree
set -a; source mando-p3.env; set +a # env file lives OUTSIDE the repo (session scratchpad)
./target/release/mando_bess- Env assembled from
.cargo/config.toml.examplewith overrides; keep the env file out of the repo (scratchpad, e.g.mando-p3.env). - Infra postgres creds (transactional DB): db
bess_transactional_db, userpostgres, passwordpostgres,localhost:5432. MANDO_PORT=8081locally: wiremock owns 8080.- Point
VOLUE_EMS_*/METIS_*/ other adapter hosts atlocalhost:8080(wiremock) for hermetic 404 error generation. - Set
MANDO_ENVIRONMENT=dev-local-<user>: the embeddedddtagsenv wins over agent/envelope tags, see the epilogue.
Friction points (all field-verified 2026-07-23)
.cargo/config.toml.example is STALE
Env renames + a panic the example file does not know about
MANDO_FLOW_ACTIVE_VERSIONis DEAD. The config now wantsMANDO_SETUP_ACTIVE_VERSION(V1_4) +MANDO_SETUP_SCHEDULER_DISABLED(prefixMANDO_SETUP, config-crate style).FINGRID_API_KEYmust be NON-EMPTY: init panics via unwrap with “must contain at least one key”.
Postgres cert path is cwd-relative
The postgres cert loader reads <cwd>/certs/eu-central-1-bundle.pem. Running from a workspace root needs a certs symlink to mando-bess/certs. One was left in .worktrees/BE-3657-phase3 (untracked).
MIGRATION RACE: mando refinery vs mando-cli migrations container
Two writers apply the same migration set
In
DuckDbPostgresmode mando’s own refinery races the mando-cli migrations container applying the same set. Symptom: idle-in-transaction lock pileup wedging boot (move_schema_objectsblocked).Recovery:
pg_terminate_backendon the idle-in-transaction holder.- Wipe schemas: drop
public/data/bess_oscascade.- Relaunch with a single writer.
MANDO_MODE=DuckDbskips mando-side pg migrations entirely and relies on the (stale) container set, which LACKS the setting table. UseDuckDbPostgreslocally.
Datadog from a host process
The local dd agent tails ONLY mando-* containers (mando-cli-datadog-local-logs-2026-07-22), so a host process is invisible to it. Ship host-process error lines via DIRECT INTAKE to Datadog EU instead (the BE-3657 verification forwarded 12 lines under env:dev-local-levander service:bess-os-service-mando this way, after the ddtags rewrite below).
Epilogue (2026-07-23): the vanishing first forward
The first direct-intake forward of the mando error lines silently VANISHED despite 202-accepted responses.
- Root cause: Datadog’s JSON-message parsing PROMOTES the embedded
ddtagsfield from the log line itself. mando emitsddtagswithenv:local(fromMANDO_ENVIRONMENT=local), which overrode the intake envelope’senv:dev-local-levander; the org evidently does not indexenv:localevents at all, so accepted lines never appeared. - Fix that worked: rewrite the embedded
ddtagstoenv:dev-local-levanderbefore forwarding. - Isolation stake: the shared Alpiq org carries REAL
env:prodtelemetry under the sameservice:bess-os-service-mandoname; the per-developer env tag is the ONLY isolation from production views.
Durable recommendation
Local mando runs should set
MANDO_ENVIRONMENT=dev-local-<user>so the emittedddtagsalign with the local agent’s env tag. Embeddedddtagswin over host/env tags on JSON log lines, so even a containerized local mando would fight the agent’s tagging the same way (mando-cli-datadog-local-logs-2026-07-22).
Teardown
- Stack:
mando down. - Host process:
pkill mando_bess.
Related
- BE-3657 error_stack Adoption - the phase 3 local end-to-end verification this recipe was built for
- Local Docker Setup - the container-stack path
- mando-cli-datadog-local-logs-2026-07-22 - the
--datadoglocal log shipping this rides on - mando-cli - the CLI owning the infra stack
- Agent Context