Mailing List Archive

[clamav-users] Clam AV error 127
Hi All

We are getting error 127 when we run the clamscan command in an AWS Lambda written in Java

From the logs the command we are running is :
/var/task/clamscan --database=/tmp/antivirus-data/ /tmp/antivirus-data/files-to-scan/ZA34576/023c1fee-f3e6-44a9-88b3-643e15e5adeb/9c4225b5-0d3c-42ee-9fa6-e3e61eb34d76

Java code snippet:
String command = antivirusDir + "/clamscan --database=" + WORKING_DIR + " " + pathStr;
Process p = Runtime.getRuntime().exec(command);
p.waitFor();
if (p.exitValue() == 0) {
return FileStatus.CLEAN;
} else if (p.exitValue() == 1) {
return FileStatus.INFECTED;
}

p.exitValue() is returning 127

The clam AV definitions are being downloaded from s3 to /tmp/antivirus-data/ folder.

Could we get some help on the above please ?

Thanks
Standard Bank email disclaimer and confidentiality note
Please go to www.standardbank.co.za/site/homepage/emaildisclaimer.html to read our email disclaimer and confidentiality note. Kindly email disclaimer@standardbank.co.za (no content or subject line necessary) if you cannot view that page and we will email our email disclaimer and confidentiality note to you.
Re: [clamav-users] Clam AV error 127 [ In reply to ]
Hi there,

On Tue, 1 Dec 2020, Pappas, Shaun S via clamav-users wrote:

> We are getting error 127 when we run the clamscan command in an AWS Lambda written in Java
>
> From the logs the command we are running is :
> /var/task/clamscan --database=/tmp/antivirus-data/ /tmp/antivirus-data/files-to-scan/ZA34576/023c1fee-f3e6-44a9-88b3-643e15e5adeb/9c4225b5-0d3c-42ee-9fa6-e3e61eb34d76
>
> Java code snippet:
> String command = antivirusDir + "/clamscan --database=" + WORKING_DIR + " " + pathStr;
> Process p = Runtime.getRuntime().exec(command);
> p.waitFor();
> if (p.exitValue() == 0) {
> return FileStatus.CLEAN;
> } else if (p.exitValue() == 1) {
> return FileStatus.INFECTED;
> }
>
> p.exitValue() is returning 127
>
> The clam AV definitions are being downloaded from s3 to /tmp/antivirus-data/ folder.
>
> Could we get some help on the above please ?

I'm not sure what your interpreter is doing with the codes but it
looks to me like a standard operating system error code. See for
example your favourite search engine and things like

https://stackoverflow.com/questions/1763156/127-return-code-from

If I had to guess, '/var/task/clamscan' does not exist, or it is not
executable for the right user, or simply fails to run. Perhaps the
permissions are wrong, a library is missing, broken, or compiled for
the wrong architecture or something like that. Have you tried running
it at the command line as the user which is expecting to run the job?

--

73,
Ged.

_______________________________________________

clamav-users mailing list
clamav-users@lists.clamav.net
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml