-
Notifications
You must be signed in to change notification settings - Fork 388
libpcre.so.1: cannot open shared object file: #202
Comments
I had the same issue. I found I had to restrict ClamAV to v0.102.3: see #203. |
@allanlewis I was actually able to fix this without downgrading clamav by updating my
|
Great - are you able to raise a PR with your changes so I can compare with #203? |
@allanlewis I don't have permissions to push my branch to create the PR. I also wanted to create a PR that adds terraform, copied from the cloudformation. We use terraform here at Chronograph, so I converted and wanted to push up here as well. |
@rsitro-chrono you'll need to fork the repo to make a PR, just like I did with mine. |
Hey folks, just wondering did anyone get to the point of understanding what changed under the hood for this issue to occur? I'm assuming a new version of a package/lib was pushed that no longer included @allanlewis - what prompted you to revert ClamAV to v0.102.3? |
No, the underlying OS didn't change, it's that the Docker image used to build the Lambda package is using Amazon Linux 2 (AL2) whereas the Lamdba runtime for Python before 3.8 uses AL1. ClamAV in v0.103.0 updated their bindings such that they no longer support the version of
I found that this version works on AL1. One solution here might be to explicitly drop support for Python <3.8, i.e. the AL1-based Lambda runtimes. Alternatively, we could select the base image for building the Lambda package depending on the target runtime. Given that Python 3.6 is already obsolete, the only version worth supporting on AL1 is Python 3.7, and I don't think it would affect many people if they had to upgrade their AV scanner Lambda to Python 3.8 or 3.9. The issue is that we then hit issues with |
Not sure this is a good idea -- 0.102 is EOL and when I used it, freshclam got blocked: https://blog.clamav.net/2022/01/clamav-01035-and-01042-security-patch.html |
I found a solution in the end - the problem was due to a change in my fork done by someone else years ago. We'd like to rebase on upstream at some point but in the meantime my fix was to use the official Docker image for Lambda Python 3.7 to build the deployment package. |
I thought it builds just using the Amazon Linux 2 Docker Image? Are you saying you built directly using the python lambda image instead? |
The problem is that the Lambda runtime for Python <=3.7 uses Amazon Linux 1 whereas the runtime for Python >=3.8 uses Amazon Linux 2. If you build the package with the wrong one you'll end up trying to run the ClamAV packages from one OS on another, which won't work due to library dependencies, hence this issue. |
Strange... I've been running this with Python 3.7 for half a year now and only recently it's given me this error... |
Yes: the version of ClamAV in the AL2 repos. |
@allanlewis How did you handle the case for the 'nettle' and 'pcre2' packages that aren't available on amazon linux 1? |
I just didn't include them, they don't appear to be necessary. |
@rsitro-chrono the proposed Dockerfile still works as a fix for the current code in the master branch |
Getting this issue when running clamav update in lambda.
b'./bin/freshclam: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory\n'
I do see other that have had this issue in the past and the latest Dockerfile seems to resolve it for them, but not for me. Any ideas?
The text was updated successfully, but these errors were encountered: