Puppet-Master / Puppet-Agent Deployment fails due to the puppet modules metadata.json file permissions - puppet

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.

Related

Gitlab Runner artifacts-downloader returns Forbidden when downloading artifacts

I have a pipeline with 3 jobs. The 2nd job would build docker file and upload.
But the 3rd stage failed with this error.
ERROR: Downloading artifacts from coordinator... error error=unexpected EOF
So I tried to use gitlab-runner artifacts-downloader to download artifacts on the runner machine.
$ sudo gitlab-runner artifacts-downloader --url https://gitlab.com/ --token xxx-xxxx --id 359820234
Runtime platform arch=amd64 os=linux pid=24718 revision=05161b14
version=12.4.1
ERROR: Downloading artifacts from coordinator... forbidden id=359820234 responseStatus=403 Forbidden status=403 Forbidden token=xxx-xxxx
FATAL: permission denied
However, I got the forbidden error. Did I miss anything?

Puppet Agent Could not retrieve catalog

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:

Chef-server-ctl reconfigure/ Creating Admin User on chef server

I am fairly new to Linux (and brand new to chef) and I have ran into an issue when setting up my chef server. I am trying to create an admin user with the command
sudo chef-server-ctl user-create admin Admin Ladmin admin#example.com
examplepass -f admin.pem
but after I keep getting this error:
ERROR: Connection refused connecting...
ERROR: Connection refused connecting to https://127.0.0.1/users/, retry 5/5
ERROR: Network Error: Connection refused - Connection refused
connecting to https://..., giving up
Check your knife configuration and network settings
I also noticed that when I ran chef-server-ctl I got this output:
[2016-12-21T13:24:59-05:00] ERROR: Running exception handlers Running
handlers complete
[2016-12-21T13:24:59-05:00] ERROR: Exception
handlers complete Chef Client failed. 0 resources updated in 01 seconds
[2016-12-21T13:24:59-05:00] FATAL: Stacktrace dumped to
/var/opt/opscode/local-mode-cache/chef-stacktrace.out
[2016-12-21T13:24:59-05:00] FATAL: Please provide the contents of the
stacktrace.out file if you file a bug report
[2016-12-21T13:24:59-05:00] FATAL:
Chef::Exceptions::CannotDetermineNodeName: Unable to determine node
name: configure node_name or configure the system's hostname and fqdn
I read that this error is due to a prerequisite mistake but I'm uncertain as to what it means or how to fix it. So any input would be greatly appreciated.
Your server does not have a valid FQDN (aka full host name). You'll have to fix this before installing Chef server.

Error 400 on puppet 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
}

Could not retrieve catalog from remote server: Error 400 on SERVER: Error 403 on SERVER: Forbidden request:

I am trying to follow the documentation at this link:
http://docs.puppetlabs.com/pe/latest/quick_start.html
When I get to the part where one runs ...
sudo puppet agent --test
I get this error message ...
err: Could not retrieve catalog from remote server: Error 400 on SERVER:
Error 403 on SERVER: Forbidden request: red-cricket-pe-master (xxx.xxx.xxx.xx) access to /facts/red-cricket-agent [save] authenticated at line 45
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run
Thanks
Red
Found my answer here: https://serverfault.com/questions/491623/puppet-enterprise-2-7-error-400-on-server-error-403-on-server-cant-puppet/493085#493085
Looks like you HAVE TO install the console.

Resources