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

Panic occurs for using Unix sockets #62

Open
lamchakchan opened this issue Oct 30, 2023 · 3 comments
Open

Panic occurs for using Unix sockets #62

lamchakchan opened this issue Oct 30, 2023 · 3 comments

Comments

@lamchakchan
Copy link

Description

When trying unix socket for the remote-control interface, the exporter has no way to be configured to input the unix socket address without a panic. Looks the the use of Parse() from net/url fails to recognize the scheme for a target of unix:///var/run/unbound/control.sock.

Unbound Configuration

server:
    ...
remote-control:
    control-enable: yes
    control-use-cert: no
    control-interface: "/var/run/unbound/control.sock"

Command

unbound-exporter -unbound.host unix:///var/run/unbound/control.sock

Error

level=info ts=2023-10-30T21:31:55.062Z caller=unbound_exporter.go:509 Startingunbound_exporter=(MISSING)
panic: open /etc/unbound/unbound_server.pem: no such file or directory

goroutine 1 [running]:
main.main()
@jpds
Copy link
Contributor

jpds commented Oct 31, 2023

@lamchakchan You need to disable the default TLS options - otherwise it tries to find those and then tries to securely connect to the socket: https://github.com/letsencrypt/unbound_exporter/blob/main/unbound_exporter.go#L398

@lamchakchan
Copy link
Author

Does this mean I need to call unbound-exporter like this?

unbound-exporter -unbound.host unix:///var/run/unbound/control.sock -unbound.ca="" -unbound.key="" -unbound.cert=""

@lamchakchan
Copy link
Author

Shouldn't this bypass the loading of the certs?

I'm confused on why u.Scheme == "unix" condition isn't triggering. Do I need to pass a different socket path format to -unbound.host

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