What is root cause for Request Entity Too Large: error


Some times during my chef-client execution i get below error. What is the root cause for this.

[2016-01-03T10:08:18-05:00] INFO: HTTP Request Returned 413 Request Entity Too Large: error


you are trying to send data larger than the configured value on client side. Check what type of data you are sending. Chef server runs on nginx which has client_max_body_size settings that controls the limit.

Exactly, I remember twicking that param for a larger file.

This is not consistent. It happens only some times which is more annoying. If it is the problem with sending large data error should come every time.

R u using any cookbook file or template? I am guessing when the file was
changed and when chef tries to revert back the original state, u r seeing

But this just a guess. Try showing the log via pastebin or something

I have encountered this error when i am trying to run java cookbook. Please find the error log below.

[2016-01-03T10:07:22-05:00] INFO: Processing remote_file[/etc/chef/jdk-8u45-linux-x64.tar.gz] action create_if_missing (/etc/chef/cookbooks/java/providers/ark.rb line 129)
[2016-01-03T10:07:30-05:00] INFO: remote_file[/etc/chef/jdk-8u45-linux-x64.tar.gz] created file /etc/chef/jdk-8u45-linux-x64.tar.gz
[2016-01-03T10:07:46-05:00] INFO: remote_file[/etc/chef/jdk-8u45-linux-x64.tar.gz] updated file contents /etc/chef/jdk-8u45-linux-x64.tar.gz
[2016-01-03T10:07:49-05:00] INFO: remote_file[/etc/chef/jdk-8u45-linux-x64.tar.gz] mode changed to 755
[2016-01-03T10:07:56-05:00] INFO: Processing remote_file[/etc/chef/jdk-8u45-linux-x64.tar.gz] action nothing (/etc/chef/cookbooks/java/providers/ark.rb line 129)
[2016-01-03T10:07:56-05:00] INFO: Processing java_alternatives[set-java-alternatives] action set (/etc/chef/cookbooks/java/providers/ark.rb line 220)
[2016-01-03T10:08:18-05:00] INFO: HTTP Request Returned 413 Request Entity Too Large: error

This error is being observed more frequently these days and it happens when node.save is being called in recipe.

Yeah, it looks like you’ve added something to your cookbook that is large.

Any chance you have a a .war or .ear file? Any .tar files?

There is a way to bump up the storage space, but it’s better to use remote_file with a remote source (S3, http share, etc) and pull it down that way.

This have been asked many times. if you search the previous questions, you
would get the answer. The reason is the nginx setting a limit on the size

1 Like

I do not have any files in my cookbook. I just update my attribute and save node so that attribute value will be saved even chef client run is failed.


Try the fix that is suggested here.

Specificly the nginx.conf change here: http://stackoverflow.com/a/13020549/1978412

Thanks i will update my client.rb in all linux machines

Just in case disabling Passwd plugin didn’t work, you can disable some other too as mentioned below. ohai fails to load data from node to chef server.

ohai.disabled_plugins = [“aix”, :Cloud, :CloudV2, :Command, :DMI, :Eucalyptus, “freebsd”, :Groovy, “hpux”, :IpScopes, :Lua, :Mono, :NetworkListeners, “openbsd”, “rackspace”, “solaris2”, “sigar”, :Passwd, “windows”, “darwin”, “netbsd”, “services”]