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

--postfix.logfile_path="/var/log/mail" produces panic: runtime error: invalid memory address or nil pointer dereference #67

Open
jsutch opened this issue Oct 5, 2020 · 1 comment

Comments

@jsutch
Copy link

jsutch commented Oct 5, 2020

This appears to be similar to #54

logs are stored in /var/log/mail instead of /var/log/maillog, passing new logdir crashes on startup.

build@mail:~/INSTALL/postfix_exporter# ./postfix_exporter --postfix.logfile_path="/var/log/mail"
2020/10/05 00:09:24 Reading log events from /var/log/mail
2020/10/05 00:09:24 Listening on :9154
2020/10/05 00:09:24 Seeked /var/log/mail - &{Offset:0 Whence:2}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x832089]

goroutine 8 [running]:
main.(*PostfixExporter).CollectLogfileFromFile(0xc00016a000, 0x9e5740, 0xc000066700)
/postfix_exporter/postfix_exporter.go:437 +0x149
main.(*PostfixExporter).StartMetricCollection(0xc00016a000, 0x9e5740, 0xc000066700)
/postfix_exporter/postfix_exporter.go:671 +0xfd
created by main.main
/postfix_exporter/main.go:69 +0xecb

@ghostiam
Copy link

I had the same problem. I already studied the code and thought that the problem is in the tail library, until I realized that there is an error in the readme, and tail cannot open the directory.

Use:
--postfix.logfile_path=/var/log/mail/mail.log

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