rancher / rancher/support-bundle-kit
[Improvement] Use different cURL option to prevent OOM error in collector
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 24
- Forks
- 43
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 6
Description
A Longhorn user in https://github.com/longhorn/longhorn/issues/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.
https://github.com/curl/curl/issues/1385
https://github.com/curl/curl/issues/290
https://stackoverflow.com/a/69788901
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the support bundle collector code that builds the curl upload command shown in the agent logs. Check how the node_bundle.zip file is sent, then verify that changing the upload option allows bundles to complete on memory-constrained hardware without the reported out-of-memory error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100