Bug #2668
Too many facts: request-URI Too Large
| Status: | Duplicate | Start date: | 09/22/2009 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | % Done: | 100% |
||
| Category: | plumbing | |||
| Target version: | - | |||
| Affected Puppet version: | 0.25.4 | Branch: | tickets/0.25/2668 | |
| Keywords: | ||||
| Votes: | 2 |
Description
Puppet client says
err: Could not retrieve catalog from remote server: Error 414 on SERVER: Request-URI Too Large
when facter URL is too large.
# facter | wc
75 295 5947
Note we are using @http_proxy_host@. I do not know if that matters.
Related issues
History
Updated by James Turnbull over 2 years ago
- Category set to plumbing
- Status changed from Unreviewed to Accepted
- Target version set to 0.25.2
Updated by David Escala over 2 years ago
Our problem is Apache httpd. It has a “LimitRequestLine”:http://httpd.apache.org/docs/2.0/mod/core.html#limitrequestline which defaults to 8190. It means httpd will refuse any URI with more than 8190 bytes.
The average “GET /development/catalog/host.domain?facts=…” has 4000 bytes. Although there is still room to grow, it is not difficult to reach the URI limit if you distribute custom facts.
Is it possible to HTTP POST instead of GET?
(if you use storeconfigs you are changing server state anyway)
Updated by Brice Figureau over 2 years ago
David Escala wrote:
Our problem is Apache httpd. It has a “LimitRequestLine”:http://httpd.apache.org/docs/2.0/mod/core.html#limitrequestline which defaults to 8190. It means httpd will refuse any URI with more than 8190 bytes.
Yes, I already seen that. Most of the proxy/web server have indeed a limit. I expect to see this issue resurrect from time to time. Note: I don’t think the HTTP RFC imposes a limit, so in this area Puppet behaves correctly.
The average “GET /development/catalog/host.domain?facts=…” has 4000 bytes. Although there is still room to grow, it is not difficult to reach the URI limit if you distribute custom facts.
Is it possible to HTTP POST instead of GET?
I don’t think so, because we’re GETting a catalog. To be RESTful, we should keep using GET.
(if you use storeconfigs you are changing server state anyway)
No. Storeconfigs doesn’t change the state of the server. It just “caches” the configuration somewhere else.
What could be done is to maybe gzip the facts before using them as a request parameter.
Updated by Josh Anderson over 2 years ago
Brice Figureau wrote:
What could be done is to maybe gzip the facts before using them as a request parameter.
Gzip == binary format == lots more escape sequences in the request. I think the gzipped and URL-escaped request would be as long as the original data, or maybe even longer.
Updated by Nigel Kersten over 2 years ago
Doesn’t this just mean the answer is to document that you need to increase LimitRequestLine for your vhost ?
Updated by Bart Verwilst over 2 years ago
AFAIK you can only set the LimitRequestLine to a value between 0 and DEFAULT_LIMIT_REQUEST_LINE ( which is 8190 usually, and set at Apache compiletime.. ). So i guess you cannot increase it, only decrease.. Or am i missing something?
Updated by Brice Figureau over 2 years ago
Josh Anderson wrote:
Brice Figureau wrote:
What could be done is to maybe gzip the facts before using them as a request parameter.
Gzip == binary format == lots more escape sequences in the request. I think the gzipped and URL-escaped request would be as long as the original data, or maybe even longer.
I was thinking about gzip + base64 actually. It might be interesting to try.
Updated by Brice Figureau over 2 years ago
Brice Figureau wrote:
Josh Anderson wrote:
Brice Figureau wrote:
What could be done is to maybe gzip the facts before using them as a request parameter.
Gzip == binary format == lots more escape sequences in the request. I think the gzipped and URL-escaped request would be as long as the original data, or maybe even longer.
I was thinking about gzip + base64 actually. It might be interesting to try.
I just tried on some of my facts:
- verbatim: 3799 bytes
- gzipped: 1614 bytes
- gz+base64: 2181 bytes
So in the end the compression ratio is: 57% which is not that bad…
Updated by Bart Verwilst over 2 years ago
Making the same caculations:
* verbatim: 6835 bytes
* gzipped: 1939 bytes
* gz+base64: 2623 bytes
It doesn’t totally solve the problem, but it surely makes it a lot harder to trigger :)
Updated by Brice Figureau over 2 years ago
- Status changed from Accepted to Ready For Checkin
- Assignee set to James Turnbull
- % Done changed from 0 to 100
- Branch set to tickets/0.25/2668
I released a patch for compressing the facts while they are transmitted. This is not the correct fix but a more like a workaround.
It seems the patch has been accepted for 0.25.x.
The patch is in the tickets/0.25/2668 branch in my github repository: http://github.com/masterzen/puppet/tree/tickets/0.25.x/2668
Updated by James Turnbull over 2 years ago
- Status changed from Ready For Checkin to Closed
- Target version changed from 0.25.2 to 0.25.1
Pushed in commit:e8bce7a6c3d0941fb3b461d2f0487b3f249ff5f1 in branch 0.25.x
Updated by Lluis Gili over 1 year ago
- Status changed from Closed to Re-opened
- Target version deleted (
0.25.1)
When the facts grow, this problem reappears, sorry to re-open We have some facts really long (DSA public keys) that are blocking puppetruns.
Updated by James Turnbull over 1 year ago
- Status changed from Re-opened to Needs More Information
What version are you running?
Updated by Lluis Gili over 1 year ago
master and agent are version 0.25.4 both
Updated by James Turnbull over 1 year ago
- Affected Puppet version changed from 0.25.0 to 0.25.4
Updated by James Turnbull over 1 year ago
- Status changed from Needs More Information to Duplicate
Added Bug #6117 to revisit this issue since the original issue had been addressed with the b64+gzip patch.
Updated by Mark Stanislav about 1 year ago
Having the same issue with a host that has a large number (over 180) of IP addresses attached, thereby giving MANY interface related facts. I’m using 0.26.4 for both master/agent.
facter | wc 773 2412 29574
Updated by James Turnbull about 1 year ago
Mark – do you mean 2.6.4? Or 0.25.4?