prometheus.promtool cannot write debug file

Bug #1896274 reported by Joseph Borg
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
prometheus-snap
Confirmed
Medium
Unassigned

Bug Description

ubuntu@ip-172-31-91-40:~$ prometheus.promtool debug metrics localhost
error completing debug command: error creating a new archiver: error creating archive "debug.tar.gz": open debug.tar.gz: permission denied

ubuntu@ip-172-31-91-40:~$ sudo prometheus.promtool debug metrics localhost
error completing debug command: error creating a new archiver: error creating archive "debug.tar.gz": open debug.tar.gz: permission denied

I guess this needs the home plug.

James Simpson (jsimpso)
Changed in prometheus-snap:
status: New → Confirmed
Revision history for this message
James Simpson (jsimpso) wrote :

The home plug was added at some point after this bug was raised, but we're now seeing a different issue:

jsimpso@kif:~$ promtool debug metrics http://127.0.0.1:9103
collecting: http://127.0.0.1:9103/metrics
Compiling debug information complete, all files written in "debug.tar.gz".

jsimpso@kif:~$ promtool debug metrics http://localhost:9103
collecting: http://localhost:9103/metrics
error completing debug command: error executing HTTP request: Get "http://localhost:9103/metrics": dial tcp: lookup localhost on [::1]:53: read udp [::1]:48376->[::1]:53: read: connection refused

= AppArmor =
Time: Aug 23 11:46:41
Log: apparmor="DENIED" operation="open" profile="snap.prometheus.promtool" name="/run/systemd/resolve/stub-resolv.conf" pid=2183338 comm="promtool" requested_mask="r" denied_mask="r" fsuid=1000 ouid=101
File: /run/systemd/resolve/stub-resolv.conf (read)
Suggestions:
* adjust program to use $SNAP_DATA
* adjust program to use /run/shm/snap.$SNAP_NAME.*
* adjust program to use /run/snap.$SNAP_NAME.*
* adjust snap to use snap layouts (https://forum.snapcraft.io/t/snap-layouts/7207)
* add one of 'firewall-control, fwupd, network, network-bind, network-control, network-observe' to 'plugs'

= AppArmor =
Time: Aug 23 11:46:41
Log: apparmor="DENIED" operation="open" profile="snap.prometheus.promtool" name="/etc/hosts" pid=2183338 comm="promtool" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
File: /etc/hosts (read)
Suggestions:
* adjust program to read necessary files from $SNAP, $SNAP_DATA, $SNAP_COMMON, $SNAP_USER_DATA or $SNAP_USER_COMMON
* adjust snap to use snap layouts (https://forum.snapcraft.io/t/snap-layouts/7207)
* add 'system-files (see https://forum.snapcraft.io/t/the-system-files-interface for acceptance criteria)' to 'plugs'

Changed in prometheus-snap:
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.