# Net::HTTPServerException: 413 "Request Entity Too Large"

**URL:** <https://discourse.chef.io/t/net-httpserverexception-413-request-entity-too-large/3764>\
**Category:** Chef Infra (archive)\
**Created:** [March 18, 2013, 3:47pm UTC](https://discourse.chef.io/t/net-httpserverexception-413-request-entity-too-large/3764 "2013-03-18T15:47:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeff\_Blaine](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/jeff_blaine/32/19_2.png) [@Jeff\_Blaine](https://discourse.chef.io/u/Jeff_Blaine)\
**Post date:** [March 18, 2013, 3:47pm UTC](https://discourse.chef.io/t/net-httpserverexception-413-request-entity-too-large/3764/1 "2013-03-18T15:47:55Z")

</div>

Hi,

This appears to be related to a host (1 of a few) bound to  
corporate AD where the ‘user’ resource is returning ~23MB  
of data … when I try to set the local root account’s  
password.

What are my options here? Any thoughts would be welcome.

The obvious workaround is to edit /etc/shadow directly  
and not use the ‘user’ resource 😑

[2013-03-18T11:35:34-04:00] INFO: \*\*\* Chef 11.4.0 \*\*\*  
…  
[2013-03-18T11:36:00-04:00] INFO: Processing user[root] action modify  
(rcf-rootuser::default line 10)  
[2013-03-18T11:36:09-04:00] ERROR: Running exception handlers  
[2013-03-18T11:36:16-04:00] FATAL: Saving node information to  
/var/chef/cache/failed-run-data.json  
[2013-03-18T11:36:16-04:00] ERROR: Exception handlers complete  
[2013-03-18T11:36:16-04:00] FATAL: Stacktrace dumped to  
/var/chef/cache/chef-stacktrace.out  
[2013-03-18T11:36:16-04:00] FATAL: Net::HTTPServerException: 413  
"Request Entity Too Large"  
[root@dev02 ~]# more /var/chef/cache/chef-stacktrace.out  
Generated at 2013-03-18 11:36:16 -0400  
Net::HTTPServerException: 413 “Request Entity Too Large”  
/opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:2632:in `error!' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/rest.rb:199:in`block in raw\_http\_request’  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/rest.rb:280:in  
`retriable_rest_request' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/rest.rb:164:in`raw\_http\_request’  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/rest.rb:158:in  
`api_request' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/rest.rb:125:in`put’  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/node.rb:489:in  
`save' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/client.rb:236:in`save\_updated\_node’  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/client.rb:471:in  
`do_run' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/client.rb:200:in`run’  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/application.rb:190:in  
`run_chef_client' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/application/client.rb:297:in`block in run\_ap  
plication’  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/application/client.rb:290:in  
`loop' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/application/client.rb:290:in`run\_application  
’  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/application.rb:73:in  
`run' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/bin/chef-client:26:in`\<top (required)\>’  
/usr/bin/chef-client:23:in `load' /usr/bin/chef-client:23:in`'  
[root@dev02 ~]#

---

<div class="post-metadata">

**Author:** ![Elvin\_Abordo](https://avatars.discourse-cdn.com/v4/letter/e/4af34b/32.png) [@Elvin\_Abordo](https://discourse.chef.io/u/Elvin_Abordo)\
**Post date:** [March 18, 2013, 3:51pm UTC](https://discourse.chef.io/t/net-httpserverexception-413-request-entity-too-large/3764/2 "2013-03-18T15:51:12Z")

</div>

Shooting from the hip here. Try disabling the Ohai passwd plugin via role,  
or whatever your choice is, see if that alleviates it. Something like this

```
"ohai": {
  "disabled_plugins": ["passwd"]
}

```

On Mon, Mar 18, 2013 at 11:47 AM, Jeff Blaine [jblaine@kickflop.net](mailto:jblaine@kickflop.net) wrote:

> Hi,
> 
> This appears to be related to a host (1 of a few) bound to  
> corporate AD where the 'user' resource is returning ~23MB  
> of data ... when I try to set the local root account's  
> password.
> 
> What are my options here? Any thoughts would be welcome.
> 
> The obvious workaround is to edit /etc/shadow directly  
> and not use the 'user' resource 😑
> 
> [2013-03-18T11:35:34-04:00] INFO: \*\*\* Chef 11.4.0 \*\*\*  
> ...  
> [2013-03-18T11:36:00-04:00] INFO: Processing user[root] action modify  
> (rcf-rootuser::default line 10)  
> [2013-03-18T11:36:09-04:00] ERROR: Running exception handlers  
> [2013-03-18T11:36:16-04:00] FATAL: Saving node information to  
> /var/chef/cache/failed-run-\*\*data.json  
> [2013-03-18T11:36:16-04:00] ERROR: Exception handlers complete  
> [2013-03-18T11:36:16-04:00] FATAL: Stacktrace dumped to  
> /var/chef/cache/chef-\*\*stacktrace.out  
> [2013-03-18T11:36:16-04:00] FATAL: Net::HTTPServerException: 413 "Request  
> Entity Too Large"  
> [root@dev02 ~]# more /var/chef/cache/chef-\*\*stacktrace.out  
> Generated at 2013-03-18 11:36:16 -0400  
> Net::HTTPServerException: 413 "Request Entity Too Large"  
> /opt/chef/embedded/lib/ruby/1.\*\*9.1/net/http.rb:2632:in `error!' /opt/chef/embedded/lib/ruby/ **gems/1.9.1/gems/chef-11.4.0/** lib/chef/rest.rb:199:in `block in raw\_http\_request'  
> /opt/chef/embedded/lib/ruby/\*\*gems/1.9.1/gems/chef-11.4.0/\*\*lib/chef/rest.rb:280:in  
> `retriable_rest_request' /opt/chef/embedded/lib/ruby/ **gems/1.9.1/gems/chef-11.4.0/** lib/chef/rest.rb:164:in `raw\_http\_request'  
> /opt/chef/embedded/lib/ruby/\*\*gems/1.9.1/gems/chef-11.4.0/\*\*lib/chef/rest.rb:158:in  
> `api_request' /opt/chef/embedded/lib/ruby/ **gems/1.9.1/gems/chef-11.4.0/** lib/chef/rest.rb:125:in `put'  
> /opt/chef/embedded/lib/ruby/\*\*gems/1.9.1/gems/chef-11.4.0/\*\*lib/chef/node.rb:489:in  
> `save' /opt/chef/embedded/lib/ruby/ **gems/1.9.1/gems/chef-11.4.0/** lib/chef/client.rb:236:in `save\_updated\_node'  
> /opt/chef/embedded/lib/ruby/\*\*gems/1.9.1/gems/chef-11.4.0/\*\*lib/chef/client.rb:471:in  
> `do_run' /opt/chef/embedded/lib/ruby/ **gems/1.9.1/gems/chef-11.4.0/** lib/chef/client.rb:200:in `run'  
> /opt/chef/embedded/lib/ruby/\*\*gems/1.9.1/gems/chef-11.4.0/\*\*lib/chef/application.rb:190:in  
> `run_chef_client' /opt/chef/embedded/lib/ruby/ **gems/1.9.1/gems/chef-11.4.0/** lib/chef/application/client.**rb:297:in `block in run\_ap  
> plication'  
> /opt/chef/embedded/lib/ruby/ **gems/1.9.1/gems/chef-11.4.0/**  
> lib/chef/application/client.\*\*rb:290:in `loop' /opt/chef/embedded/lib/ruby/ **gems/1.9.1/gems/chef-11.4.0/** lib/chef/application/client.**rb:290:in `run\_application  
> '  
> /opt/chef/embedded/lib/ruby/\*\*gems/1.9.1/gems/chef-11.4.0/\*\*lib/chef/application.rb:73:in  
> `run' /opt/chef/embedded/lib/ruby/ **gems/1.9.1/gems/chef-11.4.0/** bin/chef-client:26:in `\<top (required)\>'  
> /usr/bin/chef-client:23:in `load' /usr/bin/chef-client:23:in `'  
> [root@dev02 ~]#

--  
Elvin Abordo  
Mobile: (845) 475-8744

---

<div class="post-metadata">

**Author:** ![Jeff\_Blaine](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/jeff_blaine/32/19_2.png) [@Jeff\_Blaine](https://discourse.chef.io/u/Jeff_Blaine)\
**Post date:** [March 18, 2013, 10:08pm UTC](https://discourse.chef.io/t/net-httpserverexception-413-request-entity-too-large/3764/3 "2013-03-18T22:08:48Z")

</div>

On 3/18/2013 11:51 AM, Elvin Abordo wrote:

> Shooting from the hip here. Try disabling the Ohai passwd plugin via  
> role, or whatever your choice is, see if that alleviates it. Something  
> like this
> 
> ```
> "ohai": {
> "disabled_plugins": ["passwd"]
> }
> 
> ```

Thanks. That worked.

Aside: I went to update the community wiki page on this (which only  
mentions doing it through client.rb), but I couldn't make any sense  
of the new wiki after 10 minutes, so bailed.

---

<div class="post-metadata">

**Author:** ![Jeff\_Blaine](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/jeff_blaine/32/19_2.png) [@Jeff\_Blaine](https://discourse.chef.io/u/Jeff_Blaine)\
**Post date:** [March 19, 2013, 2:33pm UTC](https://discourse.chef.io/t/net-httpserverexception-413-request-entity-too-large/3764/4 "2013-03-19T14:33:38Z")

</div>

On 3/18/2013 6:08 PM, Jeff Blaine wrote:

> On 3/18/2013 11:51 AM, Elvin Abordo wrote:
> 
> > Shooting from the hip here. Try disabling the Ohai passwd plugin via  
> > role, or whatever your choice is, see if that alleviates it. Something  
> > like this
> > 
> > ```
> > "ohai": {
> > "disabled_plugins": ["passwd"]
> > }
> > 
> > ```
> 
> Thanks. That worked.

I take that back (O\_o at self). This appeared to work yesterday  
in my apparently crappy testing, but I am seeing this morning that  
it doesn't.

chef-client does not talk to the server to build the node's  
object until after Ohai runs, so will not see the attribute  
in a timely manner.

The solution in the wiki, modifying /etc/chef/client.rb, works.

I do appreciate the original reply though, from the hip and all 🙂

I'm going to open a ticket about this default Ohai behavior.  
IMO, it's bad. It may stem from the fact that the Ohai passwd  
plugin uses the Ruby stdlib 'Etc' module which states that it  
only references /etc/passwd and /etc/group, but in fact was  
clearly written by someone who does not understand what they're  
doing, as it calls getpwent() and friends which will, of course,  
enumerate everything defined in the NSS source list (like LDAP).

---

<div class="post-metadata">

**Author:** ![ams](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/ams/32/2536_2.png) [@ams](https://discourse.chef.io/u/ams)\
**Post date:** [October 1, 2019, 2:44pm UTC](https://discourse.chef.io/t/net-httpserverexception-413-request-entity-too-large/3764/5 "2019-10-01T14:44:52Z")

</div>

This error is still around in 2019.

If running `chef-client` throws the error `HTTPServerException: 413 "Request Entity Too Large"` check that:

- the option `ohai.disabled_plugins = [:Passwd]` lives on `/etc/chef/client.rb` on the server
- the option `ohai.disabled_plugins = [:Passwd]` lives on `/etc/chef/client.rb` on the client(s) throwing the error
