OctopusDeploy/api-client.ts

ERR_FR_MAX_BODY_LENGTH_EXCEEDED When Attempting to Upload Large Packages

Closed this issue · 0 comments

Duplicate: 7959

The underlying HTTP client, Axios defines two (2) configuration properties in its request configuration that limit the size of requests:

// `maxContentLength` defines the max size of the http response content in bytes allowed in node.js
maxContentLength: 2000 // default

// `maxBodyLength` (Node only option) defines the max size of the http request content in bytes allowed
maxBodyLength: 2000 // default

The API client will generate an ERR_FR_MAX_BODY_LENGTH_EXCEEDED error if its attempts to upload a package that exceeds 2MB.

Recommendation

Modify the default request configuration as follows:

maxContentLength: Infinity
maxBodyLength: Infinity

This will enable large packages to be uploaded to Octopus Deploy.

Note: The default timeout for Axios is 0 (no timeout) so large uploads should not be prematurely cancelled during an HTTP request.