Skip to content

[Improvement] Use different cURL option to prevent OOM error in collector #72

@ejweber

Description

@ejweber

A Longhorn user in longhorn/longhorn#5985 noticed that the support bundle collection process could not complete on resource constrained hardware (Raspberry Pi 4s). They found the following in the support bundle agent logs:

+ curl -v -i -H 'Content-Type: application/zip' --data-binary @node_bundle.zip http://10.244.4.60:8080/nodes/w1
curl: option --data-binary: out of memory
curl: try 'curl --help' or 'curl --manual' for more information

This seems to be a known issue with the cURL --data-binary flag. The entire contents of a file are loaded into RAM before the file is sent. A number of (admittedly old) GitHub and StackOverflow issues mention using the -T(--upload-file) option as an alternative.

If it is possible, we should consider using the -T(--upload-file) option to ensure bundles upload successfully even when memory is limited.

curl/curl#1385
curl/curl#290
https://stackoverflow.com/a/69788901

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions