Skip to content

Conversation

@mr-raj12
Copy link

@mr-raj12 mr-raj12 commented Jan 1, 2026

Summary

  • Fix crash when ClamAV returns results for files not in CodebaseResource database
  • Add try-except to catch ObjectDoesNotExist and log error instead of crashing
  • Allow scan to continue processing remaining files

Fixes #2019

Test plan

  • Added new test test_scanpipe_pipes_clamav_scan_for_virus_missing_resource
  • All existing ClamAV tests pass
  • Verified with docker-compose test run

   in the CodebaseResource database (e.g., temporary files that were
   cleaned up), the function would crash with ObjectDoesNotExist.

   This fix catches that exception and logs an error message instead
   of crashing, allowing the scan to continue processing other files.

   Fixes aboutcode-org#2019

Signed-off-by: Mrityunjay Raj <mr.raj.earth@gmail.com>
@mr-raj12 mr-raj12 force-pushed the fix-clamav-missing-resource branch from b627276 to b46bf9c Compare January 1, 2026 05:17
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

Successfully merging this pull request may close these issues.

scan_for_virus with ClamAV docker container failed: CodebaseResource matching query does not exist

1 participant