Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

libbz2.so.1 issue #138

Open
ankursharma-news opened this issue Sep 20, 2020 · 3 comments
Open

libbz2.so.1 issue #138

ankursharma-news opened this issue Sep 20, 2020 · 3 comments

Comments

@ankursharma-news
Copy link

After creating project when running the lamda function I'm getting the following error:

Starting clamscan of /tmp/bucket-file-upload/file_example_JPG_1MB copy.jpg

clamscan output:
./bin/clamscan: error while loading shared libraries: libbz2.so.1: cannot open shared object file: No such file or directory

Unexpected exit code from clamscan: 127

[ERROR] Exception: Unexpected exit code from clamscan: 127.

Traceback (most recent call last):
  File "/var/task/scan.py", line 236, in lambda_handler
    scan_result, scan_signature = clamav.scan_file(file_path)
  File "/var/task/clamav.py", line 210, in scan_file
    raise Exception(msg)

Did anybody face this issue recently ? Please suggest.

@ankursharma-news
Copy link
Author

I could fix the issues by adding few more dependencies:

Download libraries we need to run in lambda

WORKDIR /tmp
RUN yumdownloader -x *i686 --archlist=x86_64 clamav clamav-lib clamav-update json-c pcre2 libprelude gnutls libtasn1 lib64nettle nettle libtool-ltdl bzip2-libs libxml2 xz-libs libgcrypt libgpg-error
RUN rpm2cpio clamav-0*.rpm | cpio -idmv
RUN rpm2cpio clamav-lib*.rpm | cpio -idmv
RUN rpm2cpio clamav-update*.rpm | cpio -idmv
RUN rpm2cpio json-c*.rpm | cpio -idmv
RUN rpm2cpio pcre*.rpm | cpio -idmv
RUN rpm2cpio gnutls*.rpm | cpio -idmv
RUN rpm2cpio nettle*.rpm | cpio -idmv
RUN rpm2cpio libprelude*.rpm | cpio -idmv
RUN rpm2cpio libtasn1*.rpm | cpio -idmv
RUN rpm2cpio libtool-ltdl*.rpm | cpio -idmv
RUN rpm2cpio bzip2-libs*.rpm | cpio -idmv
RUN rpm2cpio libxml2*.rpm | cpio -idmv
RUN rpm2cpio xz-libs*.rpm | cpio -idmv
RUN rpm2cpio libgcrypt*.rpm | cpio -idmv
RUN rpm2cpio libgpg-error*.rpm | cpio -idmv

Copy over the binaries and libraries

RUN cp /tmp/usr/bin/clamscan /tmp/usr/bin/freshclam /tmp/usr/lib64/* /opt/app/bin/

@joetheone
Copy link

FYI, if you're getting this error, you're probably running in python 3.8 instead of 3.7 as listed in the docs :)

@alex-ermakov-kf
Copy link

Any ideas how to update python to 3.9 in this function?

chroju added a commit to globis-org/bucket-antivirus-function that referenced this issue Jun 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants