I'm using puppet 6.10.1 on Ubuntu 18.04.3 and when I run puppet agent -t on a server I get the below output
Info: Using configured environment 'dev'
Info: Retrieving pluginfacts
Error: /File[/opt/puppetlabs/puppet/cache/facts.d]: Could not evaluate: Could not retrieve information from environment dev source(s) puppet:///pluginfacts
Info: Retrieving plugin
Error: /File[/opt/puppetlabs/puppet/cache/lib]: Could not evaluate: Could not retrieve information from environment dev source(s) puppet:///plugins
Notice: /File[/opt/puppetlabs/puppet/cache/lib/facter]: Dependency File[/opt/puppetlabs/puppet/cache/lib] has failures: true
Warning: /File[/opt/puppetlabs/puppet/cache/lib/facter]: Skipping because of failed dependencies
Warning: /File[/opt/puppetlabs/puppet/cache/lib/facter/facter_dot_d.rb]: Skipping because of failed dependencies
Warning: /File[/opt/puppetlabs/puppet/cache/lib/facter/package_provider.rb]: Skipping because of failed dependencies
Warning: /File[/opt/puppetlabs/puppet/cache/lib/facter/pe_version.rb]: Skipping because of failed dependencies
Warning: /File[/opt/puppetlabs/puppet/cache/lib/facter/puppet_settings.rb]: Skipping because of failed dependencies
...lots more skipping because of failed dependencies
Warning: /File[/opt/puppetlabs/puppet/cache/lib/puppet/type/file_line.rb]: Skipping because of failed dependencies
Info: Retrieving locales
Error: /File[/opt/puppetlabs/puppet/cache/locales]: Could not evaluate: Could not retrieve information from environment dev source(s) puppet:///locales
Notice: /File[/opt/puppetlabs/puppet/cache/locales/ja]: Dependency File[/opt/puppetlabs/puppet/cache/locales] has failures: true
Warning: /File[/opt/puppetlabs/puppet/cache/locales/ja]: Skipping because of failed dependencies
Warning: /File[/opt/puppetlabs/puppet/cache/locales/ja/puppetlabs-ntp.po]: Skipping because of failed dependencies
Warning: /File[/opt/puppetlabs/puppet/cache/locales/ja/puppetlabs-stdlib.po]: Skipping because of failed dependencies
Info: Loading facts
Info: Caching catalog for web-dev.domain.com
Info: Applying configuration version '1571827736'
Notice: Applied catalog in 0.01 seconds
I run with debug and the following strikes as interesting
Debug: HTTP GET https://puppetmaster01:8140/puppet/v3/file_metadata/pluginfacts returned 404 Not Found
Debug: HTTP GET https://puppetmaster01:8140/puppet/v3/file_metadata/plugins returned 404 Not Found
Debug: HTTP GET https://puppetmaster01:8140/puppet/v3/file_metadata/locales returned 404 Not Found
My site.pp
node 'default' {
include common
}
# agent
node /web[0-9]+-[a-zA-Z]+.domain.com/ {
package {
'openssh-server':
ensure => latest,
}
}
# not using regex to confirm that the FQDN is correct
node /web-dev.domain.com/ {
include common
}
Not sure where to go from here or why I'm getting the 404 errors
The issue here was mis-matched versions
Related
I am not new to puppet, but I am new to using it on Windows. Trying to configure chocolatey using the puppetlabs/chocolatey module. Initial puppet run without the module worked just fine. Then I added include chocolatey to the manifest, and it downloaded and installed chocolatey. So far, so good. However, then I went to add a custom source like so:
chocolateysource { 'mysource':
ensure => present,
location => 'https://my.chocolatey.source',
priority => 10,
}
Now I get the following message when running puppet agent -t:
PS C:\Windows\system32> puppet agent -t
Error: Could not autoload puppet/provider/package/chocolatey: C:/ProgramData/PuppetLabs/puppet/cache/lib/puppet/provider/package/chocolatey.rb:280: syntax error, unexpected '.'
pin_output&.split("\n")&.each { |pin| pin...
^
C:/ProgramData/PuppetLabs/puppet/cache/lib/puppet/provider/package/chocolatey.rb:280: syntax error, unexpected '.'
... pin_output&.split("\n")&.each { |pin| pins << pin.spli...
... ^
Error: Facter: error while resolving custom facts in C:/ProgramData\PuppetLabs\puppet\cache\lib\facter\package_provider.rb: Could not autoload puppet/provider/package/chocolatey: C:/ProgramData/PuppetLabs/puppet/cache/lib/puppet/provider/package/chocolatey.rb:280: syntax error, unexpected '.'
pin_output&.split("\n")&.each { |pin| pin...
^
C:/ProgramData/PuppetLabs/puppet/cache/lib/puppet/provider/package/chocolatey.rb:280: syntax error, unexpected '.'
... pin_output&.split("\n")&.each { |pin| pins << pin.spli...
... ^
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Redefining package in Puppet::Type
Error: Could not autoload puppet/type/chocolateysource: C:/ProgramData/PuppetLabs/puppet/cache/lib/puppet/type/chocolateysource.rb:221: syntax error, unexpected '.'
parameter(:password)&.sensitive = true
^
Error: Could not retrieve catalog from remote server: Could not intern from text/pson: Could not autoload puppet/type/chocolateysource: C:/ProgramData/PuppetLabs/puppet/cache/lib/puppet/type/chocolateysource.rb:221: syntax error, unexpected '.'
parameter(:password)&.sensitive = true
^
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
As a non-Windows user, I feel like I'm missing something to make this work, but I'm not sure what it is. I have verified that .Net framework is installed, but not sure what else to check here. Thanks in advance for any help.
Turns out the version was the issue. I had mistakenly installed puppet 4 agent, while the server is puppet 7.
I installed Maven module in Master machine using this command:
puppet module install maestrodev-maven --version 1.4.0
It installed it successfully in /etc/puppet/modules/
Afterwards I added following code inside the file /etc/puppet/manifests/site.pp of master machine
node 'test02.edureka.com'
{
include maven
}
Now, when I run below command on Puppet Agent machine
puppet agent -t
It gives error:
root#test02:~# puppet agent -t
Warning: Unable to fetch my node definition, but the agent run will continue:
Warning: execution expired
Info: Retrieving pluginfacts
Error: /File[/var/lib/puppet/facts.d]: Failed to generate additional resources using 'eval_generate': execution expired
Error: /File[/var/lib/puppet/facts.d]: Could not evaluate: Could not retrieve file metadata for puppet://test01.edureka.com/pluginfacts: execution expired
Info: Retrieving plugin
Error: /File[/var/lib/puppet/lib]: Failed to generate additional resources using 'eval_generate': execution expired
Error: /File[/var/lib/puppet/lib]: Could not evaluate: Could not retrieve file metadata for puppet://test01.edureka.com/plugins: execution expired
Info: Loading facts
Error: JAVA_HOME is not defined correctly.
We cannot execute
Could not retrieve fact='maven_version', resolution='': undefined method `split' for nil:NilClass
Error: Could not retrieve catalog from remote server: execution expired
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
Error: Could not send report: execution expired
root#test02:~#
puppet.conf file on master:
puppet.conf file on agent:
Error screenshot:
I would like to test the puppet client on the same machine as the master resides. I followed this tutorial "http://www.elsotanillo.net/2011/08/installing-puppet-master-and-client-in-the-same-host-the-debian-way/". He was saying that generating SSL at the right moment is the trick involved in keeping master and client communicating successfully in one machine. I killed puppet master process, generated puppet.conf file as he given in that link, installed puppet client, but when I try to generate SSL using the below command. It failed. You could see the log below.
puppetd --no-daemonize --onetime --verbose --waitforcert 30
I replaced puppetd with puppet agent to make it work in latest version of puppet
Warning: Unable to fetch my node definition, but the agent run will
continue:
Warning: Connection timed out - connect(2)
Info: Retrieving pluginfacts
Error: /File[/home/lhdadmin/.puppet/var/facts.d]: Failed to generate
additional resources using 'eval_generate': Connection timed out -
connect(2)
Error: /File[/home/lhdadmin/.puppet/var/facts.d]: Could not evaluate:
Could not retrieve file metadata for puppet://puppet/pluginfacts:
Connection timed out - connect(2)
Info: Retrieving plugin
Error: /File[/home/lhdadmin/.puppet/var/lib]: Failed to generate
additional resources using 'eval_generate': Connection timed out -
connect(2)
Error: /File[/home/lhdadmin/.puppet/var/lib]: Could not evaluate:
Could not retrieve file metadata for puppet://puppet/plugins:
Connection timed out - connect(2)
I tried to install puppetdb thinking that was the missing component could be triggering the above error, but it couldn't find puppetdb module to install. see the errors below
sudo puppet resource package puppetdb ensure=latest
Error: Could not update: Execution of '/usr/bin/apt-get -q -y -o
DPkg::Options::=--force-confold install puppetdb' returned 100:
Reading package lists... Building dependency tree... Reading state
information... E: Unable to locate package puppetdb Error:
/Package[puppetdb]/ensure: change from purged to latest failed: Could
not update: Execution of '/usr/bin/apt-get -q -y -o
DPkg::Options::=--force-confold install puppetdb' returned 100:
Reading package lists... Building dependency tree... Reading state
information... E: Unable to locate package puppetdb
package { 'puppetdb': ensure => 'purged', }
Aah , I think you have not mentioned your puppet class in init.pp or have defined your node in node.pp .
If you don't want to use puppetdb then please don't include in your puppet/puppet.conf file and if you want to use it then cross check the puppetdb by login in manually by the user mentioned in puppet.conf file.
storeconfigs = true
dbname = puppet-db
dbadapter = mysql
dbuser = puppet-user
dbpassword = puppet
dbserver = localhost
Also check for the proper repo in /etc/apt/sources.list , E: Unable to locate package puppetdb this error generally occurs due to failed internet connectivity, or if it is unable to reach the server.
On agent node:
root#agent2-VirtualBox:/var/lib/puppet# puppet agent -t
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find default node or by name with 'agent2-virtualbox.servicemesh.com, agent2-virtualbox.servicemesh, agent2-virtualbox, agent2-VirtualBox.servicemesh.com, agent2-VirtualBox.servicemesh, agent2-VirtualBox' on node agent2-virtualbox.servicemesh.com
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
root#agent2-VirtualBox:/var/lib/puppet#
On the puppet master side:
root#puppetmaster:~# puppet cert sign --all
Error: No waiting certificate requests to sign
root#puppetmaster:~#
How to resolve this?
You need to check you site.pp and make sure you either have a default node definition defined or a node definition for the FQDN of your agent.
https://docs.puppet.com/puppet/latest/reference/lang_node_definitions.html
for example:
node 'agent2-virtualbox.servicemesh.com' {
import ntp
}
I am using the Puppet Master / Puppet Agent deployment in CentOS 6.5 64bits.
My problem is about doing the request from Puppet Agent in order to start the puppet modules's installation. When I execute the following commandline from Puppet-Agent:
puppet agent --server <internal-puppet-server-hostname> --test
The ouput result is:
Info: Retrieving pluginfacts
Error: /File[/var/lib/puppet/facts.d]: Failed to generate additional resources using 'eval_generate': Error 400 on SERVER: Permission denied - /etc/puppet/modules/yum/metadata.json
Error: /File[/var/lib/puppet/facts.d]: Could not evaluate: Could not retrieve file metadata for puppet://<internal-puppet-server-hostname>/pluginfacts: Error 400 on SERVER: Permission denied - /etc/puppet/modules/yum/metadata.json
Info: Retrieving plugin
Error: /File[/var/lib/puppet/lib]: Failed to generate additional resources using 'eval_generate': Error 400 on SERVER: Permission denied - /etc/puppet/modules/yum/metadata.json
Error: /File[/var/lib/puppet/lib]: Could not evaluate: Could not retrieve file metadata for puppet://<internal-puppet-server-hostname>/plugins: Error 400 on SERVER: Permission denied - /etc/puppet/modules/yum/metadata.json
Info: Caching catalog for <internal-puppet-agent-hostname>
Info: Applying configuration version '1440623253'
About the returned response, I show that the problem occurs because of the permissions of metadata.json's file. Then, I've checked the permissions of metadata.json:
-r--------. 1 root root 539 2015-08-18 14:19 metadata.json
Some ideas about error occurs? Thanks.