cds-snc / scan-files

File scanning for CDS Platform products
https://scan-files.alpha.canada.ca/
MIT License
2 stars 0 forks source link

Bug: ClamAV update failing because of missing server patch #901

Closed patheard closed 4 months ago

patheard commented 4 months ago

Summary

Recently we've started seeing the following message for the ClamAV update process:

The database server doesn't have the latest patch for the bytecode database (version 335). The server will likely have updated if you check again in a few hours.

Full error is below:

{"level":"INFO","location":"update_defs_from_freshclam:131","message":"freshclam output:: Thu Mar 14 12:25:44 2024 -> ClamAV update process started at Thu Mar 14 12:25:44 2024\nThu Mar 14 12:25:44 2024 -> daily database available for update (local version: 27204, remote version: 27214)\nThu Mar 14 12:26:02 2024 -> Testing database: '/tmp/clamav/tmp.b207f03752/clamav-030fb542f9209a7f891b903fa9ac5f47.tmp-daily.cld' ...\nThu Mar 14 12:26:12 2024 -> Database test passed.\nThu Mar 14 12:26:12 2024 -> daily.cld updated (version: 27214, sigs: 2055122, f-level: 90, builder: raynman)\nThu Mar 14 12:26:12 2024 -> main.cvd database is up-to-date (version: 62, sigs: 6647427, f-level: 90, builder: sigmgr)\nThu Mar 14 12:26:12 2024 -> bytecode database available for update (local version: 334, remote version: 335)\nWARNING: Thu Mar 14 12:26:12 2024 -> [LibClamAV] No DB open for action UNLINK on line 8\nERROR: Thu Mar 14 12:26:12 2024 -> downloadPatch: Can't apply patch\nThu Mar 14 12:26:12 2024 -> The database server doesn't have the latest patch for the bytecode database (version 335). The server will likely have updated if you check again in a few hours.\nThu Mar 14 12:26:12 2024 -> Clamd successfully notified about the update.\n","timestamp":"2024-03-14 12:26:12,936+0000","service":"scan-files-api","xray_trace_id":"1-65f2ecc6-0f9d64c92caed74e0d2850e6"}

This has been persisting for over a week so should be investigated.

patheard commented 4 months ago

Tracked the error down to the old version of ClamAV running. This should be fixed with an upgrade to the latest Alpine ClamAV available.

patheard commented 4 months ago

Updates are now working as expected:

bytecode.cld updated (version: 335, sigs: 86, f-level: 90, builder: raynman)