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


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

1 Like

@ekohl Sorry for resurrecting this solved thread, but a customer of ours is experiencing this issue, while our internal test deployments point at /var/lib/pulp instead of /var/lib/mongodb and so do not have the issue. As far as I can tell we are not actively using the --foreman-proxy-plugin-pulp-mongodb-dir parameter. Do you know if the default value might have changed between foreman-installer versions?

What is the rational of checking /var/lib/mongodb vs. /var/lib/pulp? Is there a way to change the path post installation other than rerunning the foreman-installer with the parameter you posted?

Our customer reports they “fix” this issue by changing the permissions of /var/lib/mongodb (which does not strike me as a good solution to begin with) and then complain that foreman-installer keeps changing the permissions back.

Is the setfacl command by @loitho a better solution? (I don’t know if SELinux is used on the relevant system).