vstoykov / django-clamd

Integrates python-clamd with Django for easy scanning files for viruses on upload
17 stars 33 forks source link

ERROR: test_infinite_stream #20

Open Checkm3out opened 9 months ago

Checkm3out commented 9 months ago

System check identified no issues (0 silenced). ...The file is too large for ClamD to scan it. Bytes Read 26313728 E.

ERROR: test_infinite_stream (django_clamd.tests.test.VirusValidatorTestCase)

Traceback (most recent call last):

src/django-clamd/src/django_clamd/validators.py", line 25, in validate_file_infection result = scanner.instream(file)

lib/python3.10/site-packages/clamd/init.py", line 190, in instream self.clamd_socket.send(size + chunk) ConnectionResetError: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

src/django-clamd/src/django_clamd/tests/test.py", line 56, in test_infinite_stream validate_file_infection(stream)

src/django-clamd/src/django_clamd/validators.py", line 33, in validate_file_infection raise ValidationError( django.core.exceptions.ValidationError: ['Malware scan could not completed. Please try again later.']


Ran 5 tests in 0.095s

FAILED (errors=1)

Hello, I am on currently on commit 989141f56b23925dd9d3c5620ec5bb14b3614289 (also f98c3189c5eab09b0f65ca40cdfc6417d4c8267e) When I run python manage.py test django_clamd.tests the test_infinite_stream is failing

Ubuntu (WSL and Ubuntu Server) Clamd 0.103.9 (No Changes since initial install) Python 3.10.12 (No Changes since initial install)

All tests passed sometime within the past month on 3 different machines Now all 3 get this test failure

I appreciate any guidance in resolving this issue, please let me know if I can provide any more information

vstoykov commented 3 months ago

Is the issue still exists for you?

Checkm3out commented 1 week ago

@vstoykov Yes,

python manage.py test django_clamd.tests.test.VirusValidatorTestCase.test_infinite_stream

Results in failure when running -

validate_file_infection

IOError: validators The file is too large for ClamD to scan it. Bytes Read 104866816

I would expect an infinite stream to result in an error, but the test doesn't seem to reflect that

Thanks!