kylefarris / clamscan

A robust ClamAV virus scanning library supporting scanning files, directories, and streams with local sockets, local/remote TCP, and local clamscan/clamdscan binaries (with failover).
MIT License
236 stars 69 forks source link

Occasionally getting the 502 Proxy error while running this clamscan service on the Prod server. #85

Open reshmpk1 opened 2 years ago

reshmpk1 commented 2 years ago

I am getting this below mentioned error some times on our stage and production server:

502 Proxy Error

Proxy Error

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request

Reason: Error reading from remote server

**We have load balance and multiple app servers behind our VM host.** **NOTE: Looking for your valuable input on this issue**
kylefarris commented 2 years ago

It's hard to help you without a better idea of how you have everything setup, your network/server topology, etc... I'll help if I can but I need more info.

reshmpk1 commented 2 years ago

https://javascript.plainenglish.io/integrate-clamav-antivirus-software-in-your-node-js-application-39d92ff76792 These are the steps we followed to integrate the clamscan. configured the clamscan and camdscan objects, initialing the Clamscan with the file path and applying the scanning a file that is attached.

We have Akamai proxy in front of the LB and behind the LB 2 VMs.

image

kylefarris commented 2 years ago

You have two proxies. The Akamai one and the Apache one. Do you know which proxy is having the issue? What kind of requests are you making? You're running a node server obviously, so, are you able to hit any endpoints on that service? Maybe just a basic "Hello World" endpoint? If that doesn't work, then this is outside the scope of this project. If it's only happening on endpoints involving this library, I'll need some more information.