-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clamav file size limit - throw custom error #102
Comments
Hi @kylefarris, Please can you help me |
Hi @SaltwaterC, @genio, @ngraef Please can you help me |
I'm observing the same situation (clamd v0.104 and clamd v0.105). What I can say is that sometimes it is Reject example: node-clam: Provided stream is readable.
node-clam: Attempting to establish socket/TCP connection for "scanStream"
node-clam: using remote server: 127.0.0.1:3310
node-clam: Received final data from stream.
node-clam: The input stream has dried up.
node-clam: _initSocket Socket/Host connection failed: Error: write EPIPE
at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:94:16) {
errno: 'EPIPE',
code: 'EPIPE',
syscall: 'write'
}
node-clam: scanStream Error emitted from ClamAV socket: Error: write EPIPE
at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:94:16) {
errno: 'EPIPE',
code: 'EPIPE',
syscall: 'write'
}
node-clam: _initSocket Socket/Host connection closed.
node-clam: scanStream ClamAV socket has been closed! true and here is Resolve with NodeClamError example: node-clam: Provided stream is readable.
node-clam: Attempting to establish socket/TCP connection for "scanStream"
node-clam: using remote server: 127.0.0.1:3310
node-clam: Received final data from stream.
node-clam: The input stream has dried up.
node-clam: scanStream Received output from ClamAV Socket.
node-clam: scanStream ClamAV is done scanning.
node-clam: scanStream Raw Response: INSTREAM size limit exceeded. ERROR
node-clam: Error Response: INSTREAM size limit exceeded.
node-clam: File may be INFECTED!
CUSTOM DEBUG scanStream before resolve: NodeClamError: An error occurred while scanning the piped-through stream: INSTREAM size limit exceeded.
at NodeClam._processResult (/home/benzino/Dokumenty/clamav-rest-api/node_modules/clamscan/index.js:781:20)
at Socket.<anonymous> (/home/benzino/Dokumenty/clamav-rest-api/node_modules/clamscan/index.js:2283:45)
at Socket.emit (events.js:326:22)
at endReadableNT (_stream_readable.js:1241:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
data: { error: 'INSTREAM size limit exceeded. \u0000' },
date: 2022-07-27T10:07:14.898Z
}
node-clam: _initSocket Socket/Host connection failed: Error: write EPIPE
at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:94:16) {
errno: 'EPIPE',
code: 'EPIPE',
syscall: 'write'
}
node-clam: scanStream Error emitted from ClamAV socket: Error: write EPIPE
at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:94:16) {
errno: 'EPIPE',
code: 'EPIPE',
syscall: 'write'
}
node-clam: _initSocket Socket/Host connection closed.
node-clam: scanStream ClamAV socket has been closed! true |
I have investigated it a little bit more, and it looks like it can be a problem on
After that the socket is closed (link) Here is the debug information from calmd side when WARNING: Thu Jul 28 12:32:11 2022 -> INSTREAM: Size limit reached, (requested: 104857600, max: 26214400)
Thu Jul 28 12:32:11 2022 -> Moved partial command: 4
Thu Jul 28 12:32:11 2022 -> mode == MODE_STREAM
Thu Jul 28 12:32:11 2022 -> Got chunksize: 104857600
Thu Jul 28 12:32:11 2022 -> Shutting down socket after error (FD 10)
Thu Jul 28 12:32:11 2022 -> Number of file descriptors polled: 1 fds It looks like |
@benzino77 If you have any spare time to look into how to resolve the issue of |
No problem. I will make PR with proposition. |
@benzino77 - Thanks for spending some time here - to help us! 😊 |
Definitely, this approach going to help us. therefore we can notify such error in our services & then we'll throw based that to my HTTP client request @benzino77 @kylefarris Looking forward to this PR 🏳 |
Now I start thinking that it can be I'm starting my holidays so I will get back to this when I'll be back. |
Thanks for the update @benzino77. Enjoy your holidays! |
Proper error handling in scanStream method.
Proper error handling in scanStream method.
For such errors - Clamav file size limit
Are you throwing with an exact error message?
Expecting
Somehow it should return the same error message to us
This WARNING message should return to ClamScan level so that we can understand those errors - we can throw custom based on your error message info.
The text was updated successfully, but these errors were encountered: