-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description:
When uploading a file using the cap-js/attachments
plugin, the server crashes due to an out-of-memory (OOM) error during the virus scanning phase. This happens consistently with large files.
Expected Behavior:
The server should handle file uploads and virus scanning without exceeding memory limits or crashing.
Actual Behavior:
- Server memory usage spikes from ~250MB (idle) to 2.3GB during virus scanning.
- The process is killed with exit code 137 (OOM).
- No error is returned to the client; the request appears to succeed (
204
), but the server crashes shortly after.
Steps to Reproduce:
- Start the CAP server with the
cap-js/attachments
plugin enabled. - Upload a large file (e.g., ~350MB) to an entity with an attachment field.
- Observe server memory usage during the upload and virus scanning.
- Server crashes with OOM.
Logs:
2025-10-09T16:42:20.142+0000 [RTR/41] STDOUT ... "PUT /odata/v1/TaskService/Tasks_attachments(...) HTTP/1.1" 204 ...
...
2025-10-09T16:42:39.736+0000 [APP/PROC/WEB/0] STDERR Killed
2025-10-09T16:42:41.364+0000 [APP/PROC/WEB/0] STDERR npm verbose exit 137
2025-10-09T16:42:41.364+0000 [APP/PROC/WEB/0] STDERR npm verbose code 137
Environment:
- Node.js: v22.5.0
- npm: v10.8.2
- CDS Version: 8.9.4
- OS: Linux 5.15.0-153-generic
- Platform: SAP BTP Cloud Foundry
- Plugin:
cap-js/attachments
Additional Context:
- The issue seems to be related to the virus scanning step.
- Might be related to how the file is buffered or streamed in memory.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working