I have been running foreman with a small number of nodes. Today while
attempting to push some git updates from my environments to the git server.
All of my environments were removed.
These were recovered via tarball taken before attempting the work.
But since then I have been getting the following errors where the nodes
cannot query the environments.
if I run
foreman-rake puppet:import:puppet_classes
I get the error:
Evaluating possible changes to your installation
Problems were detected during the evaluation phase
ERF12-2749 [ProxyAPI::ProxyException]: Unable to get environments from
puppet ([RestClient::NotAcceptable]: 406 Not Acceptable) for proxy
https://<FOREMAN_HOST>:8443/puppet
Please fix these issues and try again.
Looking in the proxy logs I get
[Foreman-proxy log]
E, [2015-10-22T15:27:47.046842 #21081] ERROR - - : Failed to list puppet
environments: Failed to query Puppet find environments API (404) :
<!DOCTYPE HTML PUBLIC “-//IETF//DTD HTML 2.0//EN”>
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p> The requested URL /v2.0/environments was not found on this server.</p>
</body></html>
<FOREMAN_IP> - - [22/Oct/2015 15:27:47] “GET /puppet/environments HTTP/1.1”
406 303 0.3764
D, [2015-10-22T15:28:15.393807 #21081] DEBUG - - : verify remote client
<FOREMAN_IP> against trusted_hosts [“<FOREMAN< FOREMAN-PROXY-HOST”]
I, [2015-10-22T15:28:15.394557 #21081] INFO - - : Initialising from puppet
config file: /etc/puppet/puppet.conf
I, [2015-10-22T15:28:15.411016 #21081] INFO - - : Initialising from puppet
config file: /etc/puppet/puppet.conf
I, [2015-10-22T15:28:15.764463 #21081] ERROR - - : Failed to list puppet
environments: Failed to query Puppet find environments API (404):
<!DOCTYPE HTML PUBLIC “-//IETF//DTD HTML 2.0//EN”>
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p> The requested URL /v2.0/environments was not found on this server.</p>
</body></html>
My auth.conf has an entry for environments
[auth.conf]
path /v2.0/environments
method find
allow *
telnet'ing to port 8443 shows the port is open.
restarting the foreman-proxy and foreman has not been successful.
Searching for the error message while successful non of the resolutions
have applied to this situation.
the git push would have only affected the /etc/puppet directory. I cannot
find any missing files etc.
Which version of Puppet? Please double check the packages on your
server just to make sure. It needs to be 3.5 or higher for this API to
exist.
> Looking in the proxy logs I get
>
> [Foreman-proxy log]
>
> E, [2015-10-22T15:27:47.046842 #21081] ERROR - - : Failed to list puppet
> environments: Failed to query Puppet find environments API (404) :
> <!DOCTYPE HTML PUBLIC “-//IETF//DTD HTML 2.0//EN”>
> <html><head>
> <title>404 Not Found</title>
> </head><body>
> <h1>Not Found</h1>
> <p> The requested URL /v2.0/environments was not found on this server.</p>
> </body></html>
This suggests to me that either:
a) /etc/foreman-proxy/settings.d/puppet.yml has the wrong URL for the
Puppet master in the :puppet_url setting. Can you paste the file?
Check the hostname in the URL matches what's in the Puppet master's
Apache VirtualHost. Also check it's port 8140 and HTTPS.
b) It's an older version of Puppet running that doesn't expose the API.
> My auth.conf has an entry for environments
> [auth.conf]
> path /v2.0/environments
> method find
> allow *
Check that this entry is above the "default deny" at the bottom of the file.
when the modules got hosed all of the files in /etc/puppet/rack were also
hosed.
Recovered from backup and back in business.
···
On Thursday, 22 October 2015 23:02:34 UTC+11, Dominic Cleal wrote:
>
> On 22/10/15 12:08, barry wrote:
> > Foreman server: RHEL 7.1
> > Foreman 1.9
>
> Which version of Puppet? Please double check the packages on your
> server just to make sure. It needs to be 3.5 or higher for this API to
> exist.
>
> > Looking in the proxy logs I get
> >
> > [Foreman-proxy log]
> >
> > E, [2015-10-22T15:27:47.046842 #21081] ERROR - - : Failed to list puppet
> > environments: Failed to query Puppet find environments API (404) :
> >
> >
> > 404 Not Found
> >
> >
Not Found
> >
The requested URL /v2.0/environments was not found on this
> server.
> >
>
> This suggests to me that either:
>
> a) /etc/foreman-proxy/settings.d/puppet.yml has the wrong URL for the
> Puppet master in the :puppet_url setting. Can you paste the file?
>
> Check the hostname in the URL matches what's in the Puppet master's
> Apache VirtualHost. Also check it's port 8140 and HTTPS.
>
> b) It's an older version of Puppet running that doesn't expose the API.
>
> > My auth.conf has an entry for environments
> > [auth.conf]
> > path /v2.0/environments
> > method find
> > allow *
>
> Check that this entry is above the "default deny" at the bottom of the
> file.
>
> --
> Dominic Cleal
> dom...@cleal.org
>