Warning File at /var/lib/mongodb defined in mongodb_dir parameter doesn't exist or is unreadable

Hi there,
I’m facing a warning message with all of my smart-proxies, every single one of them has the warning message :

file at /var/lib/mongodb defined in mongodb_dir parameter doesn’t exist or is unreadable

This message shows up in the logs regularly, every 12 hours.
It appears more often if you visit the smart proxy “overview” page.
This is the relevant logs in debug

2020-03-25T16:49:07 469f364d [D] verifying remote client against trusted_hosts ["master-repo.cplus", "lum-repo.cplus"]
2020-03-25T16:49:07 469f364d [W] File at /var/lib/mongodb defined in mongodb_dir parameter doesn't exist or is unreadable
2020-03-25T16:49:07 469f364d [D] [/usr/bin/df] ["Filesystem                  1024-blocks    Used Available Capacity Mounted on", "/dev/mapper/vg_repo-lv_repo   209612800 5449944 204162856       3% /var/lib", "/dev/mapper/vg_repo-lv_repo   209612800 5449944 204162856       3% /var/lib"]
2020-03-25T16:49:07 469f364d [I] Finished GET /pulpnode/status/disk_usage with 200 (10.38 ms)

My /var/lib/mongodb folder has the mongodb:mongodb permissions set accordingly to what’s said in the following documentation, as this error is reported in this KB : https://access.redhat.com/solutions/4009871

Expected outcome:
No warning in the logs

Foreman and Proxy versions:
Foreman 1.24 + Katello 1.24
Proxy 1.24

Distribution and version:
CentOS Linux release 7.7.1908


The smart proxy overview page has a tab Pulp which shows the disk usage. This indeed does look at the space used on /var/lib/mongodb. AFAIK this is only for humans to consume and as long as you have a real monitoring system that checks its disk space, I wouldn’t worry about it.

If you want to silence this, you can set the path via the installer --foreman-proxy-plugin-pulp-mongodb-dir and it’ll check that directory instead.

Thanks for your reply
I don’t understand why the warning is triggered then, “–foreman-proxy-plugin-pulp-mongodb-dir” point to /var/lib/mongodb in my installation. Why is it saying that the file is unreadable ?


I suspect the user foreman-proxy has no permission to /var/lib/mongodb

1 Like

Indeed, out of curiosity, I tried a

setfacl -m u:foreman-proxy:r /var/lib/mongodb

Fixes the issue, I didn’t think about the foreman-proxy user.
Thank you again for your replies