前提・実現したいこと
以下のgitリポジトリを利用してAWS lambdaを使用したS3Bucketに対するウイルススキャンを実装したいです
https://github.com/upsidetravel/bucket-antivirus-function
readmeを参考にlambda関数を作成しておりますが、
ウイルス定義ファイルを更新する関数
update.lambda_handler
を実行すると以下のエラーメッセージが返却され、実行ウイルス定義ファイルがダウンロードされません
メッセージから察するにlambdaから共有フォルダが見えていないか存在していないことが原因のようですが、
リポジトリが更新されていないことによるものなのか、私の環境でしか起きないことなのかもわからず困っております。
どなたか詳しい方がいらっしゃいましたらご教示ください
発生している問題・エラーメッセージ
START RequestId: xxxxxxxxxxxxxxxxxxxxxxxx Version: $LATEST Script starting at 2021/04/19 04:37:41 UTC Attempting to create directory /tmp/clamav_defs. Starting freshclam with defs in /tmp/clamav_defs. freshclam output: b'./bin/freshclam: error while loading shared libraries: libprelude.so.28: cannot open shared object file: No such file or directory\n' Unexpected exit code from freshclam: 127. File does not exist: main.cld File does not exist: main.cvd File does not exist: daily.cld File does not exist: daily.cvd File does not exist: bytecode.cld File does not exist: bytecode.cvd Script finished at 2021/04/19 04:37:42 UTC END RequestId: xxxxxxxxxxxxxxxxxxxxxxxx REPORT RequestId: xxxxxxxxxxxxxxxxxxxxxxxx Duration: 2604.36 ms Billed Duration: 2605 ms Memory Size: 128 MB Max Memory Used: 85 MB Init Duration: 334.40 ms
補足情報(FW/ツールのバージョンなど)
今気になっているのはリポジトリ内のDockerfileはベースがamazonlinux:2
なのに対し、lambdaはランタイムがPython3.7でありAMIはamazonlinux1であることですが、これが関係しているのかもよくわかりません。
ランタイムをpython3.8に変更すると以下のエラーが発生するため、3.7で実行すべきかとは思いますが。。
{ "errorMessage": "[Errno 2] No such file or directory: 'ld'", "errorType": "FileNotFoundError", "stackTrace": [ " File \"/var/task/update.py\", line 44, in lambda_handler\n clamav.update_defs_from_freshclam(AV_DEFINITION_PATH, CLAMAVLIB_PATH)\n", " File \"/var/task/clamav.py\", line 115, in update_defs_from_freshclam\n \":\".join(current_library_search_path()),\n", " File \"/var/task/clamav.py\", line 45, in current_library_search_path\n ld_verbose = subprocess.check_output([\"ld\", \"--verbose\"]).decode(\"utf-8\")\n", " File \"/var/lang/lib/python3.8/subprocess.py\", line 415, in check_output\n return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,\n", " File \"/var/lang/lib/python3.8/subprocess.py\", line 493, in run\n with Popen(*popenargs, **kwargs) as process:\n", " File \"/var/lang/lib/python3.8/subprocess.py\", line 858, in __init__\n self._execute_child(args, executable, preexec_fn, close_fds,\n", " File \"/var/lang/lib/python3.8/subprocess.py\", line 1706, in _execute_child\n raise child_exception_type(errno_num, err_msg, err_filename)\n" ] }

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。