puppetlabs / puppetlabs-lvm

Puppet Module to manage LVM
https://forge.puppetlabs.com/puppetlabs/lvm
GNU General Public License v2.0
124 stars 275 forks source link

Custom facts causing errors on Windows and AWS RHEL7 servers #314

Closed viko885 closed 1 year ago

viko885 commented 1 year ago

Describe the Bug

Two kinds of errors appear during puppet execution. In both cases LVM module is not referenced in the manifest for the server where the error occurs.

On Windows:

Unable to add resolve nil for fact lvm_vgs: Could not execute 'vgs -o name --noheadings 2>/dev/null': command not found
Unable to add resolve nil for fact lvm_pvs: Could not execute 'pvs -o name --noheadings 2>/dev/null': command not found

On Linux: Error: Facter: error while resolving custom facts in /var/rnd_puppet_agent/lib/facter/lvm_support.rb undefined method message for #<String:0x0000000003d0eeb0>

Expected Behavior

No error message.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Direct download of LVM module via https://forge.puppet.com/modules/puppetlabs/lvm/readme
  2. Upload the module via IntelliJ IDEA, commit and push to master branch
  3. Run puppet

Environment

Additional Context

No errors for VMs with OS Oracle Linux Server 7.9 and Oracle Linux Server 8.

viko885 commented 1 year ago

Can anyone advise a workaround how to get rid of the error messages? This is confusing for our operators. It is seen as if they made a mistake and waste time to investigate what's wrong.

crazymind1337 commented 1 year ago

Having the same error on Virtuozzo VEs Ubuntu with 18.04/20.04/22.04 without any lvm installed.

Error: Facter: error while resolving custom facts in /opt/puppetlabs/puppet/cache/lib/facter/lvm_support.rb undefined method `message' for #<String:0x0000561fc08477c8>
crazymind1337 commented 1 year ago

See also issue #308.

viko885 commented 1 year ago

I can confirm https://github.com/puppetlabs/puppetlabs-lvm/pull/308 resolved the issue on my nodes!