-
-
Notifications
You must be signed in to change notification settings - Fork 171
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
Unable to open file /var/log/nginx/access.log: open /var/log/nginx/access.log: permission denied #354
Comments
This looks like a straightforward permissions error; which user owns the access log file (and what are the file's permissions), and under which user does the exporter run? Does it work when you're removing the |
@martin-helmich I just ran into the same issue. The prometheus-nginxlog-exporter service was running fine for it's first 24 hours, all of the sudden Nginx rolled the files and created a new main log file and the prometheus-nginxlog-exporter stopped because the file could not be accessed, permissions denied... I've tried your solution of removing
|
If you use k8s to deploy this exporter, one possible solution is to run the exporter container as the nginx log files owner by applying security context: |
@dirkvranckaert, I also end up with removing this directive.
@martin-helmich, can you share original reason why this directive was added to the systemd unit? Has anybody confirmed this exporter working with this directory left in the systemd unit? |
I had the same issue on Debian 12 Bookworm. The file Personally, I added the existing user [Service]
User=prometheus
# CapabilityBoundingSet= I think this should be the default behaviour of the Debian package provided, hence I am posting this here (which I previously posted on the discussions section) |
whuy i recieve fail state in start service?
$ systemctl start prometheus-nginxlog-exporter
The log contains the following errors ($ journalctl -f)
...
Oct 11 01:36:18 xxxx.fvds.ru prometheus-nginxlog-exporter[2058796]: 2023-10-11T01:36:18.887+0300 fatal prometheus-nginxlog-exporter/main.go:213 Unable to open file /var/log/nginx/access.log: open /var/log/nginx/access.log: permission denied
....
Oct 11 01:36:19 xxxx.fvds.ru systemd[1]: prometheus-nginxlog-exporter.service: Main process exited, code=exited, status=1/FAILURE
Oct 11 01:36:19 xxxx.fvds.ru systemd[1]: prometheus-nginxlog-exporter.service: Failed with result 'exit-code'.
Oct 11 01:36:19 xxxx.fvds.ru systemd[1]: prometheus-nginxlog-exporter.service: Scheduled restart job, restart counter is at 5.
Oct 11 01:36:19 xxxx.fvds.ru systemd[1]: Stopped NGINX metrics exporter for Prometheus.
Oct 11 01:36:19 xxxx.fvds.ru systemd[1]: prometheus-nginxlog-exporter.service: Start request repeated too quickly.
Oct 11 01:36:19 xxxx.fvds.ru systemd[1]: prometheus-nginxlog-exporter.service: Failed with result 'exit-code'.
Oct 11 01:36:19 xxxx.fvds.ru systemd[1]: Failed to start NGINX metrics exporter for Prometheus.
Help me please!
The text was updated successfully, but these errors were encountered: