ChargeLink Native

Monitoring, JSON and Exit Codes

Use --json for every automated call. Diagnostics use structured envelopes and a defined exit-code policy so that scripts and monitoring never have to parse console text.

Result envelope

On success the payload is printed with "ok": true, "exit_code": 0 and "contract": "native-core-0.55" added. On failure a single diagnostic envelope is printed on stdout:

{
  "product": "ChargeLink",
  "cli": "chargelink",
  "contract": "native-core-0.55",
  "ok": false,
  "status": "error",
  "exit_code": 20,
  "command": ["...\\chargelink.exe", "--json", "license", "verify", "--file", "C:/ChargeLinkData/licenses/missing.cllic"],
  "error": {
    "code": "CL-LICENSE-001",
    "category": "licensing",
    "kind": "license",
    "message": "license error: license I/O error: The system cannot find the file specified. (os error 2)",
    "retryable": false,
    "operator_action": "Supply a valid ChargeLink license file or activation package."
  }
}

Without --json, stderr receives [CODE] message (exit_code=N, category=..., action=...). Customer output never contains stack traces. Print the policy with chargelink --json diagnostics exit-codes and chargelink --json diagnostics error-taxonomy; produce a sample envelope for parser tests with chargelink --json diagnostics sample-error --kind runtime.

Exit codes and error codes

ExitCodeCategoryRetryableOperator action
0—success
2CL-USAGE-001usage (including clap parse errors)noCheck command syntax with --help and retry.
10CL-CONFIG-001configurationnoInspect configuration, paths and environment settings.
20CL-LICENSE-001licensingnoSupply a valid license file or activation package.
30CL-PROFILE-001profilenoValidate the selected profile or choose a built-in profile.
40CL-RUNTIME-001runtimeyesInspect runtime state, run ID, lock files and session lifecycle.
50CL-ARTIFACT-001artifactnoInspect the artifact root and ensure the run generated artifacts.
60CL-CONTRACT-001contractnoRefresh contract fixtures.
70CL-UNSUPPORTED-001unsupportednoThe command is accepted by the parser but has no implementation in the installed version.
80CL-IO-001ioyesCheck filesystem permissions, path length and removable or network media.
81CL-SERIALIZATION-001serializationnoCheck JSON/YAML syntax and schema compatibility.
90CL-INTERNAL-001internalnoCollect a support bundle and report the defect.

Exit code 70 is also returned when the worker thread cannot start; the message then carries CL-INTERNAL-001. Treat any non-zero exit with retryable: true as transient and everything else as a stop condition in automation.

Runtime health fields

runtime list, runtime inspect, evse status and evcc status return a health object:

FieldValuesMonitor
statusdry_run_validated, starting, running, stop_requested, stopped, failed, recovered_stalealert on failed
process_statelive, not_live_mode, missingalert when a running session's process is missing
heartbeat_age_ms, stale_after_ms, stale, stale_reasonms; 300000; boolalert when age approaches the stale limit while running
active_role_lock, session_lockactive_role_lock_matches, missing, ...; presentlock mismatch indicates a stale or foreign session
recoverable, operator_actionbool; textuse the text in alerts

gRPC health

HealthService.GetHealth reports SERVING, STARTING, DEGRADED or STOPPING with uptime; WatchHealth streams changes. From the CLI: chargelink --json integration health --endpoint http://127.0.0.1:50051 returns health_status, api_version, product_version and uptime_ms. System signals in the dictionary (System.HealthState, System.CpuUsagePct, System.MemoryBytes, System.DroppedEvents) and Fault.ActiveCount / Fault.LastFault can be polled or subscribed through SignalService.

What to monitor in production

  • Service health: gRPC serving state; on the VeriStand bench, the owner host's Operator.* status channels and heartbeat.
  • Session lifecycle: running sessions, heartbeat age, stop requests, stale locks.
  • Artifact write failures: CL-IO-001 / CL-ARTIFACT-001, free space on the artifact volume, integrity results.
  • Clock: NTP synchronisation (TLS validity, evidence timestamps).
  • Safety on plant-coupled benches: Safety.FaultActive, Runtime.CommandAgeActual_ms, Operator.LastErrorCode.
  • Certificate validity dates of the SECC and vehicle material.
  • License state (license status) after upgrades and machine changes.

Logging

The CLI writes info-level tracing to stderr; there is no log-level switch or log file option. Redirect stderr in your supervisor if you need a log, and rely on the JSON results and the artifact traces for diagnosis. On the VeriStand bench, every session writes its logs and evidence into its run folder under runs_root.