Ask Your Question
0

Warning: Unable to fetch my node definition, but the agent run will continue: Warning: no such file to load

asked 2016-11-21 21:56:37 -0500

Raj gravatar image

updated 2016-11-23 06:27:05 -0500

DarylW gravatar image

I have a test Puppet master . I am able to run the agents on Windows machines without any issues. All the custom facts on windows get loaded and we are able to get the desired result. However for Linux when I try to run the agent it fails with below messages :

[root@x01stdbld01 hiera]# puppet agent -t --noop

Info: Loading facts
Could not interpret fact file /var/lib/puppet/facts.d/test.yaml
-rw-rw-r-- 1 root utmp 571776 Nov 22 11:21 /var/log/wtmp
authpriv.* /var/log/secure
-rw-r--r-- 1 root root 1298054 Nov 22 11:41 /var/log/messages
-rw-rw-r-- 1 root utmp 571776 Nov 22 11:21 /var/log/wtmp
-rw------- 1 root root 0 Aug  7  2014 /var/log/tallylog
-rw-r--r-- 1 root root 1298054 Nov 22 11:41 /var/log/messages
-rw------- 1 root root 0 Aug  7  2014 /var/log/tallylog
Could not retrieve fact='w2k8_2_2_10_1_1', resolution='<anonymous>': undefined method `exists?' for Dir:Class
Could not retrieve fact='x_1_02_01_12', resolution='<anonymous>': undefined local variable or method `ssh_result' for #<Facter::Util::Resolution:0x7fcc86f95e48>
Could not retrieve fact='x_1_02_01_10', resolution='<anonymous>': undefined local variable or method `ssh_result' for #<Facter::Util::Resolution:0x7fcc86f87f00>
httpd-devel-2.2.15-29.el6_4.x86_64
httpd-2.2.15-29.el6_4.x86_64
httpd-tools-2.2.15-29.el6_4.x86_64
Warning: Unable to fetch my node definition, but the agent run will continue:
Warning: no such file to load -- win32\registry

Info: Retrieving pluginfacts
Notice: /File[/var/lib/puppet/facts.d/test.yaml]/ensure: removed
Info: Retrieving plugin
Notice: /File[/var/lib/puppet/lib/facter/A1_1.rb]/ensure: removed
Info: Loading facts
-rw-rw-r-- 1 root utmp 571776 Nov 22 11:21 /var/log/wtmp
authpriv.* /var/log/secure
-rw-r--r-- 1 root root 1298917 Nov 22 11:41 /var/log/messages
-rw-rw-r-- 1 root utmp 571776 Nov 22 11:21 /var/log/wtmp
-rw------- 1 root root 0 Aug  7  2014 /var/log/tallylog
-rw-r--r-- 1 root root 1298917 Nov 22 11:41 /var/log/messages
-rw------- 1 root root 0 Aug  7  2014 /var/log/tallylog
Could not retrieve fact='w2k8_2_2_10_1_1', resolution='<anonymous>': undefined method `exists?' for Dir:Class
Could not retrieve fact='x_1_02_01_12', resolution='<anonymous>': undefined local variable or method `ssh_result' for #<Facter::Util::Resolution:0x7fcc86cd91f0>
Could not retrieve fact='x_1_02_01_10', resolution='<anonymous>': undefined local variable or method `ssh_result' for #<Facter::Util::Resolution:0x7fcc86ccf4c0>
httpd-devel-2.2.15-29.el6_4.x86_64
httpd-2.2.15-29.el6_4.x86_64
httpd-tools-2.2.15-29.el6_4.x86_64
Error: Could not retrieve local facts: no such file to load -- win32\registry
Error: Failed to apply catalog: Could not retrieve local facts: no such file to load -- win32\registry
edit retag flag offensive close merge delete

Comments

Let me know what else details are required. Can share !!

Raj gravatar imageRaj ( 2016-11-21 21:58:08 -0500 )edit

You may need to confine your windows only fact to windows. They have the example for linux in the official guide https://docs.puppet.com/facter/3.5/custom_facts.html#confining-facts

DarylW gravatar imageDarylW ( 2016-11-23 06:30:33 -0500 )edit

If you want to confine based on the existence of a file https://groups.google.com/forum/#!topic/puppet-users/HaNq_7-SQGc

DarylW gravatar imageDarylW ( 2016-11-23 06:32:00 -0500 )edit

Thanks for the reply DaryIW. Below is sample of one of my windows fact files : Facter.add(:w2k8_2_2_5_22) do setcode do confine :kernel => :windows

Raj gravatar imageRaj ( 2016-11-23 19:24:17 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2016-11-23 19:26:59 -0500

Raj gravatar image

Here is the sample :

    Facter.add(:w2k8_2_2_5_22) do
   setcode do
   confine :kernel => :windows
   value = "unknown"
   output = Facter::Core::Execution.exec('C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy remotesigned -Command "& {(Test-Path HKLM:\SYSTEM\CurrentControlSet\Services\VSS)}"')
   if ( output == "True" )
      value =  Facter::Core::Execution.exec('C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy remotesigned (Get-WmiObject -ComputerName localhost -Class Win32_Service -Property StartMode -Filter \"Name=\'VSS\'\").StartMode')
   else
       value = "No Volume Shadow Copy Service Available"
   end
 end
end

However I dont feel that this is stopping the agent . We have similar warnings reported on Windows as well , however the run continues and we do get outputs.

[root@x01stdbld01 facter]# puppet module list --tree
/etc/puppet/environments/production/modules
├── puppetlabs-acl (v1.1.2)
├── linux (???)
├── ayohrling-local_security_policy (v0.6.0)
├── badgerious-wmi_obj (v1.0.2)
├─┬ puppetlabs-registry (v1.1.3)
│ └── puppetlabs-stdlib (v4.13.1)
└── puppetlabs-powershell (v2.0.3)
/etc/puppet/modules
├── aix (???)
├── custom (???)
├── linux (???)
└── windows (???)
/usr/share/puppet/modules (no modules installed)
edit flag offensive delete link more

Comments

Please let me know if I can upload some other logs/samples to give a better understanding of the issue.

Raj gravatar imageRaj ( 2016-11-23 19:28:20 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-11-21 21:56:37 -0500

Seen: 606 times

Last updated: Nov 23 '16