Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
991jo opened this issue Nov 29, 2022 · 1 comment
Open

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

991jo opened this issue Nov 29, 2022 · 1 comment
Milestone

Comments

@991jo
Copy link

991jo commented Nov 29, 2022

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
Copy link
Member

partim commented Nov 23, 2023

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.

@partim partim added this to the 0.3.0 milestone Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants