stork-agent bind exporter frequently errors on named cwd detection
Describe the bug
We have added the stork-agent to standard ISC bind containers (internetsystemsconsortium/bind9:9.18
) and run them side by side with the named process. While testing we found that every 10 seconds following error messages get created (where 8 is the named pid):
time="2022-07-04 06:56:31" level="warning" msg="Cannot get process current working directory: readlink /proc/8/cwd: permission denied" file=" monitor.go:213 "
time="2022-07-04 06:56:41" level="warning" msg="Cannot get process current working directory: readlink /proc/8/cwd: permission denied" file=" monitor.go:213 "
time="2022-07-04 06:56:51" level="warning" msg="Cannot get process current working directory: readlink /proc/8/cwd: permission denied" file=" monitor.go:213 "
time="2022-07-04 06:57:01" level="warning" msg="Cannot get process current working directory: readlink /proc/8/cwd: permission denied" file=" monitor.go:213 "
time="2022-07-04 06:57:11" level="warning" msg="Cannot get process current working directory: readlink /proc/8/cwd: permission denied" file=" monitor.go:213 "
time="2022-07-04 06:57:21" level="warning" msg="Cannot get process current working directory: readlink /proc/8/cwd: permission denied" file=" monitor.go:213 "
Expected behavior
No error message gets logged.
Additional Information
There is a bug for the same error message in issue #274 (closed) - unfortunately the solution setting CAP_SYS_PTRACE does not work on unprivileged docker containers. cwd is not readable unless starting the container privileged (and cap_sys_ptrace is not working on unprivileged containers either).
Environment:
- BIND9 version: 9.18.4-1+ubuntu22.04.1+isc+1
- Stork: 1.4.0
- OS: Ubuntu 22.04 LTS (docker container
internetsystemsconsortium/bind9:9.18
)