Comments (4)
Here's the debug log from clamav-rest-api:
> [email protected] start
> node src/app.js
node-clam: DEBUG MODE ON
node-clam: Could not verify the clamdscan binary. [Error: ENOENT: no such file or directory, access '/usr/bin/clamdscan'] {
errno: -2,
code: 'ENOENT',
syscall: 'access',
path: '/usr/bin/clamdscan'
}
node-clam: Could not verify the clamscan binary. [Error: ENOENT: no such file or directory, access '/usr/bin/clamscan'] {
errno: -2,
code: 'ENOENT',
syscall: 'access',
path: '/usr/bin/clamscan'
}
node-clam: Initially testing socket/tcp connection to clamscan server.
node-clam: Attempting to establish socket/TCP connection for "_ping"
node-clam: using remote server: 192.168.4.54:3310
node-clam: Established connection to clamscan server!
node-clam: PONG!
node-clam: Established connection to clamscan server!
Server started on PORT: 8080
node-clam: Socket/Host connection closed.
node-clam: Provided stream is readable.
node-clam: Attempting to establish socket/TCP connection for "scanStream"
node-clam: using remote server: 192.168.4.54:3310
node-clam: Received final data from stream.
node-clam: The input stream has dried up.
node-clam: ClamAV is done scanning.
node-clam: Raw Response:
node-clam: Error Response:
node-clam: File may be INFECTED!
node-clam: Provided stream is readable.
node-clam: Attempting to establish socket/TCP connection for "scanStream"
node-clam: Socket/Host connection closed.
node-clam: ClamAV socket has been closed! false
node-clam: using remote server: 192.168.4.54:3310
node-clam: Received final data from stream.
node-clam: The input stream has dried up.
node-clam: ClamAV is done scanning.
node-clam: Raw Response:
node-clam: Error Response:
node-clam: File may be INFECTED!
node-clam: Provided stream is readable.
node-clam: Attempting to establish socket/TCP connection for "scanStream"
node-clam: Socket/Host connection closed.
node-clam: ClamAV socket has been closed! false
node-clam: using remote server: 192.168.4.54:3310
node-clam: Received final data from stream.
node-clam: The input stream has dried up.
node-clam: ClamAV is done scanning.
node-clam: Raw Response:
node-clam: Error Response:
node-clam: File may be INFECTED!
::ffff:172.17.0.1 - - [07/Aug/2023:13:43:41 +0000] "POST /api/v1/scan HTTP/1.1" 200 203 "-" "curl/8.0.1"
node-clam: Socket/Host connection closed.
node-clam: ClamAV socket has been closed! false
from clamav-rest-api.
I had a look into the network transfer and observed that the clamscan client closes the TCP connection to the clamd socked before the clamd is able to send a response.
Here in detail:
No. Time Source Destination Protocol Length Info
1 0.000000 192.168.4.54 192.168.4.54 TCP 56 63890 → 3310 [SYN] Seq=0 Win=65535 Len=0 MSS=65495 WS=256 SACK_PERM
--[ At this point the clamscan client starts a new TCP connection to clamd. ]--
2 0.000139 192.168.4.54 192.168.4.54 TCP 56 3310 → 63890 [SYN, ACK] Seq=0 Ack=1 Win=65535 Len=0 MSS=65495 WS=256 SACK_PERM
3 0.000222 192.168.4.54 192.168.4.54 TCP 44 63890 → 3310 [ACK] Seq=1 Ack=1 Win=2619648 Len=0
--[ At this point the TCP connection is established. Now clamscan starts to send a file... ]--
4 0.011743 192.168.4.54 192.168.4.54 TCP 370 63890 → 3310 [PSH, ACK] Seq=1 Ack=1 Win=2619648 Len=326
--[ ... file is sent and clamd ACKs. Fine. ]--
5 0.011787 192.168.4.54 192.168.4.54 TCP 44 3310 → 63890 [ACK] Seq=1 Ack=327 Win=2619648 Len=0
6 0.015179 192.168.4.54 192.168.4.54 TCP 44 63890 → 3310 [FIN, ACK] Seq=327 Ack=1 Win=2619648 Len=0
--[ Wait, now clamscan is closing the connection, but no response from clamd was recieved already. ]--
7 0.015241 192.168.4.54 192.168.4.54 TCP 44 3310 → 63890 [ACK] Seq=1 Ack=328 Win=2619648 Len=0
--[ At this point the TCP connection is closed ]--
8 0.045350 192.168.4.54 192.168.4.54 TCP 79 3310 → 63890 [PSH, ACK] Seq=1 Ack=328 Win=2619648 Len=35
--[ Now, clamd has finished scanning, and wants to send the response, but connection is closed. Reset will be sent. ]--
9 0.045412 192.168.4.54 192.168.4.54 TCP 44 63890 → 3310 [RST, ACK] Seq=328 Ack=36 Win=0 Len=0
from clamav-rest-api.
This might be fixed with the provided code change. I successfully tested it.
from clamav-rest-api.
Thanks for your contribution! I really appreciate that!
I will have a look at your PR when I come back from vacation.
from clamav-rest-api.
Related Issues (13)
- [Question] Could I use this API to scan another pod? HOT 2
- k8s setup communication problem - ECONNREFUSED HOT 16
- Why forcing filenames to have APP_FORM_KEY name ? HOT 1
- ECONNREFUSED 127.0.0.1:3310 HOT 16
- what is host name when i use clamd-rest-api within the container.On juypter host name is localhost and its working, but when i run python code within the container its not working . Please help HOT 1
- File storage path
- [Feature] Check if the database signature its up to update in the version endpoint HOT 5
- TypeError: req.files.hasOwnProperty is not a function HOT 19
- CRA returns `"is_infected": null` HOT 6
- a few suggestions and fixes HOT 3
- Limited File Types HOT 3
- Typo on the readme HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clamav-rest-api.