NLnetLabs / rotonda

Modular, programmable BGP Engine
https://nlnetlabs.nl/projects/routing/rotonda/
Mozilla Public License 2.0
41 stars 1 forks source link

Config file syntax error reporting is broken. #68

Open ximon18 opened 11 months ago

ximon18 commented 11 months ago
$ cargo run -- --config etc/rotonda.conf
/home/ximon/src/rotonda/etc/rotonda.conf: TOML parse error at line 13, column 1
   |
13 | [targets.mqtt]
   | ^^^^^^^^^^^^^^
invalid digit found in string

???

It is expected that the sample config file doesn't work as it contains placeholders that the operator should fill in or comment out the whole unit/target. In this case the relevant part is:

[targets.mqtt]
type = "mqtt-out"
sources = ["bmp-in", "bgp-in", "rib-in-pre", "rib-in-post"]
client_id = "rotonda"                          # Tip: edit me
topic_template = "{id}"                        # Tip: edit me
destination = "SOME_IP_ADDRESS:SOME_PORT"      # Tip: edit me, or comment this target out

The error is actual caused by the "SOME_IP_ADDRESS:SOME_PORT" value, if you replace that with "127.0.0.1:12345" then the error goes away.

But:

  1. That is not on line number 13 as reported.
  2. The issue is not with the line "[target.mqtt]" as reported.
  3. How is it ever invalid to have a digit in a string? That is a very confusing message.