shieldproject / shield

A standalone system that can perform backup and restore functions for a wide variety of pluggable data systems
MIT License
367 stars 69 forks source link

Nginx `client_max_body_size` is 10M, caused backup file for shield itself larger than that can not be restored #698

Closed xiujiao closed 4 years ago

xiujiao commented 4 years ago

Describe the bug When I use shield API to restore shield itself cat shield_backup | shield --core shield-core curl POST https://shield-ip/v2/import -, it complains

<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>

To Reproduce

  1. Deploy shield 8.7.2, configure some jobs including backup shield itself using metashield plugin, run a backup job for shield
  2. Deploy shield 8.7.3
  3. Download and decrypt the backup file for shield, save it to a plain text file: shield_backup
  4. Run cat shield_backup | shield --core shield-core curl POST https://shield-ip/v2/import -

Expected behavior Run successfully

Additional information The reason it failed is that the size of the backup file is 12M, while the client_max_body_size setting is 10M. A workaround solved the issue.

Modify client_max_body_size configure to a bigger value in the location @shield section, at the same time add client_max_body_size in the server section in the /var/vcap/jobs/core/config/nginx.conf file.

Monit stop and start nginx process on shield vm

xiujiao commented 4 years ago

Found out the fix should be in shield-boshrelease, so I closed this one, created it in https://github.com/shieldproject/shield-boshrelease/issues/180