NLnetLabs / rtrtr

An RPKI Data Proxy
https://nlnetlabs.nl/projects/routing/rtrtr/
BSD 3-Clause "New" or "Revised" License
30 stars 7 forks source link

Line numbers given for config errors are wrong/confusing #83

Open 991jo opened 1 year ago

991jo commented 1 year ago

I am running rtrtr v0.2.2 on Debian 11.

I have a small config file with an "invalid IP address" for the http-listen directive, that uses a domain instead of an address:

log_level = "debug"
log_target = "stderr"
log_facility = "daemon"
log_file = "/var/log/rtrtr.log"

http-listen = ["localhost:8080"]

# JSON UNIT

[units.rpki-client]
type = "json"
uri = "file:///var/lib/rpki-client/json"
refresh = 60

# RTR TARGET

[targets.default]
type = "rtr"
listen = [ "127.0.0.1:9001"]
unit = "rpki-client"

When I execute it, rtrtr says:

root@rpki-1:~# rtrtr -v --config minimal.conf
/root/minimal.conf: invalid IP address syntax at line 17 column 1

However line 17 is not the http-listen directive, it is the targets.default block which leads a user to believe that the IP address in the listen directive in the target is invalid. I would have expected something like invalid IP address syntax at line 6 where the actual wrong directive is.

partim commented 10 months ago

Thank you for the report and apologies for the embarrassingly late response.

Unfortunately, these line numbers are generated in an underlying library and not easily fixable. I switched to a newer version but now it just says “line 1 column 1” all the time.

So we will need to redo the configuration parsing as part of the next release.