Failure to upload large Stemcell file with 413 Request Entity Too Large error
search cancel

Failure to upload large Stemcell file with 413 Request Entity Too Large error

book

Article ID: 293608

calendar_today

Updated On:

Products

Operations Manager

Issue/Introduction

Symptoms:
When uploading a large Stemcell file (over 10 GB) "bosh upload-stemcell" fails with error "413 Request Entity Too Large" as shown below.
$ bosh upload-stemcell bosh-stemcell-1200.17-vsphere-esxi-windows2012R2-go_agent.tgz
Using environment '192.168.111.67' as user 'director' (bosh.*.read, openid, bosh.*.admin, bosh.read, bosh.admin)

#                                                             0.00% 1.97 MB/s 0s

Uploading stemcell file:
  Director responded with non-successful status code '413' response '<html>
<head><title>413 Request Entity Too Large</title></head>
<body bgcolor="white">
<center><h1>413 Request Entity Too Large</h1></center>
<hr><center>nginx</center>
</body>
</html>
'

Exit code 1

Environment


Cause

As explained in the Upload release fails section on the BOSH website, this failure occurs due to a nginx configuration problems with the Director and the nginx blobstore. There is a parameter in the nginx configuration to limit the maximum size of an object to be uploaded. In this case, the Stemcell file size has reached the uploading limitation.

Resolution

It has been described in the BOSH documentation that the failure can be remedied by configuring the max_upload_size property on the Director and the Blobstore jobs.

If it's possible, specify the max_upload_size property of the Director and the Blobstore job in the manifest file to deploy the BOSH Director, then adjust the value of this property first and re-deploy the Director.
 
However in Pivotal Cloud Foundry (PCF) system, a BOSH Director is deployed by Operations (Ops) Manager, and there is no way to specify the max_upload_size property for the Director and the Blobstore jobs. Following is a method to change the property and remedy the failure temporarily.

Director job (for uploading the files like a Stemcell)
1) SSH to the BOSH Director node as a root user.
2) Change to directory /var/vcap/jobs/director/config
3) Make a copy of nginx.conf
4) Open the nginx.conf with an editor (e.g. vim) and change the value of the parameter "client_max_body_size" (default is 10000 m), and save the changes.
5) Restart the director_nginx job 
# monit restart director_nginx
Blobstore job (for uploading the files like the release package)
1) SSH to BOSH Director node as a root user
2) Change to directory /var/vcap/jobs/blobstore/config/sites
3) Make a copy of the blobstore.conf
4) Open blobstore.conf with an editor (e.g. vim) and change the value of parameter "client_max_body_size" (default is 5000m ), save the changes.
5) Restart the blobstore_nginx job.
# monit restart blobstore_nginx

Please note that the changes made with above method will be reverted to default value once the BOSH Director node is recreated.