Bug #15461
closed
Smart-Proxy is unable to retrieve puppet environments due to timeout
Added by Gino Lisignoli over 8 years ago.
Updated over 7 years ago.
Description
The foreman smart-proxy is unable to retrieve environments from a puppetmaster that takes a significant amount of time returning results. From my setup, a successful curl request to https://puppetmaster:8140/puppet/v3/resource_types/*?kind=class&&environment=production takes just over 3 minutes.
When a environment request is made to the smart-proxy via the api (https://puppetserver:8443/puppet/environments/production/classes), the result is:
HTTP/1.1 406 Not Acceptable
Content-Type: application/json;charset=utf-8
Content-Length: 47
Server: WEBrick/1.3.1 (Ruby/2.0.0/2014-11-13) OpenSSL/1.0.1e
Date: Mon, 20 Jun 2016 04:19:29 GMT
Connection: Keep-Alive
Failed to show puppet classes: Net::ReadTimeout
This could be because the request to the v3/resource_types via curl returns as:
HTTP/1.1 200 OK
Content-Type: text/pson; charset=ISO-8859-1
X-Puppet-Version: 4.5.1
Transfer-Encoding: chunked
Server: Jetty(9.2.z-SNAPSHOT)
[{"line":1,"file":"/etc.................
How many classes do you have in the environment? Does this happen to the first call only, or for subsequent calls too?
Dmitri Dolguikh wrote:
How many classes do you have in the environment? Does this happen to the first call only, or for subsequent calls too?
Unsure on classes, I'll check tomorrow. This happens on all call attempts. I'm pretty sure environment caching is enabled (although I'm unsure how to check).
- Related to Feature #15095: Add Puppet server environment_classes API support added
Dmitri Dolguikh wrote:
How many classes do you have in the environment?
- find ./production -type f -iname '*.pp' | wc -l
240
So at most 240, maybe closer to 200 as there could be defined types etc. There are about 60 modules per environment. 4 Environments at the moment.
Discovered that my environment cache was NOT enabled. Enabling it, doing a pre-import curl request to generate the cache and then doing a foreman import will display the class import screen and then import fine.
However:
Even with the environment cache enabled the foreman must attempt to import the environments (and in my case fail) several times (at least once for each environment the that foreman-proxy is unable to import in time).
- Status changed from New to Feedback
- Status changed from Feedback to Resolved
Also available in: Atom
PDF