'Getting this below error while running puppet agent -t?

I am getting this error every time I ran puppet agent -t on the agent.

Error: Facter: error while resolving custom facts in /opt/puppetlabs/puppet/cache/lib/facter/ipaddresses.rb: cannot load such file -- facter/util/ip

Can anyone help me in resolving this error?

I have tried various solutions but nothing seems to be working. Like installing gems package etc. Puppet version I am ones 5.5.2



Solution 1:[1]

Are you calling/storing the file from the correct directory?

Error: Facter: error while resolving custom facts in /opt/puppetlabs/puppet/cache/lib/facter/ipaddresses.rb:

The file ipaddresses.rb seems to be in folder 'facter', however, in the error you have a path facter/util/ip.

'Util' folder is within the 'Facter' folder, so you might have an incorrect path hence why the agent run is failing.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Deyan Farrugia