nmproxy#
The command line, configuration file and log output of the relay that proxy mode sends to.
Command line#
nmproxy -config <path to nmproxy.yaml>
nmproxy -version
-config is required to run the relay. -version prints the relay’s release and the frame
protocol version it uses, such as nmproxy 0.1.0, frame protocol version 1, and exits. A
relay built with a plain go build reports its release as dev.
nmproxy runs until it gets Ctrl+C or SIGTERM. It then sends the rows it still holds to
Nominal, sets the end of each run whose execution is still sending, logs a shutting down line
with totals, and exits.
Configuration file#
The file is YAML. A key the relay doesn’t know stops it at startup. Each release’s archive has
nmproxy.example.yaml, which describes every key.
listenDefault
"0.0.0.0:15400". The UDP address and port to receive packets on, ashost:port.0.0.0.0accepts packets on every network interface, and127.0.0.1only from the same computer.profileDefault
"default". The profile in Nominal’s config file to read the API key and the instance’s REST API base URL from, as itstokenandbase_url. Runs go in the profile’sworkspace_rid, or in the organization’s default workspace when it has none. It is the same file the block reads in direct mode, and Nominal’s other clients too. API keys setup shows what the file holds.profile_fileDefault
"", the standard location in the home folder of the account running the relay:~/.config/nominal/config.yml, or%USERPROFILE%\.config\nominal\config.ymlon Windows. The path of the config file to readprofilefrom, when it is somewhere else.allowed_datasetsDefault empty. The RIDs of the datasets the relay may write to. Data for any other dataset is dropped. When the list is empty the relay writes to any dataset the API key can, and warns at startup.
idle_timeoutDefault
5m. How long a block can go quiet, as it does once its run ends, before the relay forgets its channel list. The relay’s stream to a dataset stays open while it remembers any channel list for that dataset, so executions that follow each other within this time share one connection. A Go duration such as30sor10m, greater than zero. Leave the key out to use the default.stats_intervalDefault
30s. How often to log a stats line.0turns it off, and a negative value stops the relay at startup.log_levelDefault
info. One ofdebug,info,warnorerror. In a dry run,debuglogs every row.dry_runDefault
false. Whentrue, the relay decodes and logs what arrives, and the runs it would make, without writing anything to Nominal. It then reads no profile and needs noallowed_datasets.
A complete file:
listen: "0.0.0.0:15400"
profile: "default"
profile_file: ""
allowed_datasets:
- "<dataset RID>"
idle_timeout: 5m
stats_interval: 30s
log_level: "info"
dry_run: false
Errors that stop the relay#
Each error is printed as nmproxy: <message>. All but the two receive failed errors happen at
startup.
Message |
Cause |
|---|---|
|
The file named by |
|
The file isn’t valid YAML, or has a key the relay doesn’t know. |
|
|
|
|
|
|
|
There is no config file at |
|
The config file isn’t valid YAML. |
|
The file has profiles, but not that one. Profile names are case-sensitive. |
|
The profile has no |
|
The profile has no |
|
|
|
|
|
|
|
|
|
|
|
The address can’t be used, for example because another program has the port. |
|
The relay’s UDP socket failed every read while it ran. |
|
The relay’s UDP socket closed while it ran. |
Startup warnings#
allowed_datasets is empty, so any sender that can reach the listening port can write to any dataset the API key can. List your dataset RIDs under allowed_datasets.The message says what to do.
<file> holds an API key and other accounts have access to it (mode <mode>). Run chmod 600 on it.About Nominal’s config file. Linux and macOS only.
could not enlarge the receive buffer, so the operating system may drop bursts of framesPackets arriving in bursts may be lost before the relay reads them, and show up as
gaps.
Log#
The relay logs one line per event to standard error, as key=value pairs:
time=<time> level=INFO msg=<message> <fields>
Stats#
Every stats_interval, the relay logs a stats line:
time=<time> level=INFO msg=stats configs=1 sessions=1 rows=30000 gaps=0 reorders=0 unknown_config=0 bad_frames=0 wrong_version=0 write_errors=0
configs and sessions are current counts. The rest count what happened since the previous
stats line.
Field |
Counts |
|---|---|
|
Channel lists the relay has registered, one per dataset, list of channel names and set of tags. |
|
Executions of a model the relay is tracking. |
|
Rows received. |
|
Packets that were missing when a later packet arrived. |
|
Packets that arrived after a later one, or twice. A late packet was already counted in |
|
Packets of data for a channel list the relay hasn’t registered. Expected for up to a second after the relay starts, until the block repeats its channel list. They also come from a block whose dataset the relay refused. |
|
Packets that aren’t valid frames or couldn’t be read, channel lists whose |
|
Packets from a sender using another version of the frame protocol. |
|
Writes to Nominal that failed, and channel lists the relay couldn’t open a stream for. A failure in the last batch a stream sends as it closes isn’t counted. |
The shutting down line reports rows, gaps, reorders, bad_frames, wrong_version,
refused and write_errors as totals for the whole run. refused counts channel lists for
datasets that aren’t in allowed_datasets.
Other messages#
Message |
Level |
Meaning |
|---|---|---|
|
INFO |
The relay started, with its address. |
|
INFO |
The relay will write with the API key in |
|
INFO |
|
|
INFO |
A block started sending a new channel list, with its dataset and number of channels. |
|
INFO |
The relay opened a stream to the dataset. Every channel list for the dataset shares it. |
|
INFO |
In a dry run, a channel list started, with its dataset, number of channels and tags. |
|
INFO |
The relay replaced its stream to the dataset with a fresh one, because the old one had been used by 16384 channel and tag pairs, which is how many a long campaign of executions adds up to. The old stream sends its last rows in the background. |
|
INFO |
An execution of a model started sending. |
|
INFO |
An execution stopped and sent END, with its totals. Logged once, though the block sends END three times. |
|
INFO |
The relay created the run an execution asked for, with its RID and title. |
|
INFO |
The relay found the run an execution asked for instead of creating it: a run shared with other executions, or an execution’s own run made before the relay restarted. |
|
INFO |
The relay set the end of an execution’s run. |
|
INFO |
In a dry run, the run an execution asked for. |
|
INFO |
In a dry run, the end the relay would set. |
|
WARN |
Creating or finding the run failed, and the error says why: |
|
WARN |
Setting the run’s end failed, and the error says why. The run exists, with no end time, and its end can be set in the Nominal app. |
|
INFO |
Data arrived for a channel list the relay hasn’t registered. Logged once. |
|
WARN |
A block is sending to a dataset that isn’t listed. Logged once for each refused dataset, for up to 100 datasets. |
|
WARN |
The blockset and the relay come from different releases. Logged on the first such packet and every 1000th after. |
|
WARN |
A sender computes |
|
WARN |
A data packet has a different number of channels than its channel list. |
|
WARN |
Reading a packet failed. Logged on the first of a run of failures, which count as |
|
ERROR |
The relay couldn’t start writing to the dataset, for example because its RID is malformed. The error says why. |
|
ERROR |
Writing to Nominal failed, with the dataset and the error. Logged on a stream’s first failure and every 100th after. |
|
WARN |
A stream closed after some of its writes failed, with the number of failures and the last error. |
|
INFO |
A stream closed with no write failures reported. |
|
INFO |
An execution sent nothing for |
|
INFO |
A channel list went unheard for |
|
ERROR |
Sending the last rows of an idle stream failed. |
|
ERROR |
After |
|
ERROR |
At shutdown, sending a stream’s last rows failed. |
|
INFO |
The relay is exiting, with totals. |