Skip to content

[BUG] #503

@ddgszc

Description

@ddgszc

Describe the bug
Docker build Error,like Clamav timeout

Environment details

  • Operating System: AlmaLinux release 9.5
  • Architecture: x86_64

Release

  • Release: master latest

Error Report
=> [backend stage-0 16/24] WORKDIR /strelka/ 0.0s
=> [backend stage-0 17/24] COPY pyproject.toml poetry.lock ./ 0.0s
=> [backend stage-0 18/24] RUN poetry config virtualenvs.create false && poetry install --only main && rm -rf /root/.cache/pypoetry 50.1s
=> [backend stage-0 19/24] COPY ./src/python/ /strelka/ 0.3s
=> [backend stage-0 20/24] COPY ./configs/python/backend/ /etc/strelka/ 0.1s
=> [backend stage-0 21/24] RUN cd /strelka/ && python3 setup.py -q build && python3 setup.py -q install && python3 setup.py -q clean -- 3.6s
=> ERROR [backend stage-0 22/24] RUN echo '[+] Run build checks' && cd /strelka/strelka/ && if $SCANNER_TESTS; then python3 -m pytest -p n 87.7s

[backend stage-0 22/24] RUN echo '[+] Run build checks' && cd /strelka/strelka/ && if $SCANNER_TESTS; then python3 -m pytest -p no:cacheprovider -s tests/; fi && if false; then python3 -m pytest -s tests_configuration/; fi && echo '[+] Done':
0.170 [+] Run build checks
0.787 ============================= test session starts ==============================
0.787 platform linux -- Python 3.10.12, pytest-7.2.2, pluggy-1.5.0
0.791 rootdir: /strelka
0.791 plugins: unordered-0.5.2, mock-3.10.0, anyio-4.10.0
6.440 collected 182 items
6.441
6.441 tests/test_required_for_scanner.py .
6.444 tests/test_scan_base64.py .
6.446 tests/test_scan_base64_pe.py .
6.448 tests/test_scan_batch.py .
6.517 tests/test_scan_bmp_eof.py .
6.519 tests/test_scan_bzip2.py .
6.521 tests/test_scan_ccn.py .
6.523 tests/test_scan_clamav.py F
36.84 tests/test_scan_delay.py .
37.84 tests/test_scan_dmg.py ...
37.89 tests/test_scan_docx.py .
38.10 tests/test_scan_donut.py ..
38.22 tests/test_scan_elf.py .
38.27 tests/test_scan_email.py ..
38.44 tests/test_scan_encrypted_doc.py ....
44.02 tests/test_scan_encrypted_zip.py ..
45.12 tests/test_scan_entropy.py .
45.12 tests/test_scan_exception.py .
45.12 tests/test_scan_exiftool.py ..
45.45 tests/test_scan_footer.py ..
45.46 tests/test_scan_gif.py .
45.46 tests/test_scan_gzip.py .
45.46 tests/test_scan_hash.py .
45.48 tests/test_scan_header.py ..
45.48 tests/test_scan_html.py ..
45.49 tests/test_scan_ini.py .
45.49 tests/test_scan_iqy.py .
45.50 tests/test_scan_iso.py .
45.50 tests/test_scan_javascript.py ..
45.60 tests/test_scan_jnlp.py .
45.60 tests/test_scan_jpeg.py ..
45.65 tests/test_scan_json.py .
45.65 tests/test_scan_libarchive.py ......
45.67 tests/test_scan_lnk.py .
45.67 tests/test_scan_lzma.py .
45.67 tests/test_scan_macho.py .
45.68 tests/test_scan_manifest.py .
45.68 tests/test_scan_msi.py .
45.89 tests/test_scan_nf.py ....
45.97 tests/test_scan_ocr.py ......
56.57 tests/test_scan_ole.py ....
56.58 tests/test_scan_onenote.py ..
56.59 tests/test_scan_pcap.py sh: 0: getcwd() failed: No such file or directory
57.61 15/8/2025 -- 07:15:13 - - [ERRCODE: SC_ERR_MISSING_CONFIG_PARAM(118)] - NO logging compatible with daemon mode selected, suricata won't be able to log. Please update 'logging.outputs' in the YAML.
57.61 15/8/2025 -- 07:15:13 - - This is Suricata version 6.0.4 RELEASE running in SYSTEM mode
57.68 sh: 0: getcwd() failed: No such file or directory
57.69 15/8/2025 -- 07:15:13 - - [ERRCODE: SC_ERR_MISSING_CONFIG_PARAM(118)] - NO logging compatible with daemon mode selected, suricata won't be able to log. Please update 'logging.outputs' in the YAML.
57.69 15/8/2025 -- 07:15:13 - - This is Suricata version 6.0.4 RELEASE running in SYSTEM mode
57.81 sh: 0: getcwd() failed: No such file or directory
57.86 {"message": "Successfully added file to list", "return": "OK"}
57.86 CompletedProcess(args="suricatasc -c 'pcap-file /tmp/tmpahpir2zt /tmp/tmpaggsomsi 0 true' /tmp/suricata-command.socket ", returncode=0)
57.93 ..
58.40 tests/test_scan_pdf.py .
59.03 tests/test_scan_pe.py ..
59.04 tests/test_scan_pgp.py ....
59.05 tests/test_scan_plist.py .
59.06 tests/test_scan_png_eof.py ...
59.06 tests/test_scan_pyinstaller.py .
59.06 tests/test_scan_qr.py .................
59.99 tests/test_scan_rar.py ...............
64.22 tests/test_scan_save.py ....
64.25 tests/test_scan_seven_zip.py ......
84.91 tests/test_scan_strings.py .
84.91 tests/test_scan_tar.py .
84.91 tests/test_scan_tlsh.py .
84.94 tests/test_scan_transcode.py .........................
86.40 tests/test_scan_udf.py .
86.41 tests/test_scan_upx.py .
86.42 tests/test_scan_url.py ..
86.67 tests/test_scan_vb.py .
86.72 tests/test_scan_vba.py .
86.74 tests/test_scan_vhd.py ..
86.78 tests/test_scan_vsto.py .
86.79 tests/test_scan_x509.py ..
86.79 tests/test_scan_xl4ma.py .
86.92 tests/test_scan_xml.py ..
86.92 tests/test_scan_yara.py ....
86.94 tests/test_scan_zip.py .......
86.97
86.97 =================================== FAILURES ===================================
86.97 _______________________________ test_scan_clamav _______________________________
86.97
86.97 mocker = <pytest_mock.plugin.MockerFixture object at 0x7f920176bca0>
86.97
86.97 def test_scan_clamav(mocker):
86.97 """
86.97 Pass: Sample event matches output of scanner.
86.97 Failure: Unable to load file or sample event fails to match.
86.97 """
86.97 test_scan_event = {
86.97 "Data read": "0.51 MB (ratio 1.06",
86.97 "Data scanned": "0.54 MB",
86.97 "End Date": mock.ANY,
86.97 "Engine version": mock.ANY,
86.97 "Infected files": "0",
86.97 "Known viruses": mock.ANY,
86.97 "Scanned directories": "0",
86.97 "Scanned files": "1",
86.97 "Start Date": mock.ANY,
86.97 "Time": mock.ANY,
86.97 "elapsed": mock.ANY,
86.97 "flags": [],
86.97 }
86.97
86.97 scanner_event = run_test_scan(
86.97 mocker=mocker,
86.97 scan_class=ScanUnderTest,
86.97 fixture_path=Path(file).parent / "fixtures/test.png",
86.97 )
86.97
86.97 TestCase.maxDiff = None
86.97 > TestCase().assertDictEqual(test_scan_event, scanner_event)
86.97
86.97 tests/test_scan_clamav.py:35:
86.97 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
86.97 /usr/lib/python3.10/unittest/case.py:1144: in assertDictEqual
86.97 self.fail(self._formatMessage(msg, standardMsg))
86.97 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
86.97
86.97 self = <unittest.case.TestCase testMethod=runTest>
86.97 msg = "{'Data read': '0.51 MB (ratio 1.06', 'Data [223 chars]: []} != {'elapsed': 30.000388, 'flags': ['timed_out']}\n+ {'el...es': '0',\n- 'Scanned files': '1',\n- 'Start Date': ,\n- 'Time': ,\n- 'elapsed': ,\n- 'flags': []}"
86.97
86.97 def fail(self, msg=None):
86.97 """Fail immediately, with the given message."""
86.97 > raise self.failureException(msg)
86.97 E AssertionError: {'Data read': '0.51 MB (ratio 1.06', 'Data [223 chars]: []} != {'elapsed': 30.000388, 'flags': ['timed_out']}
86.97 E + {'elapsed': 30.000388, 'flags': ['timed_out']}
86.97 E - {'Data read': '0.51 MB (ratio 1.06',
86.97 E - 'Data scanned': '0.54 MB',
86.97 E - 'End Date': ,
86.97 E - 'Engine version': ,
86.97 E - 'Infected files': '0',
86.97 E - 'Known viruses': ,
86.97 E - 'Scanned directories': '0',
86.97 E - 'Scanned files': '1',
86.97 E - 'Start Date': ,
86.97 E - 'Time': ,
86.97 E - 'elapsed': ,
86.97 E - 'flags': []}
86.97
86.97 /usr/lib/python3.10/unittest/case.py:675: AssertionError
86.97 =============================== warnings summary ===============================
86.97 :241
86.97 :241
86.97 :241: DeprecationWarning: builtin type SwigPyPacked has no module attribute
86.97
86.97 :241
86.97 :241
86.97 :241: DeprecationWarning: builtin type SwigPyObject has no module attribute
86.97
86.97 :241
86.97 :241: DeprecationWarning: builtin type swigvarlink has no module attribute
86.97
86.97 ../../usr/local/lib/python3.10/dist-packages/oletools/rtfobj.py:272
86.97 /usr/local/lib/python3.10/dist-packages/oletools/rtfobj.py:272: DeprecationWarning: invalid escape sequence '\d'
86.97 DECIMAL_GROUP = b'(\d{1,250})'
86.97
86.97 ../../usr/local/lib/python3.10/dist-packages/oletools/oleobj.py:537
86.97 /usr/local/lib/python3.10/dist-packages/oletools/oleobj.py:537: DeprecationWarning: invalid escape sequence '-'
86.97 sane_fname = re.sub(u'[^a-zA-Z0-9.\-_ ]', replacement, basepath)
86.97
86.97 ../../usr/local/lib/python3.10/dist-packages/oletools/oleobj.py:581
86.97 /usr/local/lib/python3.10/dist-packages/oletools/oleobj.py:581: SyntaxWarning: "is" with a literal. Did you mean "=="?
86.97 if idx is -1:
86.97
86.97 ../../usr/local/lib/python3.10/dist-packages/M2Crypto/init.py:24
86.97 /usr/local/lib/python3.10/dist-packages/M2Crypto/init.py:24: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
86.97 version_info = StrictVersion(version).version
86.97
86.97 ../../usr/local/lib/python3.10/dist-packages/M2Crypto/m2crypto.py:13
86.97 /usr/local/lib/python3.10/dist-packages/M2Crypto/m2crypto.py:13: DeprecationWarning: the imp module is deprecated in favour of importlib and slated for removal in Python 3.12; see the module's documentation for alternative uses
86.97 import imp
86.97
86.97 ../../usr/local/lib/python3.10/dist-packages/M2Crypto/SSL/ssl_dispatcher.py:8
86.97 /usr/local/lib/python3.10/dist-packages/M2Crypto/SSL/ssl_dispatcher.py:8: DeprecationWarning: The asyncore module is deprecated and will be removed in Python 3.12. The recommended replacement is asyncio
86.97 import asyncore
86.97
86.97 strelka/tests/test_required_for_scanner.py::test_required_for_scanner
86.97 /strelka/strelka/tests/test_required_for_scanner.py:22: UserWarning: Missing scanner test scan_antiword.py
86.97 warnings.warn(f"Missing scanner test {scanner_filename}")
86.97
86.97 strelka/tests/test_required_for_scanner.py::test_required_for_scanner
86.97 /strelka/strelka/tests/test_required_for_scanner.py:22: UserWarning: Missing scanner test scan_cuckoo.py
86.97 warnings.warn(f"Missing scanner test {scanner_filename}")
86.97
86.97 strelka/tests/test_required_for_scanner.py::test_required_for_scanner
86.97 /strelka/strelka/tests/test_required_for_scanner.py:22: UserWarning: Missing scanner test scan_falcon_sandbox.py
86.97 warnings.warn(f"Missing scanner test {scanner_filename}")
86.97
86.97 strelka/tests/test_required_for_scanner.py::test_required_for_scanner
86.97 /strelka/strelka/tests/test_required_for_scanner.py:22: UserWarning: Missing scanner test scan_jar_manifest.py
86.97 warnings.warn(f"Missing scanner test {scanner_filename}")
86.97
86.97 strelka/tests/test_required_for_scanner.py::test_required_for_scanner
86.97 /strelka/strelka/tests/test_required_for_scanner.py:22: UserWarning: Missing scanner test scan_lsb.py
86.97 warnings.warn(f"Missing scanner test {scanner_filename}")
86.97
86.97 strelka/tests/test_required_for_scanner.py::test_required_for_scanner
86.97 /strelka/strelka/tests/test_required_for_scanner.py:22: UserWarning: Missing scanner test scan_php.py
86.97 warnings.warn(f"Missing scanner test {scanner_filename}")
86.97
86.97 strelka/tests/test_required_for_scanner.py::test_required_for_scanner
86.97 /strelka/strelka/tests/test_required_for_scanner.py:22: UserWarning: Missing scanner test scan_pkcs7.py
86.97 warnings.warn(f"Missing scanner test {scanner_filename}")
86.97
86.97 strelka/tests/test_required_for_scanner.py::test_required_for_scanner
86.97 /strelka/strelka/tests/test_required_for_scanner.py:22: UserWarning: Missing scanner test scan_rpm.py
86.97 warnings.warn(f"Missing scanner test {scanner_filename}")
86.97
86.97 strelka/tests/test_required_for_scanner.py::test_required_for_scanner
86.97 /strelka/strelka/tests/test_required_for_scanner.py:22: UserWarning: Missing scanner test scan_rtf.py
86.97 warnings.warn(f"Missing scanner test {scanner_filename}")
86.97
86.97 strelka/tests/test_required_for_scanner.py::test_required_for_scanner
86.97 /strelka/strelka/tests/test_required_for_scanner.py:22: UserWarning: Missing scanner test scan_swf.py
86.97 warnings.warn(f"Missing scanner test {scanner_filename}")
86.97
86.97 strelka/tests/test_required_for_scanner.py::test_required_for_scanner
86.97 /strelka/strelka/tests/test_required_for_scanner.py:22: UserWarning: Missing scanner test scan_tnef.py
86.97 warnings.warn(f"Missing scanner test {scanner_filename}")
86.97
86.97 strelka/tests/test_required_for_scanner.py::test_required_for_scanner
86.97 /strelka/strelka/tests/test_required_for_scanner.py:22: UserWarning: Missing scanner test scan_zlib.py
86.97 warnings.warn(f"Missing scanner test {scanner_filename}")
86.97
86.97 strelka/tests/test_scan_email.py::test_scan_email
86.97 strelka/tests/test_scan_email.py::test_scan_email
86.97 /usr/local/lib/python3.10/dist-packages/magic/init.py:437: PendingDeprecationWarning: Using compatibility mode with libmagic's python binding. See https://github.com/ahupp/python-magic/blob/master/COMPAT.md for details.
86.97 warnings.warn(
86.97
86.97 strelka/tests/test_scan_javascript.py::test_scan_javascript
86.97 /usr/local/lib/python3.10/dist-packages/jsbeautifier/unpackers/packer.py:31: DeprecationWarning: invalid escape sequence '('
86.97 "eval[ ]*([ ]function[ ]([ ]p[ ],[ ]a[ ],[ ]*c["
86.97
86.97 -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
86.97 =========================== short test summary info ============================
86.97 FAILED tests/test_scan_clamav.py::test_scan_clamav - AssertionError: {'Data r...
86.97 ============ 1 failed, 181 passed, 26 warnings in 86.19s (0:01:26) =============


Dockerfile:213


212 | # Run tests. Fail build if any tests fail.

213 | >>> RUN echo '[+] Run build checks' && \

214 | >>> cd /strelka/strelka/ && \

215 | >>> if $SCANNER_TESTS; then python3 -m pytest -p no:cacheprovider -s tests/$SCANNER_TEST; fi && \

216 | >>> if $CONFIG_TESTS; then python3 -m pytest -s tests_configuration/; fi && \

217 | >>> echo '[+] Done'

218 |


target backend: failed to solve: process "/bin/sh -c echo '[+] Run build checks' && cd /strelka/strelka/ && if $SCANNER_TESTS; then python3 -m pytest -p no:cacheprovider -s tests/$SCANNER_TEST; fi && if $CONFIG_TESTS; then python3 -m pytest -s tests_configuration/; fi && echo '[+] Done'" did not complete successfully: exit code: 1

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions