Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: test_infinite_stream #20

Open
Checkm3out opened this issue Dec 22, 2023 · 3 comments
Open

ERROR: test_infinite_stream #20

Checkm3out opened this issue Dec 22, 2023 · 3 comments

Comments

@Checkm3out
Copy link

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 989141f
(also f98c318)
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
Copy link
Owner

Is the issue still exists for you?

@Checkm3out
Copy link
Author

@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!

@vstoykov
Copy link
Owner

Reading more precisely the traceback I see

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

This may mean that the ClamD deamon is not running or there is some missconfiguration.

Now you report different message

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

This is actually a warning in the code

Now I read more closely your last comment and I see python manage.py test. This means that you are trying to run the django_clamd tests from your project. I'm not sure that I ever tested it like that.

Also reading the code few lines below the place where the warning was printed we can see the settings (which is False by default) but probbaly in your project it is set to True.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants