awslabs / cdk-serverless-clamscan

Apache License 2.0
237 stars 67 forks source link

cannot scan large files: No such file or directory: '7za' #1084

Closed Tietew closed 6 months ago

Tietew commented 9 months ago

I uploaded a 4GiB file (DVD ISO file) with no extension. (the S3 key is zzzzzzzz/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) ServerlessClamscan lambda failed with following error log.

Note: a 600MiB file is scanned and tagged CLEAN successfully.

[ERROR] FileNotFoundError: [Errno 2] No such file or directory: '7za'
Traceback (most recent call last):
  File "/var/lang/lib/python3.11/site-packages/aws_lambda_powertools/metrics/provider/base.py", line 205, in decorate
    response = lambda_handler(event, context, *args, **kwargs)
  File "/var/lang/lib/python3.11/site-packages/aws_lambda_powertools/logging/logger.py", line 453, in decorate
    return lambda_handler(event, context, *args, **kwargs)
  File "/var/task/lambda.py", line 80, in lambda_handler
    expand_if_large_archive(
  File "/var/task/lambda.py", line 164, in expand_if_large_archive
    archive_summary = subprocess.run(
  File "/var/lang/lib/python3.11/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/var/lang/lib/python3.11/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/var/lang/lib/python3.11/subprocess.py", line 1950, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)

Packages

aws-cdk-lib 2.121.1 cdk-serverless-clamscan 2.6.73

Environment

Ubuntu 20.04 x86_64 Docker 20.10.24 Node.JS 18.17.1

dontirun commented 9 months ago

Do you receive the same error if the extension is included on the ISO?

Tietew commented 8 months ago

@dontirun I tried (object key xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.iso), but received same error.

vincentelbrachtbtc commented 7 months ago

same issue here.

[ERROR] FileNotFoundError: [Errno 2] No such file or directory: '7za'
Traceback (most recent call last):
  File "/var/lang/lib/python3.11/site-packages/aws_lambda_powertools/metrics/provider/base.py", line 205, in decorate
    response = lambda_handler(event, context, *args, **kwargs)
  File "/var/lang/lib/python3.11/site-packages/aws_lambda_powertools/logging/logger.py", line 449, in decorate
    return lambda_handler(event, context, *args, **kwargs)
  File "/var/task/lambda.py", line 80, in lambda_handler
    expand_if_large_archive(
  File "/var/task/lambda.py", line 164, in expand_if_large_archive
    archive_summary = subprocess.run(
  File "/var/lang/lib/python3.11/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/var/lang/lib/python3.11/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/var/lang/lib/python3.11/subprocess.py", line 1950, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)

my package.json:

"devDependencies": {
    "@types/dot-object": "^2.1.6",
    "@types/jest": "^29.5.11",
    "@types/node": "^18",
    "@typescript-eslint/eslint-plugin": "^6",
    "@typescript-eslint/parser": "^6",
    "aws-cdk": "2.115.0",
    "esbuild": "^0.19.10",
    "eslint": "^8",
    "eslint-import-resolver-typescript": "^3.6.1",
    "eslint-plugin-import": "^2.29.1",
    "jest": "^29.7.0",
    "jest-junit": "^15",
    "projen": "^0.78.0",
    "ts-jest": "^29.1.1",
    "ts-node": "^10.9.2",
    "typescript": "^5.3.3"
  },
  "dependencies": {
    "@aws-quickstart/eks-blueprints": "1.13.1",
    "aws-cdk-lib": "2.115.0",
    "cdk-serverless-clamscan": "^2.6.116",
    "constructs": "^10.0.5",
    "dot-object": "^2.1.4",
    "source-map-support": "^0.5.13",
    "ts-deepmerge": "^6.2.0"
  }