Odoo 17 Large Database Restore Error –  413 Request Entity Too Large

Odoo 17 Large Database Restore Error –  413 Request Entity Too Large

While grappling with a perplexing ‘413 REQUEST ENTITY TOO LARGE’ error during the restoration of a sizable database backup onto an existing server, the common reflex was to scrutinize the nginx configuration file. However, the root cause proved elusive, as the same issue persisted when loading Odoo with an IP and port. Before you jump to the standard advice of adjusting ‘client_max_body_size’ in your nginx configuration, bear with me, because this situation is peculiar and unrelated to nginx or Apache. In an unexpected twist, the solution resided not in the nginx configuration but in the Odoo configuration file (/etc/odoo/odoo.conf). The key was to add a parameter with a significantly higher value:

[options]
web.max_file_upload_size =
Surprisingly, ‘web.max_file_upload_size’ couldn’t be overridden via the odoo.conf file. However, a breakthrough came when I edited line number 235 in ‘odoo/odoo/http.py,’ adjusting the parameter from its default:
DEFAULT_MAX_CONTENT_LENGTH = 128 * 1024 * 1024 # 128MiB
to a more accommodating:
DEFAULT_MAX_CONTENT_LENGTH = 500 * 1024 * 1024
This tweak allowed the successful restoration of the database. While it’s not ideal to alter base files, this workaround was necessary for the time being. Here’s hoping that Odoo addresses and resolves this issue in upcoming releases, sparing users the need for such manual interventions.

For more insights and professional Odoo Community/Enterprise implementations, connect with us at hashcodeit.com or drop an email at [email protected], +971545975212.  Transform your Odoo journey with precision and expertise!

Leave a Reply