Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Diagnostics & Errors

Hydra reports problems in three ways: exit codes (CLI process status), structured diagnostics (machine-readable JSON lines on stderr), and warnings (non-fatal issues recorded during a run). This page catalogues each.

Scope. The structured diagnostics below are emitted by the simulation command (hydra <input>). The hydra report subcommand shares the same exit codes but writes plain error: … text to stderr rather than JSON lines, so do not parse its stderr as diagnostics.


Exit codes (CLI)

CodeMeaning
0Simulation completed (the report may still contain warnings)
1Input error — bad arguments, bad .inp file, missing input, HTTP 4xx, or a network validation failure
2Solver error — hydraulics or quality did not converge
3I/O error — write failed, permission denied, HTTP 5xx, or network failure
4Internal error — unexpected engine state; please report a bug

Codes 04 are a stable contract. Note that network validation failures are input errors (exit 1), not solver errors.


Structured diagnostics (stderr)

Independently of the report, the CLI writes each warning and error to stderr as one compact JSON object per line. This stream is always emitted — it is not suppressed by -q/--quiet (which only silences the human-readable progress output).

Each line has five keys:

KeyTypeNotes
levelstring"warning" or "error"
codestringA stable slug, e.g. warning/negative_pressure (see tables below)
messagestringHuman-readable description
object_idstring or nullThe affected node/link ID, when applicable
time_stepnumber or nullSimulation time (seconds) of the event; set only on warnings

Example:

{"level":"warning","code":"warning/negative_pressure","message":"negative pressure at node 'J1'","object_id":"J1","time_step":3600.0}
{"level":"error","code":"solver/hydraulic","message":"...","object_id":null,"time_step":null}

Diagnostic codes

Warnings (non-fatal; the run continues):

CodeRaised when
warning/unbalancedA hydraulic step did not converge within the trial limit
warning/negative_pressureA node had negative pressure at a reporting step
warning/pump_xheadA pump was driven beyond the maximum head on its curve

Errors (fatal; the run stops):

CodeMeaningExit code
io/fetchFailed to read the input file or URL1 (4xx / not found) or 3 (5xx / network)
input/formatUnrecognised input file format1
input/engineThe file is a sound .inp model, but another engine’s — see Foreign .inp dialects1
input/parse.inp parse error (bad field, duplicate ID, syntax at a line)1
validation/networkNetwork validation failed (one line per violation)1
solver/hydraulicThe hydraulic solver failed2
solver/qualityThe quality engine failed2
io/outputFailed to write the .out file3
io/reportFailed to write the report3
session/errorOther session error (unknown ID, invalid phase, no snapshot at time)1
internalUnexpected internal state4

Warnings

Warnings are recorded during a run and surfaced in three places: the stderr diagnostics above, the warnings array of the JSON report, and the Warnings section of the text report. There are three kinds:

  • Unbalanced hydraulics — a step did not converge. Often points to an over-constrained or disconnected model; see Troubleshooting.
  • Negative pressure — a node’s pressure went below zero, indicating demand that the network could not supply at that point (consider PDA).
  • Pump exceeds maximum head — a pump operated past the top of its curve; check the curve and the operating point.

Validation errors

Before a simulation runs, Hydra validates the network and reports all structural problems it finds (not just the first). Each is emitted under the validation/network diagnostic code. The checks cover:

CategoryExamples
ConnectivityLink references an unknown end node; link connects a node to itself; a junction or tank is not reachable from any fixed-grade source; the network has no reservoir or tank
ReferencesAn element references a pattern, curve, or node/link that does not exist, or a curve of the wrong kind; a pump/GPV/PCV is missing its required curve
CurvesPump head curve not strictly decreasing; efficiency y-values outside (0, 100]; tank volume curve not strictly increasing; GPV head-loss curve decreasing; curve x-values not strictly increasing; too few points
TanksInitial level outside the [min, max] range
PatternsPattern has no factors
Controls & rulesA simple control or rule action references a link (or a rule premise references a node/link) that does not exist

The Issues panel in the GUI surfaces these findings with links to the affected elements.