ansible-prometheus icon indicating copy to clipboard operation
ansible-prometheus copied to clipboard

Cannot start prometheus if prometheus_db_dir is under /home

Open saez0pub opened this issue 4 years ago • 0 comments

What happened?

Using prometheus_db_dir: /home/foo

prometheus cannot start with this error:

level=error ts=2021-02-23T09:29:09.099Z caller=query_logger.go:87 component=activeQueryTracker msg="Error opening query log file" file=/home/foo/queries.active err="open /home/foo/queries.active: permission denied"

Did you expect to see some different?

Prometheus starting

How to reproduce it (as minimally and precisely as possible):

playbook

---
- hosts: prometheus
  become: true
  roles:
    - role: ansible-prometheus
      prometheus_db_dir: /home/foo

Environment

  • Role version:

    1597922c07471c3da77e8e2879094f52f8de129b (master)

  • Ansible version information:

    ansible 2.10.6

  • Variables:

prometheus_db_dir: /home/foo

Anything else we need to know?:

This is because the usage of PrivateDevices=true in the systemd service file. A workaround should be using read-only if prometheus_db_dir is under /home

saez0pub avatar Feb 23 '21 10:02 saez0pub